Firefox does not sniff matroka with incorrect mp4 extension
Categories
(Core :: Audio/Video: Playback, defect, P3)
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.
Reporter | ||
Comment 1•3 years ago
|
||
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.
Comment 3•3 years ago
|
||
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.
Comment 4•2 years ago
|
||
(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.
Description
•