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://127.0.0.1:5000
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 -i udp://127.0.0.1:5600 -map 0:0 -c copy -f rtp udp://127.0.0.1:5500
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://127.0.0.1:5000
It seems like neither
ffmpeg is able to detect or connect to an RTP stream using
-i udp://adress:port. Is it supposed to be possible? How?