rtp over rtsp (TCP)

来源:互联网 发布:js递归函数的例子 编辑:程序博客网 时间:2024/06/04 18:37

1. RTCP and rtp (udp)

by default, ffmpeg setup connection to server by rtsp with udp protocol.

for example

                              server_port                    transport_protocol                       client_port

rtsp (session):   554                                  tcp                                                   51703

rtcp (sr, rr):          6973 (sr=>client)          udp (<=>)                                       10379(rr=>server)

rtp (data):            6972                                udp(<=>)                                        10378


Therefore, as far as this case, there exists three connections between server and client.

The rtsp session is by tcp, and rtcp, rtp by udp.


ffmpeg sends receiver report in about one second interval. (44bytes)

vlc sends receiver report in about 5 seconds interval. (60 bytes)


some producter send sender report in about 5 seconds interval. (48bytes)


2. rtp over rtsp (tcp)


by default, ffmpeg setup rtp by rtsp with udp (both for rtcp and rtp),

if the network status is unstable, it will cause that ffmpeg send

pause, then setup, play to resetup connection to server by rtp

over rtsp (tcp).  As far as this case, all datas will convey by rtsp

connection, include rtcp(sender report, receiver report) and rtp (data).

Therefore, there is only one connection between server and client,

by tcp. and the server port is 554 by default.


vlc send receiver report in about 6 seconds interval. (60 bytes)

some producter send sender report in about 7~8 seconds interval. (48bytes)

ffmpeg don't send sender report in this case. 


as far as rtp over rtsp (TCP), generally, channel 0 for rtp(data),  channel 1 for rtcp(sr, rr)


3. dss

for dss, if vlc play with string rtsp://192.168.137.66:8000/test.mov

the dss will use udp transfer data (both rtp, rtcp), not packetized with rtp.

if vlc play with string rtsp://192.168.137.66/test.mov, the dss will 

work with rtp(rtcp) on udp.