lowerkey
lowerkey

Reputation: 8345

How to live stream a desktop to html5 video tag

I have some output from a program I'd like to stream live to a html5 video tag. So far I've used VLC to capture the screen, transcode it to ogg, and stream it using its built-in http server. It works insofar that I see the desktop image in the browser window.

The catch is this: Every time I refresh the page, the video starts from the top, where I'd like to see only the current screen, so that I can use it to build a sort of limited remote desktop solution that allows me to control the ubuntu desktop program from the browser.

I was thinking websockets to send the mouse events to the program, but I'm stuck on how to get the live picture instead of the whole stream.

Thanks in advance!

Upvotes: 2

Views: 5414

Answers (1)

moka
moka

Reputation: 23053

If you are building server side as well, I would suggest handle that operation yourself. What you can do, is use mjpeg for html streaming. And you can write server application that will accept http connections and will send header of mjpeg stream and then every update will send picture it self. That way you will have realtime stream in browser.

This option is good due to ability of having control over stream from server side, and for client side it is just tag with mjpeg.

Regarding WebSockets - yes you can build it, but you will have to implement input devices control on remote computer side.

Here is server of streaming MJPEG that might be interesting to you: http://www.codeproject.com/Articles/371955/Motion-JPEG-Streaming-Server

Upvotes: 3

Related Questions