Open Bug 1718468 Opened 3 years ago Updated 2 years ago

Firefox does not sniff matroka with incorrect mp4 extension

Categories

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

Firefox 91
defect

Tracking

()

People

(Reporter: liamre, Unassigned, NeedInfo)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Visit https://files.catbox.moe/6w5twb.mp4 or https://jsfiddle.net/erwbf32g/show

Actual results:

The message "No video with supported format and MIME type found" is shown in the video player, and the error
Media resource https://files.catbox.moe/6w5twb.mp4 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006) Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(mozilla::ByteStream *): Cannot parse metadata is logged in the console.

Expected results:

The video should have played, like in Chrome.

I forgot to mention this in the original report: the video is quite loud, so turn down your volume if you're going to play it.

https://files.catbox.moe/6w5twb.mp4 is not an mp4, it's a Matroska file. There's a couple of related problems with this:

  • Firefox doesn't support Matroksa files, though it does support the related webm format. You can see this file works in Firefox if it's renamed with a .webm extension. This renaming shouldn't be done in general, as not all Matroksa files are valid webm files, but it's proof of the issue here.
  • Firefox fails to detect the file as a Matroka file, so tries to parse it as an mp4.

We could improve the sniffing here, so Firefox realizes this is not an mp4, but since the file is a matroksa file, it may only make sense to do so should Firefox support Matroksa.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
See Also: → 1422891
Summary: Certain MP4 cannot be decoded by Firefox (NS_ERROR_DOM_MEDIA_METADATA_ERR) → Firefox does not sniff matroka with incorrect mp4 extension

I don't understand why it works when renaming, it really shouldn't this is not a WebM file. The extension or even MIME type shouldn't be taken into consideration when playing back media file, only sniffing should be used.

I'll check with my patches in bug 1704115.

Flags: needinfo?(padenot)

(In reply to Paul Adenot (:padenot) from comment #3)

I don't understand why it works when renaming, it really shouldn't this is not a WebM file. The extension or even MIME type shouldn't be taken into consideration when playing back media file, only sniffing should be used.

Because our sniffer does not support (non-WebM) Matroska. When the sniffer fails to sniff a mime type from the content, it will sniff a mime type from the extension as a fallback. So the extension still matters.

You need to log in before you can comment on or make changes to this bug.