From patchwork Thu Jun 16 19:55:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 36288 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp1129771pzb; Thu, 16 Jun 2022 13:08:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vHOGmPjvR5FThdpFjJNQcKJTw5Wl0j91Z8CYaE88JZpAk7n3TVx6OerzX9TDqZ/r1RdZMc X-Received: by 2002:a17:907:6d1a:b0:71b:e858:d187 with SMTP id sa26-20020a1709076d1a00b0071be858d187mr3704293ejc.596.1655410120284; Thu, 16 Jun 2022 13:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655410120; cv=none; d=google.com; s=arc-20160816; b=ovOZ/MUv5SeQTMQHTjKnEEI2mDWHZDlISLbGhapGJQ0vC4VCVMAVNEEZHBu2zidrg8 Hodmz0jCpsnQm/t+cSax+Kp9uLmX/14PJ3isuHChfKa9LN9shbB6It2s0SetZOz3hsnO OC9eHlu7AYaySxHfn7M9Hp95npq3zUSxsp63MbYj7zXJtJc98Zb3pKntLXNwcaLXQ4Tw Tkj5sEDf2x2kF6hxARCd/st590Qv/S02EyqGmg4FGQ+M0+IBdEqRPykA3Z7FdIwkmDMj ZHFoYurCZO8B0MGYIjpF84IH2yCOOWSHA1eGIDER6/wnL5rhT+Ry7I9yJFADKklBAOYc 9GcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=9j45SkixfzLzuH2SGGB/L5dbQJYT+xt6Yp6GhqWWVtc=; b=oCiqgmn1d5nvX+1AzLnTBAFU8sccW3LolnugadwtLXQeoTmqI2J+hiAmpTtXm/IMAK LuNMLL5WVClvrW5vCB8zOS/YlGd3mWTjlfmbbJZvaTzNXSLVGhotm4X5rHZ9x8L4QrfK jN5wFmgwyPu6ybQ9qTt8mk5Oxs2juiop4pQkTO5N8TPLYZxXaQT705n88J3ATK5MV9VB C8JWRw/gaGDc8QelegEKdnvyJR2JH20GLJ1woPmbhgKk/Gi/wIExzJHv45lfQ7oJVGKd 13hFgxXcUt7etb9VIhRcPSmkTUP8W2PTb6XSqGIP0Fd7JXkN/67WcWPpkybPptDE7V0y +FrQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id cr18-20020a170906d55200b006ff46987deasi2710524ejc.311.2022.06.16.13.08.39; Thu, 16 Jun 2022 13:08:40 -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 469E068B8F2; Thu, 16 Jun 2022 23:04:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 10AB568B79F for ; Thu, 16 Jun 2022 23:03:45 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id ABB7224017C for ; Thu, 16 Jun 2022 22:03:44 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 8_ydfs2uayHR for ; Thu, 16 Jun 2022 22:03:44 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 8A4AA240694 for ; Thu, 16 Jun 2022 22:03:34 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id E8E503A20FB; Thu, 16 Jun 2022 22:03:30 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Jun 2022 21:55:24 +0200 Message-Id: <20220616195534.5278-25-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616195534.5278-1-anton@khirnov.net> References: <20220616195534.5278-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 25/35] fftools/ffmpeg: stop using OutputStream.frame_number in print_report() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: J08VwT2sJ2Zt This field means different things when the video is encoded (number of frames emitted to the encoding sync queue/encoder by the video sync code) or copied (number of packets sent to the muxer sync queue). Print the value of packets_written instead, which means the same thing in both cases. It is also more accurate, since packets may be dropped by the sync queue or bitstream filters. --- fftools/ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index a471fa0f8f..beb07928bf 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1585,7 +1585,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { float fps; - frame_number = ost->frame_number; + frame_number = ost->packets_written; fps = t > 1 ? frame_number / t : 0; av_bprintf(&buf, "frame=%5d fps=%3.*f q=%3.1f ", frame_number, fps < 9.95, fps, q);