Page 1 of 1

VLC can't open mp4 file with OPUS/CBR

Posted: 12 Dec 2019 11:20
by Pavel Aronov
VLC can't open mp4 file with OPUS/CBR. The error is following:
[00007f8cb0c04c60] opus decoder error: Error: corrupted stream?
[00007f8cb0c04c60] main decoder error: buffer deadlock prevented

The same file can be played with Chrome, Firefox and ffplay.

This file was created with following command:
ffmpeg -ss 00:00:00 -i ff-16b-2c-44100hz.opus.ogx -t 00:00:10 -codec libopus -vbr off -frame_duration 10 -strict -2 opus_cbr_10.mp4

Link to source file (but any other audio can be used for that):
https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.opus

Link to result file:
http://redbaron.atwebpages.com/media/opus_cbr_10.mp4

When mp4 file is created with vbr, then there is no such issue and VLC plays it well.

If VLC is rebuilt with following patch, then VLC plays opus_cbr_10.mp4 well.

Code: Select all

--- modules/demux/mp4/mp4.c 2019-12-12 12:58:53.775303509 +0300 +++ modules/demux/mp4/mp4_new.c 2019-12-12 12:59:04.292969877 +0300 @@ -3743,6 +3743,7 @@ case VLC_CODEC_DTS: case VLC_CODEC_MP4A: case VLC_CODEC_A52: + case VLC_CODEC_OPUS: i_max_v0_samples = 1; break; /* fixme, reverse using a list of uncompressed codecs */
So, is it a bug in VLC or it is, indeed, corrupted stream?

Re: VLC can't open mp4 file with OPUS/CBR

Posted: 12 Dec 2019 19:36
by Lotesdelere
Link to result file:
http://redbaron.atwebpages.com/media/opus_cbr_10.mp4

This file is not valid, it's 10 seconds long while the source file is 3 minutes and 7 seconds long.

Re: VLC can't open mp4 file with OPUS/CBR

Posted: 12 Dec 2019 19:51
by Pavel Aronov
This file is not valid, it's 10 seconds long while the source file is 3 minutes and 7 seconds long.
It was deliberately cut with ffmpeg options -ss 00:00:00 and -t 00:00:10 just to make the result file shorter.
If you omit these options, then the result file will be 3:07. I can provide it, if it matters. But the problem is, that the duration is not relevant to the issue, VLC stil will not be able to open it.

Re: VLC can't open mp4 file with OPUS/CBR

Posted: 18 Dec 2019 10:08
by InTheWings


If VLC is rebuilt with following patch, then VLC plays opus_cbr_10.mp4 well.

Code: Select all

--- modules/demux/mp4/mp4.c 2019-12-12 12:58:53.775303509 +0300 +++ modules/demux/mp4/mp4_new.c 2019-12-12 12:59:04.292969877 +0300 @@ -3743,6 +3743,7 @@ case VLC_CODEC_DTS: case VLC_CODEC_MP4A: case VLC_CODEC_A52: + case VLC_CODEC_OPUS: i_max_v0_samples = 1; break; /* fixme, reverse using a list of uncompressed codecs */
So, is it a bug in VLC or it is, indeed, corrupted stream?
Sounds like it needs that fix, but it only depends on muxer as we already have opus in mp4 working :/

Re: VLC can't open mp4 file with OPUS/CBR

Posted: 24 Dec 2019 13:06
by Pavel Aronov
Sounds like it needs that fix, but it only depends on muxer as we already have opus in mp4 working :/
So, if it needs that fix, will it be fixed? The suggested patch is very simple though there may be a better solution.

Re: VLC can't open mp4 file with OPUS/CBR

Posted: 03 Oct 2023 12:03
by jarnos
I also noticed this issue by Android and Linux versions. Android is up to date so it seems this is not fixed.