Reputation: 3975
Is it possible to generate RTSP video stream with Xuggler? If so can you give an outline of the procedure?
Upvotes: 1
Views: 1129
Reputation: 513
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 with ReadNextPacket(IPacket)
and use the getData(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.
Upvotes: 0