From 102e0f4932f35b0df062871af4b7fe318a62db2b Mon Sep 17 00:00:00 2001 From: SuRuoyan Date: Thu, 31 Jul 2025 10:14:45 +0800 Subject: [PATCH] add user meta binary data in ilst Signed-off-by: RuoyanSu --- libavformat/movenc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index b9617a1ea4..80a67f5e87 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4201,6 +4201,20 @@ static int mov_write_moov_level_meta_data_tag(AVIOContext *pb, const char *data) avio_wb32(pb, 67); // int avio_wb32(pb, 0); avio_wb32(pb, atoi(data + 8)); + } else if (strncmp(data, "00000000", 8) == 0) { + uint8_t *hex_data = av_malloc(data_len >> 1 + 1); + if (!hex_data) { + av_log(NULL, AV_LOG_ERROR, "write moov_level meta malloc fail, data_len:%d.", data_len); + return 0; + } + int out_len = ff_hex_to_data(hex_data, data + 8); + size = 16 + out_len; + avio_wb32(pb, size); /* size */ + ffio_wfourcc(pb, "data"); + avio_wb32(pb, 0); // reserve for no type + avio_wb32(pb, 0); + avio_write(pb, hex_data, out_len); + av_free(hex_data); } else { size = 16 + 4; avio_wb32(pb, size); /* size */ -- Gitee