RTP over RTSP (TCP) (i) solution for mixed delivery of RTP over RTSP packetsRTSP-RTP over TCP-to-use TCP communication, the need to request TCP connection during RTSP SETUP. The RTSP client needs to request a TCP connection in the setup phase for the sent Setup command with which you want to use a TCP connection. The Setup command should include transport in the following format:
transport:rtp/avp/tcp;interleaved=0-1
This is the server to send media data with TCP and interleave the data in channel 0 and 1. Given in the specification, data channel is even the above transport will tell the server to send media data using the TCP protocol, and use channel 0 and 1 convection data and control information for interleaving. In detail, an even channel is used as the data number and control channel is odd (Data_ch_num + 1). So, if you are data channel is 0, your control channel would be 0 + 1 = 1. Transmit channel, using odd channel as control channel (data channel + 1). So, if you set the data channel to 0, that control channel should be 0 + 1 = 1. Below is an example of TCP SETUP
RTP DataAfter the setup, RTP data would be sent through the TCP socket, which is used for RTSP commands. After the RTP data will is encapsulate in the following formatsetup, the RTP is sent via the TCP socket used to send the RTSP command. The RTP data will be encapsulated in the following format:
| magic number | channel number | Embedded data length | data |
Magic number-1 byte value of hex 0x24RTP data identifier, "$" channel number-1 byte value to denote the channel number-1 bytes, used to indicate the channel embedded data length-2 bytes to denote The embedded data Length-2 bytes, used to indicate the length of the inserted data Data-data packet, IE RTP packet, with the total length of the embedded DAT A length data-packets, such as RTP packets, with the same total length as the above data length
RTSP-RTP over TCP