Firefox can't play Opus tracks without CodecDelay




2 years ago
2 years ago


(Reporter: kagami, Unassigned)


46 Branch

Firefox Tracking Flags

(Not tracked)



(2 attachments)



2 years ago
Created attachment 8757327 [details]

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160425114621

Steps to reproduce:

Latest FFmpeg from git (any commit since April, 10) produces Opus WebM files without CodecDelay field on remuxing. It was reported here: however no actions has been made yet.

Commands to generate example files:
$ ffmpeg -f lavfi -i testsrc -f lavfi -i sine -t 5 -c:v vp8 -c:a opus with_delay.webm
$ mkvinfo with_delay.webm | grep delay
|  + Codec delay: 6.500ms (6500000ns)
$ ffmpeg -i with_delay.webm -c copy without_delay.webm
$ mkvinfo without_delay.webm | grep delay

Actual results:

First WebM can be played without any issues.
Second WebM can't be played in Firefox: "Video can't be played because the file is corrupt.".
Both WebMs can be played in desktop standalone players (like mpv) perfectly fine, Chrome/Chromium also play them without any issues.

Expected results:

I'm not sure why exactly Firefox strictly requires CodecDelay field but since other players handle files without CodecDelay well, it should probably be relaxed in Firefox too?

I've only found this bug:
>In particular, we should reject files whose CodecDelay track property doesn't match the value from the OpusHeader CodecPrivate
Is that the reason such files recognized as corruped?

Comment 1

2 years ago
Created attachment 8757328 [details]
:derf, the file is rejected because the codec delay set in the webm do not match the preskip value.

Should this check be relaxed? and if so, should we even care about the codec delay setting?
Flags: needinfo?(tterribe)


2 years ago
Component: Untriaged → Audio/Video
Product: Firefox → Core
Echoing what I said in #opus on Friday:

<+derf> jya: I'd say if the file has a non-zero preskip value and no CodecDelay, then we're well within our rights to reject it.
<+derf> Any codec-agnostic demuxer (to the extent such a thing is even possible) is going to do the wrong thing with that file.
Flags: needinfo?(tterribe)


2 years ago
Component: Audio/Video → Audio/Video: Playback
The file is broken, the muxer should be fixed.
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.