From patchwork Wed Mar 27 21:11:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Foucu X-Patchwork-Id: 12505 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id CC1FF448658 for ; Wed, 27 Mar 2019 23:12:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B13B768A88C; Wed, 27 Mar 2019 23:12:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C526689DA0 for ; Wed, 27 Mar 2019 23:12:18 +0200 (EET) Received: by mail-pl1-f196.google.com with SMTP id y5so3882881plk.8 for ; Wed, 27 Mar 2019 14:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UZ+akHFJP28N5N0IHi2Sjzv3vZkikACWxlidJJ7rXoI=; b=de/NyEHmRprSICoSAyfFx4eMUyEWJYtj8Rn5Dn68AVySvsdgJkOayYC43+Th4wuyKs Y9mI3QfEyQQ/aIapo+YtfD9eBKhLdmgX62XYUGJSdvvQrfvy9CdGwjsk9T5JPdzWCbgf fojx4kJ4wpfSOpZYJYbkR3EOJt9VoR17YDwGBJV1n0VD3n6gfWYUlCNgaE2Aci49DPEZ T7yCGhK+tW0wao7s9XqCqffYr7bcIUZwsOi6BtnEv9+b6rLFKUlGda5aRERxVCwfoLsE 0F7Jb4zLl4SxpfLigMX/t5hb5etiPYPvbJKIA99n3OQ0gAwmqJMGCBeTA6ZCc+CzGFWm c1zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UZ+akHFJP28N5N0IHi2Sjzv3vZkikACWxlidJJ7rXoI=; b=BYxKzSasvgWCph4JlQv+W12N01SQK4xkCPHRUYXH7BYFjrL0kv8Rc1URWfHxBIbUgx llXHn8xi7xsVnqncic3R+R6diFl0aQm9DR6mnBX43N3jXO2ZmGCyo9UqcAh8mmRiQxnd qSi3bzjZBehtbO7KeOZTbxjez4glOzwtnay7c9NXtd6b+SVAJrvYLpkV+L8ttDKwOfM4 anzr/SDn7+UGqXXxK89xDI1YsLTFyF5hCXQ5bGqD+dRpepohpHxFS2W2pi6dyZcB+oeg 8ek/7orWoV3qTr0Oe68/sEoUVjgAopwrsUh7wdnzMHSZ/qpuJJIkCge/15jNWdiQqeac 81iQ== X-Gm-Message-State: APjAAAV5x5yyQ5nM1xTH32eF+GxOclBy7Foi4BQCm2Hvixve4/qvlySn I8vMpXbMG8zfd3MUmARs91Q9zdpl X-Google-Smtp-Source: APXvYqwRfhQCRIVK+IN+GmYzxIE5RfrYdTjkjysGVx4br1IpU+TWgY48Pz5OshSzwQJw2oa7Ljel8A== X-Received: by 2002:a17:902:b788:: with SMTP id e8mr28855678pls.339.1553721136054; Wed, 27 Mar 2019 14:12:16 -0700 (PDT) Received: from tfoucu.mtv.corp.google.com ([2620:0:1000:4001:8e18:4d51:fb1:d54f]) by smtp.gmail.com with ESMTPSA id u14sm32647644pfm.66.2019.03.27.14.12.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 14:12:15 -0700 (PDT) From: Thierry Foucu To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Mar 2019 14:11:59 -0700 Message-Id: <20190327211200.178030-1-tfoucu@gmail.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Check if we do have also a filter_complex filter. 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 Cc: Thierry Foucu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Right now, the code check for no filter description, but if we use a filter_complex, the code will use the AVFrame.duration which could be wrong in case of using fps filter. How to reproduce the problem: ffmpeg -f lavfi -i testsrc=duration=1 -vf fps=fps=50 -vsync 1 -f null - output 50 frames ffmpeg -f lavfi -i testsrc=duration=1 -filter_complex fps=fps=50 -vsync 1 -f null - output 51 frames With the patch, the same command will always output 50 frames. --- fftools/ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 544f1a1cef..0f157d67d8 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1079,6 +1079,7 @@ static void do_video_out(OutputFile *of, if (!ost->filters_script && !ost->filters && + (nb_filtergraphs == 0 || !filtergraphs[0]->graph_desc) && next_picture && ist && lrintf(next_picture->pkt_duration * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) {