question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mimeType = "video/mp4" doesn't work

See original GitHub issue

Hi, this project helps me a lot, thank you very much.

Summary:

I successfully can create blob url of mp4 and that URL is able to be played on Chrome, but once I downloaded it, it’s not playable for QuickTime Player.

(Regarding this truth, I changed the issue summary)

Even when I give recorder mimeType with "video/mp4", the generated file is webm, as ffmpeg said. That causes that I cannot play that video on QuickTime Player nor upload to Twitter.

Reproducibility:

  • 100%
  • Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
  • Here is an example product to reproduce this problem https://github.com/otiai10/msr-debug
const main = () => {
  console.log('MediaStreamRecorder:', typeof MediaStreamRecorder);
  navigator.getUserMedia({audio:false, video:true}, (stream) => {

    var recorder = new MediaStreamRecorder(stream);
    // recorder.mimeType = 'video/mp4';
    recorder.mimeType = 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"';
    recorder.width    = 800;
    recorder.height   = 480;

    recorder.ondataavailable = (blob) => {
      const url = URL.createObjectURL(blob);
      // It works, looks good.
      window.open(url);

      // When I downloaded it as a file,
      var a = document.createElement('a');
      a.href = url;
      a.download = 'msr-example.mp4';
      a.click();
      // successful, but not playable on QuickTime Player
    };

    // Record it for 3s
    recorder.start();
    setTimeout(() => recorder.stop(), 3000);

  }, (err) => {
    console.error('getUserMedia failed', err);
  });
};

window.onload = main;

Screen Shots:

Console

working and playable on Chrome

not playable on QuickTime

Comment:

I also found https://github.com/streamproc/MediaStreamRecorder/issues/69 and I assumed that is because codec support of QuickTime. I’m not familiar with binary/blob/encode/decode stuff, therefore any of your advise would be helpful for me. Thank you again.

cc @muaz-khan

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

9reactions
stevulacommented, Feb 21, 2017

What was your misunderstanding @otiai10 ? I’m having a similar issue.

0reactions
mzalencommented, Mar 27, 2019

I haven’t found any clear answers (other than to use ffmpeg to convert webm to mp4), but I found this interesting thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Correct mime type for .mp4 - Stack Overflow
According to RFC 4337 § 2, video/mp4 is indeed the correct Content-Type for MPEG-4 video. Generally, you can find official MIME definitions by...
Read more >
mime type html5 video | Firefox Support Forum - Mozilla Support
The webm file doesn't seem to work at all when tested from the server. I am using Miro Video Converter for webm, mp4...
Read more >
Firefox MIME Video not Supported: 5 Ways to Fix it in 2022
How do I fix no video with the supported format and MIME type found Firefox? · 1. Switch to a different browser ·...
Read more >
Is video/mp4 a supported mime type?
I have a lightning web component that contains a file picker. If I pick an mp4 file then I encounter an error.
Read more >
Error message "Video format or MIME type is not supported"
Open IIS Manager . · In Features View, double-click MIME Types. · In the Actions pane, click Add. · In the Add MIME...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found