Closed Bug 1740736 Opened 4 years ago Closed 4 years ago

mp4 video created by ffmpeg cannot be downloaded with firefox since version 93

Categories

(Core :: Audio/Video, defect)

Firefox 93
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: avi.marta.michael, Unassigned)

References

Details

Attachments

(4 files)

Attached video test.mp4

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

Summary: mp4 video created by ffmpeg cannot be downloaded with firefox since version 9.3 → mp4 video created by ffmpeg cannot be downloaded with firefox since version 93

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

Flags: needinfo?(avi.marta.michael)
Component: Untriaged → File Handling

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

Flags: needinfo?(avi.marta.michael)
Attached image firefox.PNG

This looks like more fallout from bug 1704115. Paul, can you take a look?

Component: File Handling → Audio/Video
Flags: needinfo?(padenot)
Product: Firefox → Core
See Also: → 1704115

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.

Flags: needinfo?(padenot)

(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.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID

(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 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();

That what I did. Thanks for your replay and for all replies.

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

Attachment

General

Creator:
Created:
Updated:
Size: