This is information for how to forward a video stream from an RTSP server to another RTSP server with an Android smartphone. For demo purposes it uses the MacOS webcam to create a RTSP stream which is forwarded to a cloud hosted RTSP server
- Macbook with webcam, ffmpeg and ffplay installed.
- Docker.
- Android phone with app FFmpegui installed & configure to use the built-in binary.
- Cloud docker container hosting (Azure ACI, AWS ECS, etc)
Create a cloud hosted docker container for the image aler9/rtsp-simple-server and expose port 8554 TCP to the public.
Note down the public DNS name / IP address.
On your macbook, create an RTSP server.
docker run --rm -it -e RTSP_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 aler9/rtsp-simple-server
On your macbook, send your webcam video to the RTSP server
ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" -preset ultrafast -tune zerolatency -f rtsp rtsp://localhost:8554/test
On your Android, open FFmpegui and run:
ffmpeg -i rtsp://<MAC_IP_ADDRESS>:8554/test -framerate 30 -video_size 640x480 -preset ultrafast -tune zerolatency -f rtsp rtsp://<CLOUD_RTSP_SERVER_IP>:8554/test
Check the stream is getting to the cloud RTSP server by running:
ffplay -fflags nobuffer -flags low_delay -framedrop -strict experimental rtsp://<CLOUD_RTSP_SERVER_IP>:8554/test