* [FFmpeg-devel] [PATCH] avfilter/vf_showinfo: add wallclock option
@ 2022-08-10 14:59 Michael Riedl
0 siblings, 0 replies; only message in thread
From: Michael Riedl @ 2022-08-10 14:59 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.1.windows.1
_______________________________________________
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] only message in thread
only message in thread, other threads:[~2022-08-10 14:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 14:59 [FFmpeg-devel] [PATCH] avfilter/vf_showinfo: add wallclock option 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