[FFmpeg-devel] [PATCH]lavfi/decimate: Do not assume a scene change for the first frame

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Aug 31 18:35:47 EEST 2016


Hi!

Attached patch fixes ticket #4990 concerning the output file.
It is possible that there is nothing to fix though, the input 
file is "dirty" and "dupthresh" is not underbid by two visually 
identical frames.

Please comment, Carl Eugen
-------------- next part --------------
From 195df26b7017448d0bfbbe32f4b1c7c6df8ad26c Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
Date: Wed, 31 Aug 2016 17:27:06 +0200
Subject: [PATCH] lavfi/decimate: Do not assume a scenechange for the first
 frame.

Fixes ticket #4990.
---
 libavfilter/vf_decimate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index 39c3331..d5dccb1 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -172,7 +172,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         prv = dm->fid ? (dm->ppsrc ? dm->clean_src[dm->fid - 1] : dm->queue[dm->fid - 1].frame) : dm->last;
         if (!prv) {
             dm->queue[dm->fid].maxbdiff = INT64_MAX;
-            dm->queue[dm->fid].totdiff  = INT64_MAX;
+            dm->queue[dm->fid].totdiff  = 0;
         } else {
             calc_diffs(dm, &dm->queue[dm->fid], prv, in);
         }
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list