On Thu, Jun 11, 2020 at 06:35:15PM +0200, Andreas Rheinhardt wrote: > lance.lmw...@gmail.com: > > From: Limin Wang <lance.lmw...@gmail.com> > > > > Signed-off-by: Limin Wang <lance.lmw...@gmail.com> > > --- > > libavfilter/vf_showinfo.c | 37 +++++++++++++++++++++++++++++++++++++ > > 1 file changed, 37 insertions(+) > > > > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c > > index 5d4aee4..3658234 100644 > > --- a/libavfilter/vf_showinfo.c > > +++ b/libavfilter/vf_showinfo.c > > @@ -37,6 +37,7 @@ > > #include "libavutil/timecode.h" > > #include "libavutil/mastering_display_metadata.h" > > #include "libavutil/video_enc_params.h" > > +#include "libavutil/avstring.h" > > > > #include "avfilter.h" > > #include "internal.h" > > @@ -190,6 +191,39 @@ static void dump_video_enc_params(AVFilterContext > > *ctx, AVFrameSideData *sd) > > av_log(ctx, AV_LOG_INFO, "%u blocks; ", par->nb_blocks); > > } > > > > +static int string_is_print(const uint8_t *str) > > +{ > > + while (*str && *str >= 0x20 && *str <= 0x7e ) str++; > > + return !*str; > > +} > > + > > +static void dump_sei_unregistered_metadata(AVFilterContext *ctx, > > AVFrameSideData *sd) > > +{ > > + const int uuid_size = 16; > > + uint8_t *user_data = sd->data; > > + > > + if (sd->size < uuid_size) { > > + av_log(ctx, AV_LOG_ERROR, "invalid data(%d < UUID(%d-bytes))", > > sd->size, uuid_size); > > + return; > > + } > > + > > + av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n"); > > + av_log(ctx, AV_LOG_INFO, "UUID="); > > + for (int i = 0; i < uuid_size; i++) { > > + av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]); > > + if (i == 3 || i == 5 || i == 7 || i == 9) > > + av_log(ctx, AV_LOG_INFO, "-"); > > + } > > + av_log(ctx, AV_LOG_INFO, "\n"); > > + > > + user_data += uuid_size; > > + /* Only print the user data details if it's string or partial string*/ > > + if (string_is_print(user_data)) { > > + av_log(ctx, AV_LOG_INFO, "User Data="); > > + av_log(ctx, AV_LOG_INFO, "%s", user_data); > > + } > > +} > > + > > static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) > > { > > const char *color_range_str = > > av_color_range_name(frame->color_range); > > @@ -375,6 +409,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > *frame) > > case AV_FRAME_DATA_VIDEO_ENC_PARAMS: > > dump_video_enc_params(ctx, sd); > > break; > > + case AV_FRAME_DATA_SEI_UNREGISTERED: > > + dump_sei_unregistered_metadata(ctx, sd); > > + break; > > default: > > av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d > > bytes)", > > sd->type, sd->size); > > > This new version has the same issues as the old one plus one more: It > adds a new header that is now unnecessary.
I haven no idea how to reproduce your issues yet, for safety, I'll change to dump hex. It's easy to convert hex to ascii by online or local tools. > > - 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-requ...@ffmpeg.org with subject "unsubscribe". -- Thanks, Limin Wang _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".