Hi! Video filter decimate currently (always) drops the first frame because its diff values are all 0. Attached patch tries to fix ticket #4990. Better suggestions on how to detect "first frame" welcome.
Please comment, Carl Eugen
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index cd374c3..55100fc 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -177,6 +177,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) dm->fid = 0; /* we have a complete cycle, select the frame to drop */ + if (!outlink->frame_count) { + dm->queue[0].totdiff = dm->scthresh; + dm->queue[0].maxbdiff = INT64_MAX; + } lowest = 0; for (i = 0; i < dm->cycle; i++) { if (dm->queue[i].totdiff > dm->scthresh)
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel