diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-11-25 15:38:23 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-11-28 10:33:59 +0100 |
commit | ac4c09a4c89cd438f8086f44d8dfc0e0db9ce306 (patch) | |
tree | a473be9e2fb2a4a625341ca7c95a14fcaf63fa41 | |
parent | 4673bcc2556196c4a98826a07f30419b5c4e1113 (diff) |
lavfi/vf_nnedi: set output frame durations
CFR output when the filter is enabled, rescale input durations
otherwise.
-rw-r--r-- | libavfilter/vf_nnedi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c index 63b83e5efd..8f73c0384f 100644 --- a/libavfilter/vf_nnedi.c +++ b/libavfilter/vf_nnedi.c @@ -667,6 +667,8 @@ static int get_frame(AVFilterContext *ctx, int is_second) av_frame_copy_props(dst, s->prev); dst->interlaced_frame = 0; dst->pts = s->pts; + dst->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), + outlink->time_base); ff_filter_execute(ctx, filter_slice, dst, NULL, FFMIN(s->planeheight[1] / 2, s->nb_threads)); @@ -690,6 +692,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if ((s->deint && !s->prev->interlaced_frame) || ctx->is_disabled) { s->prev->pts *= 2; + s->prev->duration = av_rescale_q(s->prev->duration, inlink->time_base, + ctx->outputs[0]->time_base); ret = ff_filter_frame(ctx->outputs[0], s->prev); s->prev = in; return ret; |