Exportieren von HTML5-blob-video zu MP4

Ich versuche, mit Chrome die screen-sharing-Funktion, um einen Bildschirm-recorder, und speichern Sie das video im MP4-format. Ich habe allerdings keine Ahnung, wie ich dies Tue. Die demo ist auf https://figgycity50.kd.io/screencap.html (include https!) und der code ist:

<video autoplay></video>
<button>start</button>
<script>

navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.getUserMedia;

var stream = null;
button = document.querySelector("button");

function start(e) {
  //Seems to only work over SSL.
  navigator.getUserMedia({
    video: {
      mandatory: {
        chromeMediaSource: 'screen',
         maxWidth: 1280,
         maxHeight: 720
      }
    }
  }, function(s) {
    stream = s;

    button.textContent = 'Stop';
    button.removeEventListener('click', start);
    button.addEventListener('click', stop);

    var video = document.querySelector('video');
    video.src = window.URL.createObjectURL(stream);
    video.autoplay = true;

    stream.onended = function(e) {
      //The save code should go here.
    };

    //document.body.appendChild(video);
  }, function(e) {
  });
}

function stop() {
  stream.stop();
  button.addEventListener('click', start);
  button.textContent = 'Capture your screen';
}

button.addEventListener('click', start);

</script>

Wie mache ich das?

InformationsquelleAutor figgycity50 | 2014-01-18
Schreibe einen Kommentar