[FFmpeg-devel] [PATCH] libsvtav1: Add workaround for gop_size == 1

Ronald S. Bultje rsbultje at gmail.com
Tue Jun 27 01:17:07 EEST 2023


Hi,

On Mon, Jun 26, 2023 at 1:47 PM Vignesh Venkatasubramanian <
vigneshv-at-google.com at ffmpeg.org> wrote:

> In some versions of libsvtav1, setting intra_period_length to 0
> does not produce the intended result (i.e.) all frames produced
> are not keyframes.
>
> Instead handle the gop_size == 1 as a special case by setting
> the pic_type to EB_AV1_KEY_PICTURE when encoding each frame so
> that all the output frames are keyframes.
>
> SVT-AV1 Bug: https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2076
>
> Example command: ffmpeg -f lavfi -i testsrc=duration=1:size=64x64:rate=30
> -c:v libsvtav1 -g 1 -y test.webm
>
> Before: Only first frame is keyframe.
> After: All frames are keyframes.
>
> Signed-off-by: Vignesh Venkatasubramanian <vigneshv at google.com>
> ---
>  libavcodec/libsvtav1.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>

It feels a bit dirty to add workarounds in ffmpeg library wrappers for bugs
in these libraries. Not 100% against it, but it's not particularly great.

Ronald


More information about the ffmpeg-devel mailing list