[FFmpeg-devel] Setting the frame rate in libavcodec/libopenh264enc.c

Gregory J Wolfe gregory.wolfe at kodakalaris.com
Thu Jul 9 17:49:07 CEST 2015


We have been using Cisco's libopenh264 as part of FFmpeg with good results.
However, function svc_encode_init() in libavcodec/libopenh264enc.c appears to
be setting the frame rate incorrectly.  The line of code in question looks like:

    param.fMaxFrameRate = avctx->time_base.den / avctx->time_base.num;

Since fMaxFrameRate is of type float, shouldn't this be something like:

    param.fMaxFrameRate = avctx->time_base.den / (double)avctx->time_base.num;

Or is there some reason why the frame rate should get truncated to an integer?

Greg Wolfe, Kodak Alaris (formerly part of Eastman Kodak)


More information about the ffmpeg-devel mailing list