title: Recording video from webcam in MP4 format with MediaRecorder
body: <p>When I use the JS MediaRecorder to record webcam in MP4 format in a browser supporting MP4 and MediaRecorder (Firefox on Linux), the webcam starts but it does not record.</p>
  
  <p>Recording has worked when the mimeType of the MediaRecorder is set to <code>video/webm</code> but when I set the mimeType to <code>video/mp4</code> the problem occurs.</p>
  
  <p>I record with the following code:</p>
  
  <pre class="lang-js prettyprint-override"><code>if (navigator.mediaDevices) {
          var constraints = {audio: true, video: true};
          navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
              mediaRecorder = new MediaRecorder(stream, {mimeType: "video/mp4"});
              mediaRecorder.start();
  });
  } else {
  console.log("media recorder is not supported");
  }
  </code></pre>
  
  <p>I expect the webcam to start recording when the code is executed in a supporting browser, but the <code>console.log</code> is not output and in the console there is the error of :</p>
  
  <p><code>NotSupportedError: Operation is not supported</code></p>
  
  <p>I know that my browser supports both mp4 and MediaRecorder:</p>
  
  <p>MP4: <a href="https://caniuse.com/#search=mp4" rel="nofollow noreferrer">https://caniuse.com/#search=mp4</a>
  MediaRecorder: <a href="https://caniuse.com/#search=mediarecorder" rel="nofollow noreferrer">https://caniuse.com/#search=mediarecorder</a></p>
  
  <p>but only webm recording works.</p>