Is it possible to stream a video signal locally to a browser?

2

Is it possible to display the open TV signal using a capture card and display within a web browser using HTML5 or JavaScript?

Whereas I use Ubuntu.

    
asked by anonymous 02.04.2014 / 22:27

2 answers

4

Depends on the video card driver, give. Many drivers can work identically to a webcam, so both Flash and HTML5 have access.

HTML5 video example:

<video autoplay id="vid" style="display:none;"></video>
<canvas id="canvas" width="640" height="480" style="border:1px solid #d3d3d3;"></canvas><br>
<button onclick="snapshot()">Salvar um quadro</button>

<script type="text/javascript">

    var video = document.querySelector("#vid");
    var canvas = document.querySelector('#canvas');
    var ctx = canvas.getContext('2d');
    var localMediaStream = null;

    var onCameraFail = function (e) {
        console.log('A camera nao funcionou.', e);
    };

    function snapshot() {
        if (localMediaStream) {
            ctx.drawImage(video, 0, 0);
        }
    }

    navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
    window.URL = window.URL || window.webkitURL;
    navigator.getUserMedia({video:true}, function (stream) {
        video.src = window.URL.createObjectURL(stream);
        localMediaStream = stream;
    }, onCameraFail);

</script>
  

Make sure the "media.navigator.enabled" option is linked in "about: config" in chrome.

Sample source: link

    
02.04.2014 / 22:30
2

Another option is to use softwares for this like:

Windows Media Encoder, takes the video from your card and turns it into streaming. So you can call any player in both html5 and old html the video.

But it consumes a lot of band, I with NET 20MB with 4 ~ 6 people watching 640x420 with reasonable quality, I think it was about 480kbps

    
02.04.2014 / 22:50