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);
* (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);