RTSP中Setup请求的Transport字段中规定了RTP传输协议及方法
按RFC2326中规定 分为3种 :
一、UDP单播(默认)
C->S: SETUP uri RTSP/1.0
Transport: RTP/AVP[/UDP];unicast;client_port=%u-%u (RTP port-RTCP port)
S->C:
RTSP/1.0 200 OK
Transport:RTP/AVP[/UDP];unicast;client_port=%u-%u;server_port=%u-%u;[ssrc=%08X]
二、UDP组播
C->M:SETUP uri RTSP/1.0
Transport: RTP/AVP;multicast
M->C: RTSP/1.0 200 OK
Transport: RTP/AVP;multicast;destination=224.2.0.1;port=3456-3457;ttl=16
三、RTP Over RTSP 即TCP
C->S: SETUP uri RTSP/1.0
Transport: RTP/AVP/TCP;interleaved=0-1
S->C: RTSP/1.0 200 OK
Transport: RTP/AVP/TCP;interleaved=0-1
RTP RTCP数据均通过RTSP Socket发送
但这2种数据需要封装 以下摘自RFC2326 10.12
tream data such as RTP packets is encapsulated by an ASCII dollar sign (24 hexadecimal), followed by a one-byte channel identifier,
followed by the length of the encapsulated binary data as a binary,two-byte integer in network byte order. The stream data follows
immediately afterwards, without a CRLF, but including the upper-layer protocol headers. Each $ block contains exactly one upper-layer
protocol data unit, e.g., one RTP packet.
The channel identifier is defined in the Transport header with the interleaved parameter(Section 12.39).