Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
@ 2022-08-17  8:30 Michael Riedl
  2022-08-17  8:43 ` Nicolas George
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Riedl @ 2022-08-17  8:30 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
---
 libavfilter/vf_showinfo.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 2c8514fc80..1953f777c7 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -43,6 +43,7 @@
 #include "libavutil/video_enc_params.h"
 #include "libavutil/detection_bbox.h"
 #include "libavutil/uuid.h"
+#include "libavutil/time.h"
 
 #include "avfilter.h"
 #include "internal.h"
@@ -51,6 +52,7 @@
 typedef struct ShowInfoContext {
     const AVClass *class;
     int calculate_checksums;
+    int print_wallclock;
 } ShowInfoContext;
 
 #define OFFSET(x) offsetof(ShowInfoContext, x)
@@ -58,6 +60,7 @@ typedef struct ShowInfoContext {
 
 static const AVOption showinfo_options[] = {
     { "checksum", "calculate checksums", OFFSET(calculate_checksums), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, VF },
+    { "wallclock", "print wallclock", OFFSET(print_wallclock), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, VF },
     { NULL }
 };
 
@@ -740,6 +743,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
                    sqrt((sum2[plane] - sum[plane]*(double)sum[plane]/pixelcount[plane])/pixelcount[plane]));
         av_log(ctx, AV_LOG_INFO, "\b]");
     }
+
+    if (s->print_wallclock) {
+        av_log(ctx, AV_LOG_INFO,
+               " wallclock:%"PRId64" ",
+               av_gettime()
+        );
+    }
+
     av_log(ctx, AV_LOG_INFO, "\n");
 
     for (i = 0; i < frame->nb_side_data; i++) {
-- 
2.37.2.windows.2

_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  8:30 [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option Michael Riedl
@ 2022-08-17  8:43 ` Nicolas George
  2022-08-17  9:01   ` Michael Riedl
  2022-08-17  9:22   ` Andreas Rheinhardt
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas George @ 2022-08-17  8:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 382 bytes --]

Michael Riedl (12022-08-17):
> Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
> ---
>  libavfilter/vf_showinfo.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)

What is the intended use case? It seems to me very ad-hoc. A fftools
option to add a timestamp to each log line seems a more generic and
cleaner approach.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  8:43 ` Nicolas George
@ 2022-08-17  9:01   ` Michael Riedl
  2022-08-17 15:03     ` Nicolas George
  2022-08-24  1:15     ` Soft Works
  2022-08-17  9:22   ` Andreas Rheinhardt
  1 sibling, 2 replies; 9+ messages in thread
From: Michael Riedl @ 2022-08-17  9:01 UTC (permalink / raw)
  To: ffmpeg-devel

On 17.08.2022 10:43, Nicolas George wrote:
> Michael Riedl (12022-08-17):
>> Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
>> ---
>>   libavfilter/vf_showinfo.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
> 
> What is the intended use case? It seems to me very ad-hoc. A fftools
> option to add a timestamp to each log line seems a more generic and
> cleaner approach.

This is a good idea, I will look into that. Regarding vf_showinfo, I am 
working on options to limit the output to certain frames (first N, last 
N, only I-frames). I think this will be useful, what do you think?

Regards,
-- 
Michael Riedl
_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  8:43 ` Nicolas George
  2022-08-17  9:01   ` Michael Riedl
@ 2022-08-17  9:22   ` Andreas Rheinhardt
  2022-08-17  9:28     ` Nicolas George
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Rheinhardt @ 2022-08-17  9:22 UTC (permalink / raw)
  To: ffmpeg-devel

Nicolas George:
> Michael Riedl (12022-08-17):
>> Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
>> ---
>>  libavfilter/vf_showinfo.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
> 
> What is the intended use case? It seems to me very ad-hoc. A fftools
> option to add a timestamp to each log line seems a more generic and
> cleaner approach.
> 

Basically already exists:
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-August/283434.html

- Andreas
_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  9:22   ` Andreas Rheinhardt
@ 2022-08-17  9:28     ` Nicolas George
  2022-08-24  2:00       ` Soft Works
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas George @ 2022-08-17  9:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 243 bytes --]

Andreas Rheinhardt (12022-08-17):
> Basically already exists:
> https://ffmpeg.org/pipermail/ffmpeg-devel/2021-August/283434.html

