From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 1C45C4D898
	for <ffmpegdev@gitmailbox.com>; Sun, 20 Apr 2025 22:24:42 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EF702687DD5;
	Mon, 21 Apr 2025 01:24:37 +0300 (EEST)
Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com
 [209.85.214.180])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 012EB687ABB
 for <ffmpeg-devel@ffmpeg.org>; Mon, 21 Apr 2025 01:24:31 +0300 (EEST)
Received: by mail-pl1-f180.google.com with SMTP id
 d9443c01a7336-22c33677183so39142465ad.2
 for <ffmpeg-devel@ffmpeg.org>; Sun, 20 Apr 2025 15:24:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1745187869; x=1745792669; darn=ffmpeg.org;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :references:in-reply-to:message-id:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=WBP5jebhjZTvFz9hnmjmxf+FJD/ZpZtoUQ0QRV+VDXE=;
 b=YyQzD3MgQcfyIe+eoVuW+P33xYKg0iTG4vd9d6UGtBKrk7V9VPefZRAJBKUcOiTswV
 6VqrIBZngZinjSKqqt8y+SE9dkR1WbMg8t6xN/TXc3WhyI6zThiAgucOT3mehuAUkKdH
 lNZn1507XWr1oLo0er1s64Xbfnfj+xbQcAq/NXFjLt5Mith2RU8fuovsscnh39ZYphxX
 glflpuo+cn/0bfJbVXdl66197LNQKQoqTVrMOvL883iwUWAaOYPse9MZox22CGxdjBpD
 K4R+AmLZ4xaJNImzdMRsQkXbPvJdrU02GUCGeBtq6wbRTkLhe7JayHnxjzPkqnWzGGYR
 NVyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1745187869; x=1745792669;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :references:in-reply-to:message-id:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=WBP5jebhjZTvFz9hnmjmxf+FJD/ZpZtoUQ0QRV+VDXE=;
 b=upA/AIQi2rAwhoEBpOayPpjLAJWzqoGWMuRdlwa9d55mRVJMoX3JFWB2uOw+iTyWZX
 8c92kFIjfM0oeULKC8SiYF6vujGNrLO5VogKT6NWYuJHhTj5crsYY7jHHrBVFAYkgCmO
 vSu6HtqRSNtJfRjPquOD19TbEKZr53z57Jlzo9bpZhUasmOnbJ9Pf9xs+BsAjF7EvKqb
 Z2KIYgtKj2QnFkRSV3BSSy5V6tKJ2+qSi//2ilJ2e9+RQmtHqmIJeCDwi/mW5hdIX1Zk
 ITii9ARlNnejDrVdidGPqKFu6H4MV23fwbzKdQRWJRErGKhGXo0fszKj7HM4+PBhRppr
 364w==
X-Gm-Message-State: AOJu0Yxj70J88yKcr9kxShHLiC5phKVUiGEjJPSq632j1Ildz2mZZBeJ
 5mpJKy/tqksKAX/gQzfQsQSnYEPpTdT2w4NVKNwojvqnQYqUQMnMXmGZGA==
X-Gm-Gg: ASbGnct10lmgePMLu0GzMJUJp6ZpFvrV0cFXeTSAvlV81AWZ0SKklLkpFqJ0393Dhsg
 ni69qZqgZ1Qi87WYtN29VYlyk6/OIFnzZROcfhBdL17KgHh2nQF29ObwFwI0JG/BpFSfL0nSRJl
 C16T8BA/bwf3SsKghN8JNTgYY0sThmoaQfoJz4pzoj1AlLy83s7e/OaMBPi+OKPsHIybDFRXT3B
 039qI69kNKWqEIsL0Julh98bMIHmLBhjwhdCMvYCgjF3GoxIUiP2mUnWEvU5IlMe2YY1L4m+F8u
 J89qLSKbiLM0zsTqVMTpq9u9EBZhQl+fZVRdbi0PBknzl8sRA4F6da7ZPgTEhG7NfB7Fnw==
