澳门银河网上官方赌场_老品牌值得信赖

ITKeyword,专注技术干货聚合推荐

注册 | 登录

android - RTSP, RTCP and RTP port numbers

itPublisher 分享于

2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1062

2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址https://www.aliyun.com/minisite/goods

推荐:RTP/RTCP/RTSP协议

描述:协议关系图 图片: 一.产生的背景 随着互连网的发展,人们已经不满足于传统的HTTP,FTP和电子邮件等文本信息和服务,而对内容丰富多彩的多媒体信息,服务

I'm trying to understand how spydroid (https://code.google.com/p/spydroid-ipcamera/) works so I can write a similar app for my phone. Based off of spydroid here is what I understand about RTSP, RTCP and RTP.

RTSP runs on a specified port and sets everything up.

RTCP can run on any port. There is a client port and a server port. This is the control flow for RTP

RTP can run on any port. There is a client port and a server port. This contains the streams for audio and video. This is confusing because it seems it doesn't actually send the audio and video on this port. In spydroid it sends the video on port 5006 and the audio on 5004.

Spydroid is sending this message via RTSP to confirm the ports... Transport: RTP/AVP/UDP;unicast;destination=123.456.789.00;client_port=65234-65235;server_port=44580-44581;ssrc=ba98a863;mode=play

I think what this is saying is that the client (VLC in my case) is listening on 65234 using UDP for RTP and 65235 for RTCP messages. Also spydroid is listening on 44580 for RTP and 44581 for RTCP. Is this right?

Now in the DESCRIBE sequence for RTSP, spydroid is telling the client m=video 5006 RTP/AVP 96 I think this is saying that it will be sending the video via UDP over port 5006.

Does everything I said in the above sentences sound correct?

What I really want to know is how to forward this information to the correct ports. The client ports are auto assigned by VLC. I tried running this command... vlc "rtsp://192.168.1.104:8086" --rtp-client-port=58866 but VLC seems to ignore it and pick it's own ports. So I have forwarded ports 8086, 5004 and 5006 but I don't know which port to forward for the RTP and RTCP connection because it changes every time. The only way I can make this work is by forwarding all ports to my computer. (I have a linksys router and it has a DMZ option) But this is a bad solution. Can someone please guide me in the right direction.

Also it is good to know that I am doing this because I am sending everything through an external IP address over the internet. Where as spydroid is intended to be used on a local area network.

android rtsp rtp portforwarding rtcp
|
  this question
asked Apr 14 '13 at 19:37 rickster 305 1 8 22

 | 

2 Answers
2

I don't know how RTSP works and how to configure VLC but I know a thing or 2 about RTP. I am guessing that client port means where the spydroid would be sending packets and server port is what it would be using as source port. So at UDP level, RTP packet would look like:

| SRC_PORT=44580 | DST_PORT=65234 | ... RTP_PACKET |

Next : m=video 5006 RTP/AVP 96 According to SDP standard 5006 is the port where spydroid would be listening on for incoming RTP packets (not sure why) and the RTP payload type would be 96.

So, check if making VLC listen to port 65234 and forwarding {44580, 65234} packets to your PC works. The info you gave is a little confusing and seems self contradictory. So, can't conclude anything concrete based on that.


|
  this answer
answered Nov 28 '14 at 7:10 tan 36 5

 | 

According to the SDP standard...

Actually it indicates the source port.

The port (range) just indicates that is where the media will be sent from.

E.g if your source sends on 5006 but its routed via 10002 that's where rtsp helps Via the transport header.

The source port may really be 5006 but an intermediate router or firewall that is somewhere inside the LAN received the packet and sent it via another port and address.

Most software doesn't automatically know about your network setup and thus without modifying the sdp for external network use it cant really be used anywhere outside of YOUR network address space.

If you needed the port to match it can you just have to manually configure your sockets and software. (E.g. multicast or otherwise there's a few reasons why that port (range) needed to be different from what's in the rtsp transport header but if it is... then now you understand how and why.

Live 555 and some others send a probe packet and if that packet is returned via icmp the source port is reset to 0 so it can be discovered,be aware that this can conflict with existing traffic from the host if not done correctly.

QuickTime and vlc actually screw this up (mostly everyone does)and allow injection straight to the decoder from any port from the same host when 0 is used and ffmpeg and lav don't support ranges properly in the media port.

Just as excersize in thought, what if the port number was 1 or 65536 or * or -7?

Should that not also be handled?

What if the range was * or - or otherwise?

Remember that just because a value doesnt exists doesn't mean that you can't do the right thing with respect to the existing information if desired Even if the data received is not as expected Or indicated a value which should not be used.


|
  this answer
edited Feb 19 '15 at 22:58 community wiki
2 revs
Jay

 | 

推荐:RTP/ RTSP/ RTCP/SIP

RTP (Real-time Transport Protocol)是用于Internet上针对多媒体数据流的一种传输协议。RTP被定义为在一对一或一对多的传输情况下工作。其目的是提供时间信息和


相关阅读排行


相关内容推荐

最新文章

×

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。

澳门银河网上官方赌场