From 30d054461348bc9e357ea41790fd377e44dcffa2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 27 Oct 2025 15:04:19 -0400 Subject: [PATCH] Add better debugging of codec_tag in zm_dump_codec and zm_dump_codecpar --- src/zm_ffmpeg.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index 88dd79191..892b178dc 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -400,7 +400,7 @@ static void zm_log_fps(double d, const char *postfix) { } void zm_dump_codecpar(const AVCodecParameters *par) { - Debug(1, "Dumping codecpar codec_type %d %s codec_id %d %s codec_tag %" PRIu32 + Debug(1, "Dumping codecpar codec_type %d %s codec_id %d %s codec_tag %c%c%c%c" " width %d height %d bit_rate%" PRIu64 " bpcs %d bprs %d format%d %s" " extradata:%d:%s profile %d level %d field order %d color_range %d" " color_primaries %d color_trc %d color_space %d location %d video_delay %d", @@ -408,7 +408,10 @@ void zm_dump_codecpar(const AVCodecParameters *par) { av_get_media_type_string(par->codec_type), static_cast(par->codec_id), avcodec_get_name(par->codec_id), - par->codec_tag, + (char)(par->codec_tag& 0xFF), + (char)((par->codec_tag >> 8) & 0xFF), + (char)((par->codec_tag >> 16) & 0xFF), + (char)((par->codec_tag >> 24) & 0xFF), par->width, par->height, par->bit_rate, @@ -437,12 +440,16 @@ void zm_dump_codecpar(const AVCodecParameters *par) { } void zm_dump_codec(const AVCodecContext *codec) { - Debug(1, "Dumping codec_context codec_type %d %s codec_id %d %s width %d height %d timebase %d/%d format %s profile %d level %d " + Debug(1, "Dumping codec_context codec_type %d %s codec_id %d %s tag %c%c%c%c width %d height %d timebase %d/%d format %s profile %d level %d " "gop_size %d has_b_frames %d max_b_frames %d me_cmp %d me_range %d qmin %d qmax %d bit_rate %" PRId64 " qcompress %f extradata:%d:%s", codec->codec_type, av_get_media_type_string(codec->codec_type), codec->codec_id, avcodec_get_name(codec->codec_id), + (char)(codec->codec_tag& 0xFF), + (char)((codec->codec_tag >> 8) & 0xFF), + (char)((codec->codec_tag >> 16) & 0xFF), + (char)((codec->codec_tag >> 24) & 0xFF), codec->width, codec->height, codec->time_base.num,