avvidenc: Only use 2 ticks per frame if encoding interlaced video

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3518

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6505>
This commit is contained in:
Sebastian Dröge 2024-05-01 16:32:16 +03:00 committed by GStreamer Marge Bot
parent 03465d0904
commit ee518b9c7e

View file

@ -630,7 +630,9 @@ gst_ffmpegvidenc_send_frame (GstFFMpegVidEnc * ffmpegenc,
picture->pts = AV_NOPTS_VALUE; picture->pts = AV_NOPTS_VALUE;
} else { } else {
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 31, 100) #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-> && ffmpegenc->context->
codec_descriptor->props & AV_CODEC_PROP_FIELDS) ? 2 : 1; codec_descriptor->props & AV_CODEC_PROP_FIELDS) ? 2 : 1;
#else #else