From fa49369c46c704c825589f7dee4b62640d20a790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 May 2024 16:32:16 +0300 Subject: [PATCH] avvidenc: Only use 2 ticks per frame if encoding interlaced video Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3518 Part-of: --- subprojects/gst-libav/ext/libav/gstavvidenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-libav/ext/libav/gstavvidenc.c b/subprojects/gst-libav/ext/libav/gstavvidenc.c index 78694c303f..0d6e987237 100644 --- a/subprojects/gst-libav/ext/libav/gstavvidenc.c +++ b/subprojects/gst-libav/ext/libav/gstavvidenc.c @@ -630,7 +630,9 @@ gst_ffmpegvidenc_send_frame (GstFFMpegVidEnc * ffmpegenc, picture->pts = AV_NOPTS_VALUE; } else { #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 31, 100) - const gint ticks_per_frame = (ffmpegenc->context->codec_descriptor + const gint ticks_per_frame = + (GST_VIDEO_INFO_IS_INTERLACED (&ffmpegenc->input_state->info) + && ffmpegenc->context->codec_descriptor && ffmpegenc->context-> codec_descriptor->props & AV_CODEC_PROP_FIELDS) ? 2 : 1; #else