/mp42rtsp

A dockerized service to expose mp4 videos as rtsp sreams

Primary LanguageShellMIT LicenseMIT

Generate a rtsp video stream from an mp4 video

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.

Getting started

  1. Clone this repo
git clone git@github.com:fpaupier/mp42rtsp.git
  1. Place the video you want to stream under the video/ dir.
video
└── input.mp4
  1. 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
  1. 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

Credits