Closed Bug 1227153 Opened 9 years ago Closed 8 years ago

Cannot play 24kHz opus audio stream inside a webm file

Categories

(Core :: Audio/Video: Playback, defect, P1)

42 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: przemyslaw.sobala, Assigned: mozbugz)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached video tmp.webm
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20151029151421

Steps to reproduce:

I used FFmpeg to create a webm file with a 24kHz sampled audio stream encoded with opus audio codec, eg:
ffmpeg -i http://www.soundsnap.com/audio/play/72210%3A1448291371%3Ab4326304c013a3a61b3b87d83158c91b -c:a libopus -b:a 64k -ar 24000 /tmp/tmp.webm


Actual results:

When opening the webm file with Firefox (eg. file:///tmp/tmp.webm) browser reports an error.
It happens regardless of input file.
When I encode with sample rate = 48000 (ffmpeg -i http://www.soundsnap.com/audio/play/72210%3A1448291371%3Ab4326304c013a3a61b3b87d83158c91b -c:a libopus -b:a 64k -ar 48000 /tmp/tmp.webm) the result is playable.
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Priority: -- → P1
There's a sanity check in the OpusDataDecoder that fails because it's using the wrong rate. Working on a patch now.
Assignee: nobody → gsquelart
Attached patch 1227153-check-nominal-rate.patch (obsolete) — Splinter Review
Use nominal rate in Opus sanity check.

The OpusDataDecoder checks that the 'codecDelay' (in microseconds)
configuration matches the time to skip "pre-skip" frames. However the latter
was calculated using the OpusParser rate (which is always 48kHz) instead of the
nominal rate (actually used in the file).
Attachment #8703467 - Flags: review?(kinetik)
Maybe I am confused, but the pre-skip value stored in the header is always stored at the 48 kHz rate. We should not be using the nominal rate here. If the value stored in CodecDelay was computed from the header's pre-skip field using the nominal rate, then that value is broken and we are correct to reject the file.

I.e., the bug here may be in FFmpeg, not in Firefox.
Comment on attachment 8703467 [details] [diff] [review]
1227153-check-nominal-rate.patch

(In reply to Timothy B. Terriberry (:derf) from comment #3)
> Maybe I am confused, but the pre-skip value stored in the header is always
> stored at the 48 kHz rate. We should not be using the nominal rate here. If
> the value stored in CodecDelay was computed from the header's pre-skip field
> using the nominal rate, then that value is broken and we are correct to
> reject the file.
> 
> I.e., the bug here may be in FFmpeg, not in Firefox.

Thank you Timothy, you are most certainly correct, pre-skip refers to 48kHz frames.
Attachment #8703467 - Attachment is obsolete: true
Attachment #8703467 - Flags: review?(kinetik)
As per comment 3, it looks like FFmpeg is producing an incorrect Opus file, with a 'pre-skip' value using the nominal rate instead of the expected 48 kHz.

CC:Michael, could you please have a look?
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Created ticket at FFmpeg's bugtracker: https://trac.ffmpeg.org/ticket/5121
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: