HTML5直播视频“黑客”

发布于 2024-09-25 23:59:38 字数 305 浏览 0 评论 0原文

在过去的两个月里,我一直试图“欺骗” safari,让其认为它正在查看服务器上的文件,实际上该文件是来自摄像机的实时视频流,根据请求使用 Gstreamer 编码和混合为支持的格式通过浏览器。由于 HTML5 支持渐进式视频下载,这至少在理论上是可能的。

我的结论是,考虑到浏览器在下载 HTML5 视频文件时会发出部分内容请求(主要是为了查找),这会变得相当复杂。如果服务器不支持此功能,则在文件完全下载后才会播放视频。

还有其他人尝试过这种方法并取得了更大的成功吗?或者我应该放弃并等待真正的实时视频支持(如 RTSP)集成到浏览器中。

干杯。

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 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天涯离梦残月幽梦 2024-10-02 23:59:38

本文提供了一些有用的提示:https://developer.mozilla.org/en/Configuring_servers_for_Ogg_media

您提供 X-content-duration 标头吗?

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

Are you serving the X-content-duration header?

泪之魂 2024-10-02 23:59:38

你有两种可能性。

使用 H.264,您可以模拟具有片段结构的文件:带有电影片段原子 (MOOF) 的 ISO 容器 (.mp4)。

另一个选择是 Google 的 WebM。由于 MKV 文件的结构,客户端可以随时“加入”流。为了获得最佳结果,传输到客户端的第一帧应该是关键帧。

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.

失而复得 2024-10-02 23:59:38

如果您只需要视频而不需要音频,“Motion JPEG”可以做到。它不是 HTML5,而是 Netscape 时代的功能。

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文