yomguy / stream-m

A HTML5 compatible WebM live streaming server
http://code.google.com/p/stream-m/
70 stars 12 forks source link

is possible use getUserMedia html5 feature for capturing video #4

Open cocodrino opened 11 years ago

cocodrino commented 11 years ago

Hi, this project looks great but I've not experience with streaming data, I think would be possible use getUserMedia and websocket for stream to the webserver (instead use vlc) someone has did the try?...is it possible??..thanks!!...

this post shows a similar idea, I don't know about how well is the performance... http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/

yomguy commented 11 years ago

Hi!

It could be indeed very interesting to use getUserMedia to stream video to stream-m. But I'm sceptic about the capability of even recent browsers to encode the video in webm in realtime. Google use a separate library for this. Also the websocket principle is out of topic for stream-m as this server is http based.

But, thanks a lot for the info! Websockets and full JS client interfaces could indeed be the future of media streaming..

For info, I first use gstreamer to encode a webcam stream and push it to a local port like this:

gst-launch v4l2src device=/dev/video1 ! video/x-raw-rgb, width=640, height=360, framerate={24/1}  \
        ! queue ! ffmpegcolorspace \
        ! queue ! vp8enc speed=2 threads=4 quality=10.0 max-latency=25 max-keyframe-distance=96 auto-alt-ref-frames=true  ! queue ! muxout. \
        jackaudiosrc connect=2 ! audio/x-raw-float, channels=2 \
        ! queue ! audioconvert ! queue ! vorbisenc quality=0.3 ! queue ! muxout.  \
        webmmux streamable=true name=muxout \
        ! queue ! tcpserversink host=127.0.0.1 port=9000 protocol=none blocksize=65536 sync-method=1

and then use curl through python to relay the stream to Stream-m: https://github.com/yomguy/DeeFuzzer/blob/master/deefuzzer/tools/streamer.py