Video streams can be exposed in several forms of protocol.
One of them is rtsp
for Real Time Streaming Protocol.
This project makes it easy to generate a rstp
stream out of an mp4 video.
- Clone this repo
git clone git@github.com:fpaupier/mp42rtsp.git
- Place the video you want to stream under the
video/
dir.
video
└── input.mp4
- Edit your environment variable to adjust the port on which to stream over rtsp
cp .env.example .env
vim .env # Edit the values of RTSP_PORT and INPUT_VIDEO
- Start the container to stream your video
docker-compose up -d
Your stream is now available at rtsp://YOUR-HOST-IP:RTSP_PORT/streamer.mpeg4 You can test it with your favorite stream player!
(Your public ip is available by doing curl ifconfig.io
)
- On UNIX you can use the
ffplay
utils (bundled with ffmpeg)
ffplay "rtsp://YOUR-HOST-IP:RTSP_PORT/streamer.mpeg4"
- On iOS you can also play your stream using the VLC app available
- Thanks to this ffmpeg doc for inspiration of this project
- The input video provided under
video/input.mp4
in this repository is available for free on file-examples.com, video retrieved on Jan 22 2022 from url https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4