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 387121 - [matroskamux] Can't mux raw audio
[matroskamux] Can't mux raw audio
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.6
Assigned To: Tim-Philipp Müller
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-18 11:40 UTC by Sebastian Dröge (slomo)
Modified: 2006-12-24 11:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing matroskamux raw audio handling (2.32 KB, patch)
2006-12-21 12:19 UTC, Tim-Philipp Müller
committed Details | Review

Description Sebastian Dröge (slomo) 2006-12-18 11:40:32 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
Comment 1 Tim-Philipp Müller 2006-12-21 12:19:11 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2006-12-21 20:44:04 UTC
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 :)
Comment 3 Jan Schmidt 2006-12-22 10:01:56 UTC
Nope, -good is open again now the release is done.
Comment 4 Tim-Philipp Müller 2006-12-24 11:26:45 UTC
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.