From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A55864575B for ; Thu, 21 Dec 2023 03:05:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 53DFD68D072; Thu, 21 Dec 2023 05:05:44 +0200 (EET) Received: from out203-205-251-84.mail.qq.com (unknown [203.205.251.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7917868CF4B for ; Thu, 21 Dec 2023 05:05:36 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1703127931; bh=wQV1m6PmkaJma9SWbtD3gZF5V3jvZr7VOGHdAozzVso=; h=From:Subject:Date:References:To:In-Reply-To; b=g37cn6I+K+GYH6m5pOin9BLZGpC01pEnDvVXPt0BpyMBSLW93KdGH6croAmMYfguS 7TuzqK9dIBCMz6ZwW9J29tzVSHBSffXmBesrm/2tlXuFH29qPRwRMZ5t/ftFQK0VT+ 7EhGs8oTjsP0OTowE39K8yoPDDLASTzr4/byD0qs= Received: from smtpclient.apple ([113.108.77.52]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 15E97284; Thu, 21 Dec 2023 11:05:30 +0800 X-QQ-mid: xmsmtpt1703127930turv4kj8f Message-ID: X-QQ-XMAILINFO: MmuCfgcSBfHx5rz749KiWWZ9oAiMYuejHB6l8car1xc9qQRiYOZOWIny7S1sJe 7zS7OcGLGFbsMzL8Re7GWdQ/xQa8KjyW1WGKpaR/jZ6dkJv5m0HetqjvQK69m5yKCLVp+OYLHciS hHwTmdkZPmxJj07txOM4wQG+5GXzBtXZ+qpgO9L6uIlRZ1jhapOqshVoM1MmrqvIu8Kt2dfojco0 KLAnZ53XgGQAOYJ8pB3rI6pa9Hpq7DzdLJZFg5umtlNj02I/wed3qZgDIT5cgztky7blGfUjS6Mx lo4aGOUnLln3CzibXm3IsGLTGs7SIC8fQyF/Ka3Iixio+knHgFObWbjDYcOVTgkAEm2bd6r2IZEK Q5kx94bplGFdpOWqIG9HeOE/zfFiQN2qk/q1g1NVC3JrIhDcp8dyc9SqGoPBE9cCTfflRWCjKba3 jZUGj+EmTo6QDeUCgSdtNAWQYbBvCBFtg2MGoTDX4z+ntjP9w9M3EUDnt6nIPUGMaWJN4mFXvzb1 lAL3LdgEdQPn4H+0MQkQZDaMFmWmdA/bCDsq5MDhxvmRZVOxCk7FDy2PYRFcSuKqlHdCoGYb1ebR ubBbwOuofxV8R4kJX3jT7J3KXOdeu7p3Rx98TodDVBxWUb0aubnXjt+XxzF6OCJyFc8cng6smK5p ZrK5JuQGbM6TuNLlNPXZkLQ8wOAmhCKTETVh3jv7TAm0YMCQbHMIMDk+hOqqXftDoSKLoHdn2uAx qqJW3rWtDUZ97law4u9FJX8Gewfg5Wwm7Da+zn9+frNsyyyNwZB+vyGxVWMbv04Pbyb5obCwCJT2 T0D3caq5YRjkQ2hQ5B0RhPZuH2LRw1LDvoqWkI2g4nus1PDBlf0bh5RBiU3qpYQZg46H8gM8DR+N qTi/PtlCgN9m8nyTpVVAfsYH53J4BJtKKd6ngau1jdS+WBuQx5xG6LZGPZ/Q1038aXzjRM5Zj1K4 4SpZEFGyfs04a4mF7YNxmUly91+i0TH6QU2X4qBsc= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: Zhao Zhili Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Date: Thu, 21 Dec 2023 11:05:20 +0800 References: To: FFmpeg development discussions and patches In-Reply-To: X-OQ-MSGID: X-Mailer: Apple Mail (2.3774.200.91.1.1) Subject: Re: [FFmpeg-devel] [PATCH] avfilter/vf_showinfo: add udu_sei_as_ascii option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > On Dec 13, 2023, at 11:46, Zhao Zhili wrote: > > From: Zhao Zhili > > Some encoders (e.g., libx264) dump encoder configuration as user > data unregistered SEI message. This option try to print it as > ascii character when possible. > --- > doc/filters.texi | 4 ++++ > libavfilter/version.h | 2 +- > libavfilter/vf_showinfo.c | 14 ++++++++++++-- > 3 files changed, 17 insertions(+), 3 deletions(-) > > diff --git a/doc/filters.texi b/doc/filters.texi > index 6d00ba2c3f..0d4c5a47a0 100644 > --- a/doc/filters.texi > +++ b/doc/filters.texi > @@ -21796,6 +21796,10 @@ This filter supports the following options: > @table @option > @item checksum > Calculate checksums of each plane. By default enabled. > + > +@item udu_sei_as_ascii > +Try to print user data unregistered SEI as ascii character when possible, > +in hex format otherwise. > @end table > > The shown line contains a sequence of key/value pairs of the form > diff --git a/libavfilter/version.h b/libavfilter/version.h > index 7642b670d1..83931e11dd 100644 > --- a/libavfilter/version.h > +++ b/libavfilter/version.h > @@ -32,7 +32,7 @@ > #include "version_major.h" > > #define LIBAVFILTER_VERSION_MINOR 14 > -#define LIBAVFILTER_VERSION_MICRO 100 > +#define LIBAVFILTER_VERSION_MICRO 101 > > > #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c > index 71869446c6..309de28df9 100644 > --- a/libavfilter/vf_showinfo.c > +++ b/libavfilter/vf_showinfo.c > @@ -22,6 +22,7 @@ > * filter for showing textual video frame information > */ > > +#include > #include > > #include "libavutil/bswap.h" > @@ -52,6 +53,7 @@ > typedef struct ShowInfoContext { > const AVClass *class; > int calculate_checksums; > + int udu_sei_as_ascii; > } ShowInfoContext; > > #define OFFSET(x) offsetof(ShowInfoContext, x) > @@ -59,6 +61,8 @@ typedef struct ShowInfoContext { > > static const AVOption showinfo_options[] = { > { "checksum", "calculate checksums", OFFSET(calculate_checksums), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, VF }, > + { "udu_sei_as_ascii", "try to print user data unregistered SEI as ascii character when possible", > + OFFSET(udu_sei_as_ascii), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VF }, > { NULL } > }; > > @@ -418,6 +422,7 @@ static void dump_video_enc_params(AVFilterContext *ctx, const AVFrameSideData *s > static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSideData *sd) > { > const uint8_t *user_data = sd->data; > + ShowInfoContext *s = ctx->priv; > > if (sd->size < AV_UUID_LEN) { > av_log(ctx, AV_LOG_ERROR, "invalid data(%"SIZE_SPECIFIER" < " > @@ -428,8 +433,13 @@ static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSi > av_log(ctx, AV_LOG_INFO, "UUID=" AV_PRI_UUID "\n", AV_UUID_ARG(user_data)); > > av_log(ctx, AV_LOG_INFO, "User Data="); > - for (size_t i = 16; i < sd->size; i++) > - av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]); > + for (size_t i = 16; i < sd->size; i++) { > + const char *format = "%02x"; > + > + if (s->udu_sei_as_ascii) > + format = isprint(user_data[i]) ? "%c" : "\\x%02x"; > + av_log(ctx, AV_LOG_INFO, format, user_data[i]); > + } > av_log(ctx, AV_LOG_INFO, "\n"); > } > > -- > 2.25.1 Ping. Any comments on this idea and implementation? _______________________________________________ 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".