After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 563221 - GST_TAG_MERGE_REPLACE_ALL not replacing all tags
GST_TAG_MERGE_REPLACE_ALL not replacing all tags
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.9
Other All
: Normal normal
: NONE
Assigned To: Stefan Sauer (gstreamer, gtkdoc dev)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-04 11:57 UTC by Kari Kallioinen
Modified: 2009-09-13 20:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example code (2.29 KB, text/x-csrc)
2008-12-04 11:58 UTC, Kari Kallioinen
Details
example code (updated) (3.03 KB, text/plain)
2008-12-10 11:04 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
Details
example code to write tags (7.79 KB, text/plain)
2008-12-11 14:28 UTC, Kari Kallioinen
Details
test example for tagfiltering (5.00 KB, text/plain)
2008-12-17 12:40 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
Details

Description Kari Kallioinen 2008-12-04 11:57:34 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:
Comment 1 Kari Kallioinen 2008-12-04 11:58:27 UTC
Created attachment 123944 [details]
example code
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-05 15:32:11 UTC
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
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-05 15:49:43 UTC
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.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-09 16:11:53 UTC
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
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-09 17:56:56 UTC
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.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-10 11:04:27 UTC
Created attachment 124339 [details]
example code (updated)
Comment 7 Kari Kallioinen 2008-12-11 14:28:07 UTC
Created attachment 124422 [details]
example code to write tags
Comment 8 Kari Kallioinen 2008-12-11 14:34:35 UTC
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.

Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-15 14:50:50 UTC
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
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2008-12-17 12:40:51 UTC
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.
Comment 11 Tim-Philipp Müller 2009-08-01 19:23:53 UTC
What's up with this?
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2009-08-01 19:26:06 UTC
Someone needs to check and fix muxers in base and ugly.
Comment 13 Stefan Sauer (gstreamer, gtkdoc dev) 2009-08-01 19:29:10 UTC
I'll do these after my vaccation, if noone beats me.
Comment 14 Stefan Sauer (gstreamer, gtkdoc dev) 2009-09-03 11:47:51 UTC
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?).
Comment 15 Stefan Sauer (gstreamer, gtkdoc dev) 2009-09-13 20:09:59 UTC
Closing after irc discussion regarding the remaining elements.