Xuggler是否生成RTSP流
是否可以使用 Xuggler 生成 RTSP 视频流?如果可以,您能概述一下程序吗?
Is it possible to generate RTSP video stream with Xuggler? If so can you give an outline of the procedure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在做同样的事情,即使我没能成功,我也可以开始为您指出正确的方向:
首先,RTSP 只是控制通道。它类似于 HTTP,用于发送
PLAY
、PAUSE
等命令以及设置流媒体。真正的流媒体可以通过多种方式实现,最常见的可能是基于UDP的RTP-RTCP。对于 RTSP 部分,理解和正确实现它的唯一方法是通过 RFC 。您必须至少实现 OPTIONS、DESCRIBE、PLAY、PAUSE、SETUP 和 TEARDOWN 方法。
一旦您拥有了支持 RTSP 并在一对 RTP 和 RTCP 端口上与客户端达成一致的服务器,您就必须在
IContainer
(IN 方向)中打开要传输的媒体文件,获取一个流(每个流必须设置其 RTP-RTCP 端口对,一个用于音频,一个用于视频等),开始使用 ReadNextPacket(IPacket) 读取数据包并使用getData(IBuffer)
方法填充 RTP 数据包并将其发送到客户端。要控制 RTP 流量(如发送速率、抖动、丢失率等),您还可以使用 RTCP 套接字发送/接收报告。
同样,这些协议的起点是 RFC。
I'm doing the same thing and even if I didn't manage to make it work, I can start to point you in the right direction:
First, RTSP is only the control channel. It is like HTTP and it is used to send commands like
PLAY
,PAUSE
, and to setup the streaming. The real streaming can be realized in a lot of ways, the most common maybe is RTP-RTCP over UDP.For the RTSP part the only way to understand and correctly implement it is going throug the RFC. You have to implement at least the OPTIONS, DESCRIBE, PLAY, PAUSE, SETUP and TEARDOWN methods.
Once you have a server that speaks RTSP and agrees with the client on a pair of ports for RTP and RTCP, you have to open the media file you want to stream in a
IContainer
(direction IN), get one stream (every stream must setup his RTP-RTCP port pair so one for audio, one for video, etc.), start reading the packets withReadNextPacket(IPacket)
and use thegetData(IBuffer)
method to fill a RTP packet and send it to the client.To control the RTP flow (like send rate, jitter, loss rate, etc.) you can also use the RTCP socket to send/receive reports.
Again, the starting point for those protocols are the RFC.