Video streaming over websockets using JavaScript

JavascriptVideo StreamingWebsocket

Javascript Problem Overview


What is the fastest way to stream live video using JavaScript? Is WebSockets over TCP a fast enough protocol to stream a video of, say, 30fps?

Javascript Solutions


Solution 1 - Javascript

> Is WebSockets over TCP a fast enough protocol to stream a video of, say, 30fps?

Yes.. it is, take a look at this project. Websockets can easily handle HD videostreaming.. However, you should go for Adaptive Streaming. I explain here how you could implement it.

Currently we're working on a webbased instant messaging application with chat, filesharing and video/webcam support. With some bits and tricks we got streaming media through websockets (used HTML5 Media Capture to get the stream from our webcams).

You need to build a stream API and a Media Stream Transceiver to control the related media processing and transport.

Solution 2 - Javascript

The Media Source Extensions has been proposed which would allow for Adaptive Bitrate Streaming implementations.

Solution 3 - Javascript

To answer the question:

> What is the fastest way to stream live video using JavaScript? Is > WebSockets over TCP a fast enough protocol to stream a video of, say, > 30fps?

Yes, Websocket can be used to transmit over 30 fps and even 60 fps.

The main issue with Websocket is that it is low-level and you have to deal with may other issues than just transmitting video chunks. All in all it's a great transport for video and also audio.

Solution 4 - Javascript

It's definitely conceivable but I am not sure we're there yet. In the meantime, I'd recommend using something like Silverlight with IIS Smooth Streaming. Silverlight is plugin-based, but it works on Windows/OSX/Linux. Some day the HTML5 <video> element will be the way to go, but that will lack support for a little while.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSMiLEView Question on Stackoverflow
Solution 1 - JavascriptWouter DorgeloView Answer on Stackoverflow
Solution 2 - JavascriptNick DesaulniersView Answer on Stackoverflow
Solution 3 - JavascriptquarksView Answer on Stackoverflow
Solution 4 - JavascriptJosh StodolaView Answer on Stackoverflow