GNOME Bugzilla – Bug 782132
Gstreamer doesn't handle Opus preskip larger than one frame
Last modified: 2017-05-29 15:23:54 UTC
It seems like Gstreamer has a hard time with Ogg Opus preskip values larger than one frame (960 samples). It normally handles chaining fine, but not when preskip is larger. The following audio sample currently works fine for me: https://jmvalin.ca/misc_stuff/chain_works.opus It it made of 1-second streams chained together and should play for 90 seconds (it does for me). Now, this file is almost identical except for a few samples being trimmed (using preskip) at the beginning: https://jmvalin.ca/misc_stuff/chain_doesnwtork.opus For me, this file only plays for about 1 second and then hangs gstreamer. Then there's this file that would actually crash totem: https://jmvalin.ca/misc_stuff/totem_crash2.opus This got reported in https://bugzilla.gnome.org/show_bug.cgi?id=782095 but it's not just that crash that needs to be fixed. The file should also play for 90 seconds and not just one.
*** Bug 782157 has been marked as a duplicate of this bug. ***
Created attachment 351192 [details] [review] fix chained opus with preskip > packet length This fixes playback, however I get constant small artifacts, which means the clipping is probably still not quite right.
Comment on attachment 351192 [details] [review] fix chained opus with preskip > packet length Seems to make sense, but should look at the artifacts. Would be good to compare with the expected output, to see in e.g. audacity how much is missing and where.
I uploaded what the decoded version should look like. For https://jmvalin.ca/misc_stuff/totem_crash2.opus the decoded file (using opusdec) is: https://jmvalin.ca/misc_stuff/totem_crash2.wav This example has the large preskip on every stream. There's also: https://jmvalin.ca/misc_stuff/chain_doesnwtork.opus that should decode to: https://jmvalin.ca/misc_stuff/chain_doesnwtork.wav That one only has the large preskip on the first stream.
I'd missed this got set to commit-now. commit 523e98396fa05282ca8e9d98a48426edf72c0023 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Fri May 5 12:48:41 2017 +0100 oggdemux: fix clipping more samples than exist in the first packet This can happen in Opus (and maybe other codecs ?), and would cause failure to play. https://bugzilla.gnome.org/show_bug.cgi?id=782157 Still artifacts left to fix though.
Should this go into 1.12?
Created attachment 352766 [details] [review] fix artifacts at chain boundaries That fixes the artifacts at chain boundaries - something I'd broken myself. The 319 chain samples now sounds as good as the opusdec output.
commit bb0abf85587a4ef23937928fbd5d550cf1f73e99 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Mon May 29 13:44:01 2017 +0100 oggdemux: fix artifacts at chain boundaries https://bugzilla.gnome.org/show_bug.cgi?id=782132