Hello,

How can an AVFilter determine whether its input is VFR or CFR?
If the input is CFR, how can it get the frame rate in FPS?
I would like to do this in advance of processing any frames, that is,
in init() or config_input().
Please see the implementation below:

static int is_vfr(AVFilterLink *inlink)
{
    return ???; // what goes here?
}

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

static int config_input(AVFilterLink *inlink)
{
    float fps;

    if (is_vfr(inlink)) {
        av_log(ctx, AV_LOG_ERROR, "This filter does not support VFR video.\n");
        return AVERROR(EINVAL);
    }
    fps = get_cfr_fps(inlink);
    ...
}


Thanks in advance...
R
_______________________________________________
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to