mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/vf_vfrdet: also report average delta
This commit is contained in:
parent
4ce263a7fd
commit
3420e56d9a
@ -18946,8 +18946,8 @@ This filter tries to detect if the input is variable or constant frame rate.
|
||||
|
||||
At end it will output number of frames detected as having variable delta pts,
|
||||
and ones with constant delta pts.
|
||||
If there was frames with variable delta, than it will also show min and max delta
|
||||
encountered.
|
||||
If there was frames with variable delta, than it will also show min, max and
|
||||
average delta encountered.
|
||||
|
||||
@section vibrance
|
||||
|
||||
|
@ -29,6 +29,7 @@ typedef struct VFRDETContext {
|
||||
int64_t delta;
|
||||
int64_t min_delta;
|
||||
int64_t max_delta;
|
||||
int64_t avg_delta;
|
||||
|
||||
uint64_t vfr;
|
||||
uint64_t cfr;
|
||||
@ -53,6 +54,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
s->delta = delta;
|
||||
s->min_delta = FFMIN(delta, s->min_delta);
|
||||
s->max_delta = FFMAX(delta, s->max_delta);
|
||||
s->avg_delta += delta;
|
||||
} else {
|
||||
s->cfr++;
|
||||
}
|
||||
@ -81,7 +83,7 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
|
||||
av_log(ctx, AV_LOG_INFO, "VFR:%f (%"PRIu64"/%"PRIu64")", s->vfr / (float)(s->vfr + s->cfr), s->vfr, s->cfr);
|
||||
if (s->vfr)
|
||||
av_log(ctx, AV_LOG_INFO, " min: %"PRId64" max: %"PRId64")", s->min_delta, s->max_delta);
|
||||
av_log(ctx, AV_LOG_INFO, " min: %"PRId64" max: %"PRId64" avg: %"PRId64, s->min_delta, s->max_delta, s->avg_delta / s->vfr);
|
||||
av_log(ctx, AV_LOG_INFO, "\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user