From patchwork Thu Nov 3 23:19:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 1279 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp1043857vsb; Thu, 3 Nov 2016 16:19:59 -0700 (PDT) X-Received: by 10.194.86.201 with SMTP id r9mr9292187wjz.5.1478215199685; Thu, 03 Nov 2016 16:19:59 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m63si1649784wma.85.2016.11.03.16.19.59; Thu, 03 Nov 2016 16:19:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5FD08689E31; Fri, 4 Nov 2016 01:19:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5C86689DB4 for ; Fri, 4 Nov 2016 01:19:48 +0200 (EET) Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1c2RIV-0003wB-F2 for ffmpeg-devel@ffmpeg.org; Fri, 04 Nov 2016 00:19:51 +0100 Received: from [192.168.1.3] ([80.110.107.178]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id 3bKq1u00F3qyFqg01bKrL3; Fri, 04 Nov 2016 00:19:51 +0100 X-SourceIP: 80.110.107.178 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Fri, 4 Nov 2016 00:19:50 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201611040019.50181.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [RFC/PATCH]ffmpeg: Warn if thousands of frames are duplicated X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Not sure if this really helps but ffmpeg can duplicate an enormous amount of frames without any notice to the user. Please comment, Carl Eugen From fdecd0309a111d2faca2fcffc95583276a4e826f Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Fri, 4 Nov 2016 00:16:51 +0100 Subject: [PATCH] ffmpeg: Warn if thousands of frames are duplicated. Fixes ticket #5194. --- ffmpeg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index 3b91710..130ae8a 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -126,6 +126,7 @@ static int64_t getmaxrss(void); static int run_as_daemon = 0; static int nb_frames_dup = 0; +static unsigned dup_warning = 1000; static int nb_frames_drop = 0; static int64_t decode_error_stat[2]; @@ -1134,6 +1135,10 @@ static void do_video_out(OutputFile *of, } nb_frames_dup += nb_frames - (nb0_frames && ost->last_dropped) - (nb_frames > nb0_frames); av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames - 1); + if (nb_frames_dup > dup_warning) { + av_log(NULL, AV_LOG_WARNING, "More than %d frames duplicated\n", dup_warning); + dup_warning *= 10; + } } ost->last_dropped = nb_frames == nb0_frames && next_picture;