Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: softworkz <ffmpegagent@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: softworkz <softworkz@hotmail.com>
Subject: [FFmpeg-devel] [PATCH v2] fftools/ffmpeg: Include elapsed-time in print_report()
Date: Sun, 20 Apr 2025 22:24:23 +0000
Message-ID: <pull.68.v2.ffstaging.FFmpeg.1745187863550.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.68.ffstaging.FFmpeg.1745101908343.ffmpegagent@gmail.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".

      reply	other threads:[~2025-04-20 22:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19 22:31 [FFmpeg-devel] [PATCH] " softworkz
2025-04-20 22:24 ` softworkz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.68.v2.ffstaging.FFmpeg.1745187863550.ffmpegagent@gmail.com \
    --to=ffmpegagent@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=softworkz@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git