GNOME Bugzilla – Bug 387121
[matroskamux] Can't mux raw audio
Last modified: 2006-12-24 11:26:45 UTC
Hi, with current CVS (and before) it's impossible to mux audio/x-raw-int into matroska files. MP3 at least works fine. test file: gst-launch audiotestsrc num-buffers=500 ! audioconvert ! "audio/x-raw-int,width=16,depth=16,channels=1,rate=44100,signed=(boolean)true,endianess=1234" ! wavenc ! filesink location=test.wav tested pipeline: gst-launch -v filesrc location=test.wav ! wavparse ! audioconvert ! matroskamux ! filesink location=test.mkv IMHO most interesting line when running with GST_DEBUG=5: 0:00:01.262713000 9237 0x1009c748 DEBUG GST_CAPS gstpad.c:2365:gst_pad_set_caps:<matroskamux0:audio_0> caps audio/x-raw-int, endianness=(int)1234, channels=(int)1, width=(int)16, depth=(int)16, signed=(boolean)true, rate=(int)44100 could not be set If someone wants the complete output just ask... but I guess it's not necessary as this is easily reproduced. Changing of the format of the test file with the capsfilter did not make it work for me, I tested some random variants. I didn't find anything suspicious in the audio setcaps function of matroskamux that could reject the above caps. Bye
Created attachment 78735 [details] [review] Patch fixing matroskamux raw audio handling Fix. The problem was mainly that the gst_structure_get_int (s, "signed", &foo) would fail even though there is a "signed" field, because the "signed" field is of boolean type. Patch also changes pad template caps to the de-facto accepted caps according to the checks in the setcaps function (so that an upstream audioconvert or whatever will be able to negotiate to an accepted format) and adds some more debug output for the failure cases.
Right... For some reason I missed the _get_int after staring at it for some minutes :) Thanks for fixing it. Only the freeze is keeping this from being committed? For the Matroska spec, especially what kind of raw audio is allowed... no idea. The part of the spec about codecs on their website contains almost nothing useful :/ I wonder how one is supposed to implement something Matroska compatible with this spec... but maybe I just missed the real spec somewhere :)
Nope, -good is open again now the release is done.
2006-12-24 Tim-Philipp Müller <tim at centricular dot net> * gst/matroska/matroska-mux.c: (gst_matroska_mux_audio_pad_setcaps): The "signed" field in audio caps is of boolean type, trying to use gst_structure_get_int() to extract it will fail. Fixing this makes matroskamux accept raw audio input (#387121) (use at your own risk though, due to the matroska spec being not entirely useful in this respect). Also fix up raw audio structures in template caps so that they represent what our setcaps function will actually accept, so that converters know what to convert to. Finally, don't fail if there isn't an "endianness" field in 8-bit PCM caps.