Lacks subsecond precision and timezone information, but a good start.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  9:01   ` Michael Riedl
@ 2022-08-17 15:03     ` Nicolas George
  2022-08-24  1:15     ` Soft Works
  1 sibling, 0 replies; 9+ messages in thread
From: Nicolas George @ 2022-08-17 15:03 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 472 bytes --]

Michael Riedl (12022-08-17):
> This is a good idea, I will look into that. Regarding vf_showinfo, I am
> working on options to limit the output to certain frames (first N, last N,
> only I-frames). I think this will be useful, what do you think?

I strongly doubt it, but I will not object if the option is clean and
unobtrusive enough. Please make sure the logic and implementation can
easily be generalized to other filters.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  9:01   ` Michael Riedl
  2022-08-17 15:03     ` Nicolas George
@ 2022-08-24  1:15     ` Soft Works
  1 sibling, 0 replies; 9+ messages in thread
From: Soft Works @ 2022-08-24  1:15 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Michael Riedl
> Sent: Wednesday, August 17, 2022 11:02 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add
> wallclock option
> 
> On 17.08.2022 10:43, Nicolas George wrote:
> > Michael Riedl (12022-08-17):
> >> Signed-off-by: Michael Riedl <michael.riedl@nativewaves.com>
> >> ---
> >>   libavfilter/vf_showinfo.c | 11 +++++++++++
> >>   1 file changed, 11 insertions(+)
> >
> > What is the intended use case? It seems to me very ad-hoc. A
> fftools
> > option to add a timestamp to each log line seems a more generic and
> > cleaner approach.
> 
> This is a good idea, I will look into that. 

There exists a patch that does this and might be useful for you:

https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=4526&state=%2A&archive=both

Best,
softworkz
_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-17  9:28     ` Nicolas George
@ 2022-08-24  2:00       ` Soft Works
  2022-08-25 12:08         ` Michael Riedl
  0 siblings, 1 reply; 9+ messages in thread
From: Soft Works @ 2022-08-24  2:00 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Nicolas George
> Sent: Wednesday, August 17, 2022 11:28 AM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add
> wallclock option
> 
> Andreas Rheinhardt (12022-08-17):
> > Basically already exists:
> > https://ffmpeg.org/pipermail/ffmpeg-devel/2021-August/283434.html
> 
> Lacks subsecond precision and timezone information, but a good start.
> 
> Regards,
> 
> --
>   Nicolas George

It does provide subsecond precision, please see the 'millisec' variable
here:

https://patchwork.ffmpeg.org/project/ffmpeg/patch/MN2PR04MB5981773A7336C9B46D298354BAF79@MN2PR04MB5981.namprd04.prod.outlook.com/

Adding the ability to print time zone information is a good idea, I think.

The patchset allows to control whether to print date, time or both.
In practical use, I ended up printing a line with the date on startup
and print only time information, e.g. like this:

01:40:42.467 ffmpeg version 5.1...
01:40:42.467   built with ...
01:40:42.468 Execution Date: 2022-08-16 01:40:42
01:40:42.499 Input #0, matroska,webm, ...



If there is interest, I can submit my latest version of this.

Best,
softworkz
_______________________________________________
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] 9+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option
  2022-08-24  2:00       ` Soft Works
@ 2022-08-25 12:08         ` Michael Riedl
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Riedl @ 2022-08-25 12:08 UTC (permalink / raw)
  To: ffmpeg-devel

> The patchset allows to control whether to print date, time or both.
> In practical use, I ended up printing a line with the date on startup
> and print only time information, e.g. like this:
> 
> 01:40:42.467 ffmpeg version 5.1...
> 01:40:42.467   built with ...
> 01:40:42.468 Execution Date: 2022-08-16 01:40:42
> 01:40:42.499 Input #0, matroska,webm, ...
> 
> 
> 
> If there is interest, I can submit my latest version of this.

 From my side this would be interesting and helpful for me.

Thanks,
Michael
_______________________________________________
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] 9+ messages in thread

end of thread, other threads:[~2022-08-25 12:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17  8:30 [FFmpeg-devel] [PATCH v2] avfilter/vf_showinfo: add wallclock option Michael Riedl
2022-08-17  8:43 ` Nicolas George
2022-08-17  9:01   ` Michael Riedl
2022-08-17 15:03     ` Nicolas George
2022-08-24  1:15     ` Soft Works
2022-08-17  9:22   ` Andreas Rheinhardt
2022-08-17  9:28     ` Nicolas George
2022-08-24  2:00       ` Soft Works
2022-08-25 12:08         ` Michael Riedl

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