直播视频流使用什么类型的流协议和套接字
我正在构建一个用 C++ 编写的视频服务器,将实时视频流传输到用 php 和 html 编写的网络视频客户端,以实现视频聊天。
什么类型的协议,例如。我应该使用“UDP、TCP、RTP、RTSP、MMS、阻塞、非阻塞”将实时且不断变化的视频传输到我的 Web 客户端。
我尝试使用 TCP 协议使用非阻塞套接字流式传输视频,但视频在播放第一个流式传输的剪辑后停止,它不会继续播放继续流式传输的剪辑。
我知道的一个例子是使用 Windows Media Encoder 从网络摄像头流式传输内容,并使用浏览器通过简单的嵌入标签访问它,如下所示:
<object ID="MediaPlayer" WIDTH="320" HEIGHT="240" CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<param name="autoStart" value="True">
<param name="filename" value="http://127.0.0.1:8888">
<param NAME="ShowControls" VALUE="False">
<param NAME="ShowStatusBar" VALUE="False">
<embed TYPE="application/x-mplayer2" SRC="http://127.0.0.1:8888" NAME="MediaPlayer" WIDTH="320" HEIGHT="240" autostart="1" showcontrols="0"></embed></object>
我还想知道 Windows Media Encoder 使用什么类型的流协议来实现此目的?
I am a building a video server written in C++ to stream live video to a web video client written in php and html to implement video chatting.
What type of protocols eg. "UDP,TCP, RTP, RTSP, MMS, blocking, non-blocking" should i use to stream the live and constantly changing video to to my web client.
I have tried to stream video using non-blocking socket using TCP protocol but the video stops after playing the first clip streamed, it does not continue to play the clips proceedingly streamed.
An example i know is using Windows Media Encoder to stream the content from your webcam and access it using your browser with just a simple embed tag like this:
<object ID="MediaPlayer" WIDTH="320" HEIGHT="240" CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<param name="autoStart" value="True">
<param name="filename" value="http://127.0.0.1:8888">
<param NAME="ShowControls" VALUE="False">
<param NAME="ShowStatusBar" VALUE="False">
<embed TYPE="application/x-mplayer2" SRC="http://127.0.0.1:8888" NAME="MediaPlayer" WIDTH="320" HEIGHT="240" autostart="1" showcontrols="0"></embed></object>
I also like to know what type of streaming protocol does Windows Media Encoder use to achieve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一些专门用于视频流的协议...您应该首先阅读有关 RTP 和 HTTP Live Streaming 的内容。
There are protocols dedicated to video streaming.... You should read about RTP and HTTP Live Streaming to begin with.