[FFmpeg-cvslog] fftools/ffmpeg: Include elapsed-time in print_report()
softworkz
git at videolan.org
Sat May 3 08:59:14 EEST 2025
ffmpeg | branch: master | softworkz <softworkz at hotmail.com> | Sat Apr 19 23:44:33 2025 +0200| [1a083a4d90bc4cf26f06d3f62d75da3d49afcf39] | committer: softworkz
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 at hotmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a083a4d90bc4cf26f06d3f62d75da3d49afcf39
---
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;
More information about the ffmpeg-cvslog
mailing list