GNOME Bugzilla – Bug 563221
GST_TAG_MERGE_REPLACE_ALL not replacing all tags
Last modified: 2009-09-13 20:09:59 UTC
Please describe the problem: GST_TAG_MERGE_REPLACE_ALL not working right Steps to reproduce: 1. create pipeline with avidemux and avimux 2. use GstTagSetter interface to merge tags with only one tag (should remove all other tags) Actual results: it only updates tag given, but doesn't remove other tags. Expected results: Does this happen every time? yes Other information:
Created attachment 123944 [details] example code
some explanation: * GST_TAG_ENCODER: cannot be overridden avimux is adding that at the end * GST_TAG_VIDEO_CODEC and GST_TAG_AUDIO_CODEC are implizitely generated when demuxing, so they can't be supressed I added some logging to the sample and tweaked the logging in avimux (will commit in a minute). Problem is the the tag event from avidemux, its reverting the reset. I'll investigate how other muxers handle it. > GST_DEBUG="*:2,default:3,avimux:4" ./tagreset 0:00:00.387663604 6046 0x804c008 DEBUG avimux gstavimux.c:815:gst_avi_mux_request_new_pad:<avimux> adding new pad: video_00 0:00:00.389084239 6046 0x804c008 INFO default tagreset.c:95:main: tags resetted 0:00:00.390407618 6046 0x81c82e0 DEBUG avimux gstavimux.c:1685:gst_avi_mux_handle_event:<avimux> receiving tags 0:00:00.390743936 6046 0x81c82e0 DEBUG avimux gstavimux.c:445:gst_avi_mux_vidsink_set_caps:<avimux> avimux:video_00, caps=0x80f8520 0:00:00.390862207 6046 0x81c82e0 DEBUG avimux gstavimux.c:970:gst_avi_mux_riff_get_avi_header:<avimux> creating avi header, data_size 4, idx_size 0 0:00:00.390951588 6046 0x81c82e0 DEBUG avimux gstavimux.c:999:gst_avi_mux_riff_get_avi_header:<avimux> creating buffer 0x81cb158, size 2102, highmark at 0 0:00:00.391021382 6046 0x81c82e0 DEBUG avimux gstavimux.c:944:gst_avi_mux_write_tag: writing tag in buffer 0x81cb158, highmark at 844 0:00:00.391080982 6046 0x81c82e0 DEBUG avimux gstavimux.c:944:gst_avi_mux_write_tag: writing tag in buffer 0x81cb158, highmark at 860 0:00:00.391135462 6046 0x81c82e0 DEBUG avimux gstavimux.c:944:gst_avi_mux_write_tag: writing tag in buffer 0x81cb158, highmark at 878
One more idea would be to run a proper mainloop and log the state-changes. we need to find a sync-point where the muxer has processed the tag-event, but not yet written the file headers. GstTagSetter could provide a signal or callback. Need to think more about it.
Just for the record, I'll now start to make the changes. < ensonic> anyone else an idea how to suppress a tag event going downstream (besides writting a tag-swallow-element) < ensonic> otherwise rewriting tags does not really work right now < ensonic> or should a muxer ignore all tag events, if since last state-change tag-setter merge mode was set to REPLACE_ALL ? < Company> ensonic: a muxer should ignore all tags from upstream in REPLACE_ALL and only use the ones explicitly set
Its fixed for avi in CVS now. The test applications needs this in addition: gst_tag_setter_set_tag_merge_mode (setter, GST_TAG_MERGE_REPLACE_ALL); According to docs, tags should be send before element goes to PAUSED.
Created attachment 124339 [details] example code (updated)
Created attachment 124422 [details] example code to write tags
I took changed avimux.c and recompiled plugins-good and installed it. I tried to write 6 tags. first with long values ("example artis" etc). only two first tags got written. Then i tried with short one character values. All got written. I just attached example code. I also tried many tags with id=124339 example code. It didn't work. Only one (first) tag was written.
Some correction: The application would actually use: gst_tag_setter_set_tag_merge_mode (setter, GST_TAG_MERGE_KEEP_ALL); to state, that it wants its own tags to be kept. It would use gst_tag_setter_add_tags (setter, GST_TAG_MERGE_REPLACE_ALL,..., NULL); to set tags. I made corrections to the docs and also fix the elements. I can't reproduce the long/short issue that you reported. $ gst-play -t test_tags2.avi Setting pipeline to PAUSED ... Pipeline is PREROLLING ... FOUND TAG : found by element "avidemux0". audio codec: MPEG-1 layer 3 FOUND TAG : found by element "avidemux0". title: example title artist: example artist genre: example genre comment: example comment copyright: example copyright encoder: GStreamer Good Plug-ins 0.10.11.1 AVI muxer
Created attachment 124855 [details] test example for tagfiltering This shows how to receive arbitrary tags and filter them against a black list in one go. CVS head has fixed core, good (avimux), bad, ffmpeg. Other modules still needs fixes.
What's up with this?
Someone needs to check and fix muxers in base and ugly.
I'll do these after my vaccation, if noone beats me.
Fixed flvmux. Asfmux in bad looks not so easy (there is another one in ugly, but its not build). Regarding base - oggmux does not support tagsetter iface (huh?).
Closing after irc discussion regarding the remaining elements.