HTML5 视频标签和 RTP URL
我希望在 HTML5 中播放基于 RTP 的音频和视频流。我知道正确的方法是使用 ConnectionPeer (HTML5) 或 PeerConnection (webRTC),但由于这两种方法尚不可用,我正在寻找替代方案。
我的脑海中浮现出一个问题,我正在寻找答案。
- 如果视频标签的 src 设置为
“rtp://127.0.0.1:4567/path/to/stream”
,浏览器如何处理 RTP URL? - 它是否尝试打开到服务器/端口的 UDP 连接?
我假设答案是否定的,并且该请求不会转换为 HTTP 请求,因为它不会显示在我的 Web 服务器日志中。
- 浏览器是否会简单地忽略它,因为 RTP 并不是真正的 URL?
I am looking to play out RTP-based audio and video streams in HTML5. I know the correct way to do this is using ConnectionPeer (HTML5) or PeerConnection (webRTC), but as neither are yet available, I am looking for alternatives.
One question sprung to mind for which I am looking for an answer.
- In the case of the video tag having the src set to
"rtp://127.0.0.1:4567/path/to/stream"
, what does the browser do with the RTP URL? - Does it try to open a UDP connection to the server/port?
I am assuming the answer is no, and the request isn't converted into a HTTP request because it doesn't show up in my web server logs.
- Does the browser simply ignore it as RTP is not really a URL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,rtp:// 架构并不是真正的 URL,因为您的播放器必须知道用于解码它的流/编解码器/参数,这些流/编解码器/参数不是通过 RTP 流承载的。通常这些参数位于随附的 SDP 文件中。
如果您的浏览器确实支持 HTML5 视频的 RTP,请尝试将
src
属性 URL 设置为指向描述流的 SDP 文件(例如,将 SDP 文件放在 HTTP 服务器上并设置src
属性指向它)。Indeed
rtp://
schemas are not really a URL, because your player must know the streams/codecs/parameters for decoding it which are not carried over the RTP stream. Usually these parameters are in an accompanying SDP file.If your browser does support RTP for HTML5 videos, try setting the
src
attribute URL to point to the SDP file describing the streams (e.g., put the SDP file on an HTTP server and set thesrc
attribute to point to it).