GNOME Bugzilla – Bug 171563
Vorbis support for Matroska muxer
Last modified: 2005-07-20 17:48:13 UTC
Here is a patch that adds Vorbis support to Matroska muxer.
Created attachment 39234 [details] [review] Patch adding Vorbis to Matroska muxer.
This patch involves rewriting the tracks info after gst_matroska_mux_prepare_data. It seems like a bad hack to me, but the muxer did not work unless I have written whole header before gst_matroska_mux_prepare_data in gst_matroska_mux_write_data. Sidenote: the first gst_matroska_mux_prepare_data in _loop function always fails in my setup, so I had to comment out the error fallback. I will try to look deeper into these problems.
The failing prepare_data() implies a bug elsewhere. It should work (in theory). As for the vorbis header data, I think you need to get the first three buffers fromt he stream for that. It is not in the caps, as far as I know. What is your testcase?
Created attachment 39372 [details] Matroska muxer test Here is my simple test code. I am using gstreamer 0.8.9 and gstreamer-plugins 0.8.8 from Debian Sarge (testing). The problem with failing prepare_data() occurs here but also in any other setup I have tried so far. Regarding the ogg vorbis setup headers: rawvorbis encoder sets them to "streamheader" caps metadata when its _chain function is first called. (see gst-plugins/ext/vorbis/vorbisenc.c)
It has always worked for me, so I'd assume you're doing something weird. Muxers assume you link pads, and only then start iterating. Any other setup is not supported. I find your patch weird. First of all, the changes in data handling aren't obvious, some even look wrong. The _mux_header_tracks() part, for example, is very unobvious for me; The reason that we need data before writing the tracks is *so that* we will have the data type of all contained streams. Other muxers work this way, too. I'm willing to apply the vorbis-part of it and make that work, but not the rest. Your testcase has x-csrc as mimetype, but does not open in any of my editors. Can you please re-attach it?
Created attachment 48141 [details] Patch test case. I reattach the testcase with mime type text/plain.
Created attachment 48152 [details] [review] New version of matroska Vorbis support patch I have investigated this problem and I have found that the reason why I was not able to run gst_matroska_mux_prepare_data before writing header (what caused that I had not correct vorbis headers) was a bug in gst_matroska_mux_prepare_data (filled as bug #308633), this new patch need not use the _mux_header_tracks() part.
Created attachment 48153 [details] [review] Vorbis support to matroska I am sorry, the last patch was in a bad format. I am resubmitting.
Thanks, looks perfect.