Passing stream of getUserMedia output to ffmpeg,How would i do that?

707 views Asked by At

I am using getUserMedia to get access to camera.while playing the captured video with getUserMedia. I want to stream and broadcast it to all user in my page as Live stream using ffmpeg and ffserver.

How would I post that stream to server(ffserver) for streaming it live?

Here is the code for getUserMedia part

window.addEventListener('DOMContentLoaded', function() {
  var v = document.getElementById('vlive');
  navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia 
   || navigator.mozGetUserMedia || navigator.msGetUserMedia);
  if (navigator.getUserMedia) {
    navigator.getUserMedia({
        video: true,
        audio: true,
      },
      function(stream) {
        var url = window.URL || window.webkitURL;
        v.src = url ? url.createObjectURL(stream) : stream;
        v.play();
      },
      function(error) {
        console.log('Good Job');
        alert('Something went wrong. (error code ' + error.code + ')');
        return;
      });
  } else {
    alert('Sorry, the browser you are using doesn\'t support getUserMedia');
    return;
  }
});
0

There are 0 answers