[FFmpeg-devel] How to tell CFR/VFR video apart, and determine frame rate

Richard Ling divetec at rling.com
Fri Sep 29 15:32:44 EEST 2017


How can I determine whether a filter input is VFR or CFR?

static int is_vfr(AVFilterLink *inlink)
{
    return ???;
}

If I determine the input is CFR, how do I get the frame rate in FPS?
Is it always the reciprocal of timebase, if not what is the correct
implementation?

static float get_constant_frame_rate(AVFilterLink *inlink)
{
    return 1.0f / av_q2d(inlink->time_base);  // correct??
}

Thanks in advance...
R


More information about the ffmpeg-devel mailing list