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 741321 - opusparse: fix header parsing esp. of encoded output of libopus
opusparse: fix header parsing esp. of encoded output of libopus
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.4
Other Linux
: Normal normal
: 1.4.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-10 09:30 UTC by David Fernandez
Modified: 2014-12-15 19:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
execution log (16.95 KB, text/plain)
2014-12-15 10:11 UTC, David Fernandez
Details

Description David Fernandez 2014-12-10 09:30:05 UTC
Hello,

I'm trying to use opus as audio codec but I'm having troubles with the opus parser. If I use opusparse to configure the caps of the opus depayloader or the opus decoder I get an opus decoder error -4 (OPUS_INVALID_PACKET), but if I set the caps manually everything works ok.

The error is very easy to reproduce. This pipeline works ok:
gst-launch-1.0 audiotestsrc ! opusenc ! opusdec ! autoaudiosink

But this one throws the error -4:
gst-launch-1.0 audiotestsrc ! opusenc ! opusparse ! opusdec ! autoaudiosink

I have tested many pipelines using parsers between decoder and encoder and all work ok:

gst-launch-1.0 audiotestsrc ! vorbisenc ! vorbisparse ! decodebin ! autoaudiosink
gst-launch-1.0 videotestsrc ! x264enc ! h264parse ! decodebin ! autovideosink

I think there is a problem in the opusparse element, but I can't find it.

Thanks in advance.
Regards.
Comment 1 Vincent Penquerc'h 2014-12-15 09:55:15 UTC
Seems to work fine with recent-ish master, which should be pretty close to 1.4.4, though there was no relevant change to opusparse for a while.

$ gst-launch-1.0 audiotestsrc ! opusenc ! opusparse ! opusdec ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:05.384966283
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Maybe a GST_DEBUG=2,opus*:9 might help shed some light.
Comment 2 David Fernandez 2014-12-15 10:11:35 UTC
Created attachment 292745 [details]
execution log
Comment 3 David Fernandez 2014-12-15 10:11:57 UTC
Comment on attachment 292745 [details]
execution log

Hi Vincent,

Thanks for your response. I can't update my gstreamer version to master, but as you said, it not seems to be relevant changes. I have attached the log of the execution. I hope it will be relevant for you.

Regards.
David.
Comment 4 Vincent Penquerc'h 2014-12-15 12:04:13 UTC
I now get the same error after updating my copy of libopus.
Comment 5 Vincent Penquerc'h 2014-12-15 15:26:12 UTC
I have no idea why it was working originally. I had an old copy of libopus, but trying those also failed. In any case, I found the bug in opusparse:


commit 79b56ebcc9511a50d9fe9fbb93b48d5c2170bad8
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Dec 15 15:21:50 2014 +0000

    opusparse: fix frame size determination
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741321
Comment 6 David Fernandez 2014-12-15 15:59:20 UTC
The patch works fine for me.

Thank you very much. 

Regards.
Comment 7 Tim-Philipp Müller 2014-12-15 17:59:11 UTC
Cherry-picked into 1.4 branch.
Comment 8 Vincent Penquerc'h 2014-12-15 19:06:10 UTC
Just resetting the title as it happens also with old opus too. I have no idea why it worked with the version I had originally, but when I tried to bisect in libopus, it continued to fail till before the version I originally had. So it's just a bug in opusparse, independent of the libopus version.