I am building an RTSP streaming server in java using xuggler, but I'm not sure how to implement correct RTP packetization.
My current approach is to call ReadNextPacket(packet)
on the input container, then craft an RTP packet with the payload filled by packet.getData()
and appropriate header (payload type based on stream index, timestamp set by getTimestamp()
, etc.) and send it.
Can someone provide me a practical example of how to encode an IPacket
into a correct rtp payload, in the most input-format-independent way? The documentation is a bit lacking on this.
I've seen a code which used javax.media for implementing RTP server.