1
0
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:
Paul B Mahol 2019-10-29 13:05:31 +01:00
parent 4ce263a7fd
commit 3420e56d9a
2 changed files with 5 additions and 3 deletions

View File

@ -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, At end it will output number of frames detected as having variable delta pts,
and ones with constant delta pts. and ones with constant delta pts.
If there was frames with variable delta, than it will also show min and max delta If there was frames with variable delta, than it will also show min, max and
encountered. average delta encountered.
@section vibrance @section vibrance

View File

@ -29,6 +29,7 @@ typedef struct VFRDETContext {
int64_t delta; int64_t delta;
int64_t min_delta; int64_t min_delta;
int64_t max_delta; int64_t max_delta;
int64_t avg_delta;
uint64_t vfr; uint64_t vfr;
uint64_t cfr; uint64_t cfr;
@ -53,6 +54,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s->delta = delta; s->delta = delta;
s->min_delta = FFMIN(delta, s->min_delta); s->min_delta = FFMIN(delta, s->min_delta);
s->max_delta = FFMAX(delta, s->max_delta); s->max_delta = FFMAX(delta, s->max_delta);
s->avg_delta += delta;
} else { } else {
s->cfr++; 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); av_log(ctx, AV_LOG_INFO, "VFR:%f (%"PRIu64"/%"PRIu64")", s->vfr / (float)(s->vfr + s->cfr), s->vfr, s->cfr);
if (s->vfr) 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"); av_log(ctx, AV_LOG_INFO, "\n");
} }