avenc: Choose 25 fps if we don't have any in the caps

Some encoders require a non-zero framerate to be configured properly
and just choosing something will make them not fail completely at
least.

https://bugzilla.gnome.org/show_bug.cgi?id=708732
This commit is contained in:
Sebastian Dröge 2013-10-01 22:38:32 +02:00
parent 2daefd69b8
commit 9becd72b60

View file

@ -2511,8 +2511,14 @@ gst_ffmpeg_videoinfo_to_context (GstVideoInfo * info, AVCodecContext * context)
context->bits_per_coded_sample = bpp;
context->ticks_per_frame = 1;
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);
context->sample_aspect_ratio.den = GST_VIDEO_INFO_PAR_D (info);