* [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
@ 2025-05-09 12:06 Marton Balint
2025-05-09 16:24 ` James Almer
2025-05-09 18:13 ` softworkz .
0 siblings, 2 replies; 7+ messages in thread
From: Marton Balint @ 2025-05-09 12:06 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Marton Balint
Elapsed time is much less important than the actual progress, and I am guessing
several ffmpeg CLI frontends use the existing status line for showing progress,
so putting a new field in the beginning is less optimal anyway.
Related to ticket #11582.
Signed-off-by: Marton Balint <cus@passwd.hu>
---
fftools/ffmpeg.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 24d43e6197..2e575e7b10 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
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;
@@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
}
+ 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);
+
if (print_stats || is_last_report) {
const char end = is_last_report ? '\n' : '\r';
if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
--
2.43.0
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
2025-05-09 12:06 [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line Marton Balint
@ 2025-05-09 16:24 ` James Almer
2025-05-09 18:22 ` softworkz .
2025-05-09 18:13 ` softworkz .
1 sibling, 1 reply; 7+ messages in thread
From: James Almer @ 2025-05-09 16:24 UTC (permalink / raw)
To: ffmpeg-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 2079 bytes --]
On 5/9/2025 9:06 AM, Marton Balint wrote:
> Elapsed time is much less important than the actual progress, and I am guessing
> several ffmpeg CLI frontends use the existing status line for showing progress,
> so putting a new field in the beginning is less optimal anyway.
LGTM, but for the record, we don't guarantee the printed output to be
unchanged across versions, so anyone having scripts depending on that
will have a bad time.
>
> Related to ticket #11582.
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> fftools/ffmpeg.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 24d43e6197..2e575e7b10 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
> 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;
>
> @@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
> av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
> }
>
> + 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);
> +
> if (print_stats || is_last_report) {
> const char end = is_last_report ? '\n' : '\r';
> if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
2025-05-09 16:24 ` James Almer
@ 2025-05-09 18:22 ` softworkz .
0 siblings, 0 replies; 7+ messages in thread
From: softworkz . @ 2025-05-09 18:22 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of James Almer
> Sent: Freitag, 9. Mai 2025 18:25
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
> to the end of the status line
>
> On 5/9/2025 9:06 AM, Marton Balint wrote:
> > Elapsed time is much less important than the actual progress, and I am
> guessing
> > several ffmpeg CLI frontends use the existing status line for showing
> progress,
> > so putting a new field in the beginning is less optimal anyway.
>
> LGTM, but for the record, we don't guarantee the printed output to be
> unchanged across versions, so anyone having scripts depending on that
> will have a bad time.
I think usually, such parsing scripts would parse that line by tokens, no?
Thanks,
sw
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
2025-05-09 12:06 [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line Marton Balint
2025-05-09 16:24 ` James Almer
@ 2025-05-09 18:13 ` softworkz .
2025-05-09 18:56 ` Marton Balint
1 sibling, 1 reply; 7+ messages in thread
From: softworkz . @ 2025-05-09 18:13 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Marton Balint
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
> Balint
> Sent: Freitag, 9. Mai 2025 14:06
> To: ffmpeg-devel@ffmpeg.org
> Cc: Marton Balint <cus@passwd.hu>
> Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to
> the end of the status line
>
> Elapsed time is much less important than the actual progress, and I am
> guessing
> several ffmpeg CLI frontends use the existing status line for showing
> progress,
> so putting a new field in the beginning is less optimal anyway.
I agree that it might not be the most important part of the stats,
yet, from experience, it is quite often useful.
How about adding it to the end, then?
Thanks,
sw
>
> Related to ticket #11582.
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> fftools/ffmpeg.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 24d43e6197..2e575e7b10 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t
> timer_start, int64_t cur_ti
> 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;
>
> @@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t
> timer_start, int64_t cur_ti
> av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
> }
>
> + 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);
> +
> if (print_stats || is_last_report) {
> const char end = is_last_report ? '\n' : '\r';
> if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
> --
> 2.43.0
>
> _______________________________________________
> 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".
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
2025-05-09 18:13 ` softworkz .
@ 2025-05-09 18:56 ` Marton Balint
2025-05-09 19:06 ` softworkz .
0 siblings, 1 reply; 7+ messages in thread
From: Marton Balint @ 2025-05-09 18:56 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Fri, 9 May 2025, softworkz . wrote:
>
>
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
>> Balint
>> Sent: Freitag, 9. Mai 2025 14:06
>> To: ffmpeg-devel@ffmpeg.org
>> Cc: Marton Balint <cus@passwd.hu>
>> Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to
>> the end of the status line
>>
>> Elapsed time is much less important than the actual progress, and I am
>> guessing
>> several ffmpeg CLI frontends use the existing status line for showing
>> progress,
>> so putting a new field in the beginning is less optimal anyway.
>
> I agree that it might not be the most important part of the stats,
> yet, from experience, it is quite often useful.
>
> How about adding it to the end, then?
This patch does exactly that.
Regards,
Marton
>
> Thanks,
> sw
>
>
>
>>
>> Related to ticket #11582.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>> fftools/ffmpeg.c | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
>> index 24d43e6197..2e575e7b10 100644
>> --- a/fftools/ffmpeg.c
>> +++ b/fftools/ffmpeg.c
>> @@ -580,15 +580,6 @@ static void print_report(int is_last_report, int64_t
>> timer_start, int64_t cur_ti
>> 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;
>>
>> @@ -679,6 +670,15 @@ static void print_report(int is_last_report, int64_t
>> timer_start, int64_t cur_ti
>> av_bprintf(&buf_script, "speed=%4.3gx\n", speed);
>> }
>>
>> + 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);
>> +
>> if (print_stats || is_last_report) {
>> const char end = is_last_report ? '\n' : '\r';
>> if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
>> --
>> 2.43.0
>>
>> _______________________________________________
>> 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".
> _______________________________________________
> 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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
2025-05-09 18:56 ` Marton Balint
@ 2025-05-09 19:06 ` softworkz .
2025-05-11 16:57 ` Marton Balint
0 siblings, 1 reply; 7+ messages in thread
From: softworkz . @ 2025-05-09 19:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
> Balint
> Sent: Freitag, 9. Mai 2025 20:56
> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
> to the end of the status line
>
>
>
> On Fri, 9 May 2025, softworkz . wrote:
>
> >
> >
> >> -----Original Message-----
> >> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
> >> Balint
> >> Sent: Freitag, 9. Mai 2025 14:06
> >> To: ffmpeg-devel@ffmpeg.org
> >> Cc: Marton Balint <cus@passwd.hu>
> >> Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
> to
> >> the end of the status line
> >>
> >> Elapsed time is much less important than the actual progress, and I am
> >> guessing
> >> several ffmpeg CLI frontends use the existing status line for showing
> >> progress,
> >> so putting a new field in the beginning is less optimal anyway.
> >
> > I agree that it might not be the most important part of the stats,
> > yet, from experience, it is quite often useful.
> >
> > How about adding it to the end, then?
>
> This patch does exactly that.
>
> Regards,
> Marton
Oh, apologies. I stopped reading after the - prefixed lines 😊
Thank you,
sw
Also: LGTM
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line
2025-05-09 19:06 ` softworkz .
@ 2025-05-11 16:57 ` Marton Balint
0 siblings, 0 replies; 7+ messages in thread
From: Marton Balint @ 2025-05-11 16:57 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Fri, 9 May 2025, softworkz . wrote:
>
>
>> -----Original Message-----
>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
>> Balint
>> Sent: Freitag, 9. Mai 2025 20:56
>> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
>> Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
>> to the end of the status line
>>
>>
>>
>> On Fri, 9 May 2025, softworkz . wrote:
>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Marton
>>>> Balint
>>>> Sent: Freitag, 9. Mai 2025 14:06
>>>> To: ffmpeg-devel@ffmpeg.org
>>>> Cc: Marton Balint <cus@passwd.hu>
>>>> Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter
>> to
>>>> the end of the status line
>>>>
>>>> Elapsed time is much less important than the actual progress, and I am
>>>> guessing
>>>> several ffmpeg CLI frontends use the existing status line for showing
>>>> progress,
>>>> so putting a new field in the beginning is less optimal anyway.
>>>
>>> I agree that it might not be the most important part of the stats,
>>> yet, from experience, it is quite often useful.
>>>
>>> How about adding it to the end, then?
>>
>> This patch does exactly that.
>>
>> Regards,
>> Marton
>
> Oh, apologies. I stopped reading after the - prefixed lines 😊
>
> Thank you,
> sw
>
> Also: LGTM
Thanks, will apply.
Regards,
Marton
_______________________________________________
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-05-11 17:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-09 12:06 [FFmpeg-devel] [PATCH] fftools/ffmpeg: move elapsed time counter to the end of the status line Marton Balint
2025-05-09 16:24 ` James Almer
2025-05-09 18:22 ` softworkz .
2025-05-09 18:13 ` softworkz .
2025-05-09 18:56 ` Marton Balint
2025-05-09 19:06 ` softworkz .
2025-05-11 16:57 ` Marton Balint
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