views:

633

answers:

4

I've heard of many interesting features of html 5,

but is it able to serve real time media stream from web camera?

+1  A: 

This has nothing to do with HTML 5, actually. In HTML you just point the browser to a resource, specifying it's video. If your camera emits a stream in a format the browser is able to render, then it should work, sure. Though in my experience many cameras yield MJPEG and support for that directly in browsers appears to be limited at best.

Joey
A: 

Not html5 on it's own but html5 video can read streams(like on youtube, live streaming).

http://stackoverflow.com/questions/1735933/streaming-via-rtsp-or-rtp-in-html5 for some info

Neb
Is html5 video a tag?Can you elaborate?
Yes http://www.html5video.org/http://www.w3schools.com/html5/tag_video.asphttp://www.youtube.com/html5
Neb
thanks! But how can I convert camera streams into `rtp/rtsp` format?
Im not sure. I was giving that as an example. That its a totally different question so I suggest you ask another question about that.
Neb
+1  A: 

HTML5 video is just a tag that looks like

<video src="movie.mp4" controls="controls">
    Your browser doesn't support the video tag.
</video>

(reference here)

Whatever that movie.mp4 actually contains is decided by the underlying server and may be streaming content as long as the format itself supports streaming. For example h.264's eXtended Profile and Scalable High Profile both support video streaming.

Esko
A: 

I did the proof for this a few days ago. The answer is yes and no. Yes the XMLHttpRequest allows you to access the data while it is streaming from the camera. No it is not supported across all browsers.

In a XMLHttpRequest you can get status messages from the object when done asynchronously. Problem being that each browser handels this a little diffrent. The big problem is that even though Internet Explorer dose support the update to the status if you try to access the data in state 3 it will give an error. For more info please follow the link.

If your camera can send a video stream that is a standard media type like the other posters have been saying then that would be your best option. Maybe after the release of IE 9 will the XMLHttpRequest work as assumed.

JustSmith
@JustSmith, do you have a good solution that can convert real time camera video into `rtp/rtsp` format?
@user198729 Assuming we are still talking about HTML/JavaScript RTP/RTSP uses a different port than HTTP. Some of the meta data is in plain text, the rest not. In you XMLHttpRequest change the request address to include a port, "rtp://someAddress:1024/whatever", and you can try to request the data though RTP. However the RTP transport is UDP which might be a problem through a browser. You will have to decode all the data you receive and send status updates on RTSP. If you can pick any browser use IE, build a windows form control, and try to find libs that will decode this for you.
JustSmith