开发者

HTML5 live video "hack"

开发者 https://www.devze.com 2023-01-19 09:18 出处:网络
For the last two month I have been trying to \"fool\" safari into thinking that it\'s looking at a file on the server, which in fact is a live video stream from a camera encoded and muxed upon request

For the last two month I have been trying to "fool" safari into thinking that it's looking at a file on the server, which in fact is a live video stream from a camera encoded and muxed upon request using Gstreamer into a format that is supported by the browser. Since HTML5 supports progressive video downloads this should at least开发者_如何学Python be possible in theory.

My conclusion is that this gets quite complicated considering that browsers make a partial content request when downloading video files in HTML5, mainly for the sake of seeking. If the server lacks support for this feature the video is not played until the file is completely downloaded.

Have anyone else tried this approach with more success? Or should I just give up and wait for true live video support like RTSP to be integrated into browsers.

Cheers.


This article provides some useful tips: https://developer.mozilla.org/en/Configuring_servers_for_Ogg_media

Are you serving the X-content-duration header?


You have two possibilies.

With H.264 you can emulate a file with fragmented structure: ISO container (.mp4) with movie fragment atoms (MOOF's).

The other option is Google's WebM. Clients can "join in" the stream any time thanks to MKV file's structure. For best results the first frame transmitted to the client should be akeyframe.


If you only need video but not audio, "Motion JPEG" can do it. It's not HTML5 but a Netscape-era feature.

http://en.wikipedia.org/wiki/Motion_JPEG#M-JPEG_over_HTTP

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号