Firefox does not sniff matroka with incorrect mp4 extension
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: liamre, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
361.81 KB,
image/png
|
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•4 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•4 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•4 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.
Comment 5•6 months ago
|
||
The file is already invalid, so I can't verify it. But we have implemented the Matroska sniffing in bug 1985336. Please file a new one if the issue still presents.
Comment 6•6 months ago
|
||
Invalid? I can still view https://files.catbox.moe/6w5twb.mp4 with Chrome, but Firefox Nightly still fails with the same error (NS_ERROR_DOM_MEDIA_METADATA_ERR) even though media.mkv.enabled is true. I can even download the file and playback it locally on Chrome.
If you really can't download the file, I'll attach it here. Do I really need to file a new bug just for this?
Comment 7•6 months ago
|
||
Sorry, the issue was caused by my VPN. After disabling it, I was able to access the file. Reopening this bug.
Comment 8•5 months ago
•
|
||
If I download the file and load it from local filesystem or python http.server, Nightly plays the video. X-Content-Type-Options: nosniff prevents the sniffing. ~~~But we do not comply with the spec. nosniff should not prevent us from sniffing media files according to the spec.~~~
Edit: Sorry, I was misreading the specs.
Comment 9•5 months ago
|
||
The video is loading fine from the JSFiddle example (as expected.)
Description
•