diff --git a/subprojects/gst-libav/ext/libav/gstavcodecmap.c b/subprojects/gst-libav/ext/libav/gstavcodecmap.c index a7c64e0106..6610593bb6 100644 --- a/subprojects/gst-libav/ext/libav/gstavcodecmap.c +++ b/subprojects/gst-libav/ext/libav/gstavcodecmap.c @@ -2956,13 +2956,14 @@ gst_ffmpeg_videoinfo_to_context (GstVideoInfo * info, AVCodecContext * context) bpp += GST_VIDEO_INFO_COMP_DEPTH (info, i); context->bits_per_coded_sample = bpp; - context->time_base.den = 1000000000; - context->time_base.num = 1; context->ticks_per_frame = 1; - - if (GST_VIDEO_INFO_FPS_N (info) != 0) { - context->framerate.num = GST_VIDEO_INFO_FPS_N (info); - context->framerate.den = GST_VIDEO_INFO_FPS_D (info); + if (GST_VIDEO_INFO_FPS_N (info) == 0) { + GST_DEBUG ("Using 25/1 framerate"); + context->time_base.den = 25; + context->time_base.num = 1; + } else { + context->time_base.den = GST_VIDEO_INFO_FPS_N (info); + context->time_base.num = GST_VIDEO_INFO_FPS_D (info); } context->sample_aspect_ratio.num = GST_VIDEO_INFO_PAR_N (info); diff --git a/subprojects/gst-libav/ext/libav/gstavvidenc.c b/subprojects/gst-libav/ext/libav/gstavvidenc.c index 9659d694d4..34d4165a2e 100644 --- a/subprojects/gst-libav/ext/libav/gstavvidenc.c +++ b/subprojects/gst-libav/ext/libav/gstavvidenc.c @@ -308,7 +308,9 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder, * (1<<16) - 1 . We therefore scale them down. * Agreed, it will not be the exact framerate... but the difference * shouldn't be that noticeable */ - ffmpegenc->context->time_base.num = 1; + ffmpegenc->context->time_base.num = + (gint) gst_util_uint64_scale_int (ffmpegenc->context->time_base.num, + 65535, ffmpegenc->context->time_base.den); ffmpegenc->context->time_base.den = 65535; GST_LOG_OBJECT (ffmpegenc, "MPEG4 : scaled down framerate to %d / %d", ffmpegenc->context->time_base.den, ffmpegenc->context->time_base.num);