X-Google-Smtp-Source: AGHT+IHXBKq98KOY13iH3ooz8YTS2Ep/U/E2TsMZIRvuwmZkX/2/8LbxZCrywuZXN+5AEF+c7yO6kg==
X-Received: by 2002:a17:903:192:b0:220:e1e6:4457 with SMTP id
 d9443c01a7336-22c535bf92fmr130576665ad.26.1745187869112; 
 Sun, 20 Apr 2025 15:24:29 -0700 (PDT)
Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-73dbf8e0be0sm5189617b3a.49.2025.04.20.15.24.28
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 20 Apr 2025 15:24:28 -0700 (PDT)
From: softworkz <ffmpegagent@gmail.com>
X-Google-Original-From: softworkz <softworkz@hotmail.com>
Message-Id: <pull.68.v2.ffstaging.FFmpeg.1745187863550.ffmpegagent@gmail.com>
In-Reply-To: <pull.68.ffstaging.FFmpeg.1745101908343.ffmpegagent@gmail.com>
References: <pull.68.ffstaging.FFmpeg.1745101908343.ffmpegagent@gmail.com>
Date: Sun, 20 Apr 2025 22:24:23 +0000
Fcc: Sent
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH v2] fftools/ffmpeg: Include elapsed-time in
 print_report()
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: softworkz <softworkz@hotmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/pull.68.v2.ffstaging.FFmpeg.1745187863550.ffmpegagent@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: softworkz <softworkz@hotmail.com>

It's a highly useful metric, both at runtime and when viewing logs.

Signed-off-by: softworkz <softworkz@hotmail.com>
---
    fftools/ffmpeg: Include elapsed-time in print_report()
    
    It's a highly useful metric, both at runtime and when viewing logs.
    
    Signed-off-by: softworkz softworkz@hotmail.com
    
    
    Versions
    ========
    
    
    V2
    ==
    
     * Fix "new warning" detected by Patchwork

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-68%2Fsoftworkz%2Fsubmit_elapsed-v2
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-68/softworkz/submit_elapsed-v2
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/68

Range-diff vs v1:

 1:  69cf299d93 ! 1:  8db3723035 fftools/ffmpeg: Include elapsed-time in print_report()
     @@ fftools/ffmpeg.c: static void print_report(int is_last_report, int64_t timer_sta
      +    hours = mins / 60;
      +    mins %= 60;
      +
     -+    av_bprintf(&buf, "elapsed=%02d:%02d:%02d.%02d ", hours, mins, secs, ms / 10);
     ++    av_bprintf(&buf, "elapsed=%"PRId64":%02d:%02d.%02d ", hours, mins, secs, ms / 10);
      +
           for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
               const float q = ost->enc ? atomic_load(&ost->quality) / (float) FF_QP2LAMBDA : -1;


 fftools/ffmpeg.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index dc321fb4a2..5d81b1124a 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -555,7 +555,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
     static int64_t last_time = -1;
     static int first_report = 1;
     uint64_t nb_frames_dup = 0, nb_frames_drop = 0;
-    int mins, secs, us;
+    int mins, secs, ms, us;
     int64_t hours;
     const char *hours_sign;
     int ret;
@@ -579,6 +579,16 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
     vid = 0;
     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
     av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
+
+    secs = (int)t;
+    ms = (int)((t - secs) * 1000);
+    mins = secs / 60;
+    secs %= 60;
+    hours = mins / 60;
+    mins %= 60;
+
+    av_bprintf(&buf, "elapsed=%"PRId64":%02d:%02d.%02d ", hours, mins, secs, ms / 10);
+
     for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
         const float q = ost->enc ? atomic_load(&ost->quality) / (float) FF_QP2LAMBDA : -1;
 

base-commit: 7cd1edeaa410d977a9f1ff8436f480cb45b80178
-- 
ffmpeg-codebot
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".