Is it possible to relay an RTP stream?

by Fredrik Falkman   Last Updated January 13, 2018 17:01 PM

I have a use case where I have camera (on a drone, with a raspberry pi) behind a NAT, a VPS Server with a public IP, and a client behind a NAT where I want to display the video.

The client is running a software called QGroundcontroll which listens for an RTP stream on a local UDP port, usually 5000.

If I run the client on a VPN so it gets a public IP I can get the video across, but the VPN is introducing too much lag. I can demonstrate that by running the following on my drone:

ffmpeg -f lavfi -re -i testsrc -pix_fmt yuv420p -c:v h264 -f rtp udp://my-client-vpn-fixed-ip:5000

Which will give me a nice (but slightly distorted) test picture.

Another test I have done is to run the testsrc directly on my client like so, also successfully:

ffmpeg -f lavfi -re -i testsrc -pix_fmt yuv420p -c:v h264 -f rtp udp://

So now I have worked out this idea about relaying the rtp stream via my VPS.

This is what I have tried:

On the drone (behind NAT):

ffmpeg -f lavfi -re -i testsrc -pix_fmt yuv420p -c:v h264 -f rtp udp://my-virtual-private-server-fixed-ip:5600

On the VPS (Fixed IP, running Debian, thus avconv):

avconv -i udp:// -map 0:0 -c copy -f rtp udp://

On the client (My Mac, behind NAT):

ffmpeg -i udp://my-virtual-private-server-fixed-ip:5500 -map 0:0 -c copy -f rtp udp://

It seems like neither avconv nor ffmpeg is able to detect or connect to an RTP stream using -i udp://adress:port. Is it supposed to be possible? How?


Tags : ffmpeg streaming

Related Questions

How to download RTMP stream from Stanford Math?

Updated September 11, 2016 09:00 AM

Getting error: Unknown encoder 'libvo_aacenc'

Updated October 22, 2015 17:00 PM

Ffmpeg how to limit input fps

Updated November 21, 2017 20:01 PM

Creating MP4 videos ready for HTTP streaming

Updated February 27, 2017 18:01 PM