RTSP + NAT... there is some workaround?

About encoding, codec settings, muxers and filter usage
iperich
Blank Cone
Blank Cone
Posts: 19
Joined: 24 May 2006 21:44

RTSP + NAT... there is some workaround?

Postby iperich » 25 Apr 2007 19:56

I am streaming a webcam 2nd vlc stream in a internet server through rtsp. I stream the webcam from a computer in my office to the internet server via udp, and then I stream this via rtsp. I didn't receive anything in my laptop, at home. I have an ADSL connection and I am behind a router. When I open the port 1232 (or whatever I use) in the router, which is the video port, I can see the webcam. Same for the audio.

I understand that this is a NAT problem, but I see there is no NAT support in VLC. Despite this... there is some way to do what I need?
I need any people in any place to see the stream, so I have to consider people who is behind NAT. There is an additional stuff what I can do?
Another software to manage RTP NAT through TCP, or something like that?

Thanks in advice.


iperich.

Teetrinker
Cone that earned his stripes
Cone that earned his stripes
Posts: 174
Joined: 16 Aug 2004 16:12

Postby Teetrinker » 26 Apr 2007 13:17

By reading your description I am not sure if it is really a NAT problem, because if you open the used udp port, the rtp(udp) packets will find the way to the client(player). But how does the NAT router know where to deliver this rtp packets to? What streaming server is used on the internet server? Maybe some one can help you if you discripe your used setup in detail? You could activate "rtp over rtsp" somewhere in the vlc settings in this case the NAT router will know who in your private network asked for packeds from this source. But your internet streaming server have to support the interleaving of the rtp packest over rtsp(is supported by DSS).
If you don't want to use rtp over rtsp, try Osmo4 CVS ( http://gpac.sf.net ) there was recently a NAT Keep Alive feature for rtp(udp) added.

You have to set this settings in the GPAC config file to make sure that UDP is used:

...
[Network]
AutoReconfigUDP=no
UDPNotAvailable=no
...

...
[Streaming]
RTPoverRTSP=no
NATKeepAlive=5000
...

You can find a complete description of the settings in configuration.html which comes with the source.

But you probably already using rtp over rtsp with VLC and your only problem are the closed ports in the routers. If you are using DSS you could try to use (rtp over rtsp) over http. You can change that in the DSS Streaming Admin Server. But you will get a propblem if there is already a http server running.

Hope this helps.
Last edited by Teetrinker on 27 Apr 2007 12:08, edited 1 time in total.

iperich
Blank Cone
Blank Cone
Posts: 19
Joined: 24 May 2006 21:44

Postby iperich » 27 Apr 2007 01:38

I didn´t explain myself clearly....

I configured the router to send the Y port incoming udp packets to MY SPECIFIC IP, and it works...

and in the internet server i´m using VLC this way:

vlc udp://@:1234 --no-audio --sout-rtp-dst="X.X.X.X" --sout-rtp-ttl="127" --sout-rtp-sdp="rtsp://my.streamserver.com:5000/test.sdp" --sout "#transcode:rtp" --sout-transcode-venc="ffmpeg" --sout-transcode-vcodec="mp4v" --sout-transcode-vb="16" --sout-rtp-port-video "Y"

And, as a matter of fact, I´m not quite sure what is the X.X.X.X address... but it works, whatever i put there...

This worked perfectly with vlc streaming the udp incoming stream through mms, but I had a 6,7 sec. delay and it is too much. With rtsp, rtp i have 2 secs of delay, what is perfect. And it have sense for me, mms go over tcp and there are a lot of buffers involved.

Now i´m trying with ffmpeg and ffserver, but I´m a little lost because i never used the software before and i dont know how it works exactly. I think maybe I can do a mms stream faster with ffserver, or maybe another kind of stream, because i can see that rtsp and NAT are not close friends at all. And I know that VLC is not designed to be a realtime stream server.

¿What do you think?

Teetrinker
Cone that earned his stripes
Cone that earned his stripes
Posts: 174
Joined: 16 Aug 2004 16:12

Postby Teetrinker » 27 Apr 2007 11:24

vlc udp://@:1234 --no-audio --sout-rtp-dst="X.X.X.X" --sout-rtp-ttl="127" --sout-rtp-sdp="rtsp://my.streamserver.com:5000/test.sdp" --sout "#transcode:rtp" --sout-transcode-venc="ffmpeg" --sout-transcode-vcodec="mp4v" --sout-transcode-vb="16" --sout-rtp-port-video "Y"

And, as a matter of fact, I´m not quite sure what is the X.X.X.X address... but it works, whatever i put there...
Remove the --sout-rtp-dst="X.X.X.X" part, you don't need it if rtsp is used.
http://www.ietf.org/rfc/rfc2326.txt
C.1.7 Connection Information

In SDP, the "c=" field contains the destination address for the media
stream. However, for on-demand unicast streams and some multicast
streams, the destination address is specified by the client via the
SETUP request. Unless the media content has a fixed destination
address, the "c=" field is to be set to a suitable null value. For
addresses of type "IP4", this value is "0.0.0.0"
This worked perfectly with vlc streaming the udp incoming stream through mms, but I had a 6,7 sec. delay and it is too much. With rtsp, rtp i have 2 secs of delay, what is perfect. And it have sense for me, mms go over tcp and there are a lot of buffers involved.
At the moment I see no solution with vlc as client, if you want to use UDP behind a NAT router. You could make a feature request. Maybe someone is intrested to add something like " NAT Keep Alive" ( http://tools.ietf.org/wg/behave/draft-m ... ive-01.txt )to vlc. I would ask this question in the vlc mailinglist, one of the http://www.live555.com/ developers should be reading this list too. But maybe it is to early for such a feature, because there is only a draft?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 9 guests