2

I am working on a concept where people can go live using their webcam. So basically it's a web app. I am using webRTC concept. My code is pretty basic but still have a look :

<script>
(function () {
    console.log('here');
    navigator.getMedia = navigator.getUserMedia ||
            navigator.webkitGetUserMedia ||
            navigator.mozGetUserMedia ||
            navigator.msGetUserMedia;
    window.hasUserMedia = function hasUserMedia() {
        return navigator.getMedia ? true : false;
    };
    var errorcallback = function (e) {
        console.log('errorCalback: ' + e);
    };
    navigator.getMedia({
        video: true,
        audio: true
    },
    function (stream) {
        var video = document.getElementById('live'),
                webcamstream, streamrecorder,
                vendorUrl = window.URL || window.webkitURL;
        console.log(video);
        video.src = vendorUrl.createObjectURL(stream);
        //webcamstream = stream;
        //video.play();
        video.onloadedmetadata = function (e) {
            var counter = 0;
            counter++;
            console.log(e);
            console.log(video.src);
        };
    }, errorcallback);
})();

This video.src gives a source but i think it's in blob format.

the output is something like mediastream:http://localhost.movyt.com/8b57e486-a985-4331-b9ab-0eaf6def3404. Well blob formats can't be published. We need to encode it to RTMP encoded. My question is how would i encode it with out any third party softwares because as a end user i will not likely install any software for signing up a website.

I tried with flash for live streaming but there is a need to install flash live encoder which i don't want to use as it won't be user friendly. There are pretty dedicated servers like wowza, dacast and all but they need RTMP encoded video streams for further processing .

note: I tried with a <video src=video.src> in another page but it won't fruit into any result because as per the previous code written video.src is coming from video metadata.

So is there any way to encode my blob video to RTMP protocol?

bibliophilsagar
  • 1,713
  • 1
  • 19
  • 40
  • how about telling the reason before downvoting. any help would be appreciated. – bibliophilsagar Nov 20 '15 at 14:03
  • RTMP is a flash format from 2007, so that seems like a dead end if you don't want to install flash. – jib Nov 22 '15 at 13:24
  • can you please suggest any way using webRTC? @jib 4 – bibliophilsagar Nov 22 '15 at 17:53
  • 1
    See http://stackoverflow.com/questions/25523289/sending-a-mediastream-to-host-server-with-webrtc-after-it-is-captured-by-getuser or http://stackoverflow.com/questions/16571044/how-to-record-webcam-and-audio-using-webrtc-and-a-server-based-peer-connection – jib Nov 22 '15 at 22:33

1 Answers1

0

Since you have already looked at Wowza I assume you are going to be redistributing this published stream. That server does have WebRTC capabilities:

https://www.wowza.com/products/capabilities/webrtc-streaming-software

You currently have to sign up for the "Preview" to activate these features, but not for much longer.

I highly recommend avoiding the attempt at using RTMP as a transport protocol to/from the browser, as this will always require a plugin like Flash (on its way out).

TomSchober
  • 433
  • 4
  • 12