mp4 video created by ffmpeg cannot be downloaded with firefox since version 93
Categories
(Core :: Audio/Video, defect)
Tracking
()
People
(Reporter: avi.marta.michael, Unassigned)
References
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
the website generates a mp4 video (VideoCodec.MPEG4), from images with ffmpeg and will be saved on the server and then the user wants and expected that the video will be downloaded. That worked always until Firefox 93.* so (93.* and 94.*)
Actual results:
Now the download doesn't happen and in the console these messages will be written:
"Media {link_url} could not be decoded."
"Media resource {link_url} could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_DEMUXER_ERR (0x806e000c) Details: virtual RefPtr<MP4Demuxer::InitPromise> __cdecl mozilla::MP4Demuxer::Init(void): No MP4 audio () or video () tracks"
Expected results:
Download the video file
Comment 1•4 years ago
|
||
Hi Michael
Can you provide which website you're referring to in your comment above? So I can try replicate on my end.
I cannot view the attached mp4.
Best,
Clara
Comment 2•4 years ago
|
||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Hi Clara,
Thank you for your reply.
I know the video will not be opened or played on browsers because of format. But until the version 93.0 of firefox, firefox had always asked if do you want to save the file as normal.
The video is generated on the fly from many bitmap images by using AForge.Video.FFMPEG library and this video represents a chart and how it is changed with the time. I can not refer the website because you have to have an account on it but this video is an example. you can download this video by clicking save as or ctrl+s.
The videos on the Website can be downloaded normally on Chrome, Safari and Opera but not with Firefox (Up 92.*)
Best regards,
Michael
Comment 6•4 years ago
|
||
This looks like more fallout from bug 1704115. Paul, can you take a look?
Comment 7•4 years ago
|
||
This is expected. It should be possible to download it by right clicking and doing "Save Video As:", but this results in:
Exception { name: "NS_ERROR_FAILURE", message: "Failure arg 2 [nsIIOService.newChannelFromURI]", result: 2147500037, filename: "resource://gre/modules/NetUtil.jsm", lineNumber: 311, columnNumber: 0, data: null, stack: "NetUtil_newChannel@resource://gre/modules/NetUtil.jsm:311:31\nsaveHelper@chrome://browser/content/nsContextMenu.js:1716:27\nsaveMedia@chrome://browser/content/nsContextMenu.js:1845:12\noncommand@chrome://browser/content/browser.xhtml:1:14\n", location: XPCWrappedNative_NoHelper }
here when testing directly with the bugzilla attachment.
Comment 8•4 years ago
|
||
(In reply to Michael from comment #0)
the website generates a mp4 video (VideoCodec.MPEG4), from images with ffmpeg and will be saved on the server and then the user wants and expected that the video will be downloaded. That worked always until Firefox 93.* so (93.* and 94.*)
The correct way to do this is the following, considering video
is the video, that has been downloaded to the browser using fetch
or XMLHttpRequest
:
var a = document.createElement( 'a' );
a.style.display = 'none';
document.body.appendChild(a);
const blob = new Blob([video], {type: 'video/mp4'});
a.href = URL.createObjectURL( blob );
a.download = `name-of-the-video-file.mp4`;
a.click();
Closing following discussion. It sounds like the behaviour has changed here, but it's expected that we attempt to play these media files when we detect them (as we do here). Comment 8 is one of the ways to ensure the video is downloaded.
Comment 10•4 years ago
|
||
Reporter | ||
Comment 11•4 years ago
|
||
(In reply to Paul Adenot (:padenot) from comment #8)
(In reply to Michael from comment #0)
the website generates a mp4 video (VideoCodec.MPEG4), from images with ffmpeg and will be saved on the server and then the user wants and expected that the video will be downloaded. That worked always until Firefox 93.* so (93.* and 94.*)
The correct way to do this is the following, considering
video
is the video, that has been downloaded to the browser usingfetch
orXMLHttpRequest
:var a = document.createElement( 'a' ); a.style.display = 'none'; document.body.appendChild(a); const blob = new Blob([video], {type: 'video/mp4'}); a.href = URL.createObjectURL( blob ); a.download = `name-of-the-video-file.mp4`; a.click();
That what I did. Thanks for your replay and for all replies.
Description
•