Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending camera video from browser to server

Im trying out the new and exciting features of chrome canary 19.

I can basically grab the video from the web-cam and set it to a source element for a video tag.

<!DOCTYPE html>
<html>
    <head>
    <title>Camera capture</title>
    <script>
        var localStream;
        var localStreamObjUrl;
        window.onload = function() {
            navigator.webkitGetUserMedia("audio, video", gotStream);
        }
        function gotStream(stream) {
            localStream = stream;
            localStreamObjUrl = webkitURL.createObjectURL(localStream);
            var video = document.getElementById("selfView");
            video.src = localStreamObjUrl;
        }
    </script>
</head>
<body>
    <video id="selfView" autoplay audio=muted></video>
</body>
</html>

From the example at https://apprtc.appspot.com, we can grab the video and stream it to a peer...

My question is, can I avoid doing all the traversal to get a p2p connection and directly upload the video to a server? Id like to be able to relay the video stream instead of sending it p2p.

like image 452
user1201022 Avatar asked Feb 10 '12 02:02

user1201022


2 Answers

You need some kind of streaming media server on the back.

The process would be:

  1. capture the feed
  2. send it to the server
  3. transcode to various client formats
  4. manage the outbound streams

There are numerous free and paid varieties available:

  • nodejs(demo/POC)
  • wowza(paid)
  • chrome based

More about transcoding: xuggler
The 'swiss army knife' of media: ffmpeg

and so on.

like image 197
ethrbunny Avatar answered Nov 15 '22 03:11

ethrbunny


I have developed video recording solutions for the better part of the last 5 years and contributed a lot to fixing video recording bugs in Red5.

On the desktop you can use a Flash client + a media server (Red5, Wowza, Adobe Media Server) and on the mobile you can use HTML Media Capture.

I gave a detailed answer on a similar question at Record video on browser and upload to LAMP server

like image 1
Octavian Naicu Avatar answered Nov 15 '22 04:11

Octavian Naicu