mp4mux not writing tags to mp4 files
Hi, I have a pipeline constructed in C++, and its last step is to use splitmuxsink to write out mp4 files. I am using the default muxer i.e. mp4mux. Video writing has been working.
Now I need to add some video metadata, e.g. description and title.
auto* mp4mux = gst_element_factory_make("mp4mux", "mp4mux");
gst_tag_setter_add_tags(
GST_TAG_SETTER(mp4mux), GST_TAG_MERGE_KEEP, GST_TAG_DESCRIPTION,
"my desc", GST_TAG_COMMENT,
"my comment", GST_TAG_TITLE, "title", nullptr);
// Confirm the tags
// This prints \
// set tags: taglist, description=(string)"my\ desc", comment=(string)"my\ comment", title=(string)title;
GST_WARNING_OBJECT(GST_TAG_SETTER(mp4mux), "set tags: %" GST_PTR_FORMAT,
gst_tag_setter_get_tag_list(GST_TAG_SETTER(mp4mux)));
// Pass the muxer to splitmuxsink
// Start the pipeline
But the videos don't have any metadata I need when I check them with ffprobe:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41isomiso2
creation_time : 2023-05-16T08:08:18.000000Z
Duration: 467840:08:18.85, start: 1684224495.142000, bitrate: N/A
Stream #0:0(und): Subtitle: mov_text (tx3g / 0x67337874), 2592x291 (default)
Metadata:
creation_time : 2023-05-16T08:08:18.000000Z
handler_name : SubtitleHandler
Stream #0:1(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 2592x1944, SAR 1:1 DAR 4:3, 9.98 fps, 10 tbr, 1k tbn, 1k tbc (default)
Metadata:
creation_time : 2023-05-16T08:08:18.000000Z
handler_name : VideoHandler