streamproc / MediaStreamRecorder

Cross browser audio/video/screen recording. It supports Chrome, Firefox, Opera and Microsoft Edge. It even works on Android browsers. It follows latest MediaRecorder API standards and provides similar APIs.
https://www.webrtc-experiment.com/msr/
MIT License
2.62k stars 563 forks source link

can't save as h264 #163

Open oa495 opened 6 years ago

oa495 commented 6 years ago
function startRecording() {
    try {
      var stream = canvas.elt.captureStream(); // frames per second
      mediaRecorder = new MediaStreamRecorder(stream);
      mediaRecorder.mimeType = format; 
    } catch (e) {
      console.error('Exception while creating MediaRecorder: ' + e);
      alert('Exception while creating MediaRecorder: '
        + e + '. mimeType: ');
      return;
    }
    mediaRecorder.onstop = handleStop;
    mediaRecorder.ondataavailable = handleDataAvailable;
    mediaRecorder.start(5000); // collect 10ms of data
    console.log('MediaRecorder started', mediaRecorder);
}

function download() {
  mediaRecorder.save();
}

I've tried format = 'video/mp4', format = 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' and format="video/mp4;codecs=H264"

won't open on twitter or quicktime

rogerbage commented 1 year ago

Hi. MediaRecorder on Firefox an Chrome don't have support do mp4. I have the same issue. You can save as a mp4, sending to blob as mp4, but when you see de metadatas of the file, is Webm. But Iphone with Safari don't play mp4. That's my problem. Do you find any solution to this?