Set scalability mode in FFmpegVideoEncoder for AV1
Categories
(Core :: Audio/Video: Web Codecs, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox128 | --- | fixed |
People
(Reporter: chunmin, Assigned: chunmin)
References
Details
Attachments
(5 files, 2 obsolete files)
This is required to implement the SVC setting for Webcodecs API when using AV1 codec
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
Depends on D211951
| Assignee | ||
Comment 3•2 years ago
|
||
Depends on D211952
| Assignee | ||
Comment 4•2 years ago
|
||
Depends on D211953
| Assignee | ||
Comment 5•2 years ago
|
||
Depends on D211953
| Assignee | ||
Comment 6•2 years ago
|
||
Depends on D212170
| Assignee | ||
Comment 7•2 years ago
•
|
||
Note:
After studying the code in libaom, I found that SVC (Scalable Video Coding) in libaom only works if look-ahead processing (LAP) is disabled. This is because the LAYER_CONTEXT is only allocated for ctx->ppi->cpi->svc but not for ctx->ppi->cpi_lap->svc (svc in ctx->ppi->cpi_lap).
If LAP is enabled, running cpi_lap with av1_change_config then av1_update_layer_context_change_config will result in accessing the null cpi_lap->svc->layer_context (since layer_context is not allocated in cpi_lap), causing a segmentation fault.
Therefore, to use SVC, LAP must be disabled. LAP can be disabled in two cases: (1) if the bitrate is constant (CBR mode) or (2) if lag-in-frames is set to zero.
The libaom automatically disables LAP if the bitrate is constant. Otherwise, it calculates the num_lap_buffers value to determine if LAP should be enabled. By setting g_lag_in_frames to 0 (e.g., via av_opt_set(mCodecContext->priv_data, "lag-in-frames", "0", 0)), the num_lap_buffers will become 0 and lap_enabled will be set to false. Accordingly, no cpi_lap will be used.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 8•2 years ago
|
||
This patch extends the timeout duration in
temporal-svc-encoding.https.any.js WPT to accommodate the longer
processing time required for AV1 SVC encoding with the libaom encoder.
This adjustment is necessary to prevent timeout issues in our CI
environment.
Depends on D211954
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 11•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e0f0e274e21f
https://hg.mozilla.org/mozilla-central/rev/f62750343c4c
https://hg.mozilla.org/mozilla-central/rev/f089bb5743b1
https://hg.mozilla.org/mozilla-central/rev/b8acdb82bb51
https://hg.mozilla.org/mozilla-central/rev/02e1ce846c4c
Description
•