Docker FFMPEG Bash Shell Program to Build RTSP Live Video Streaming Relay Server in Browser



RTSP stream relay server with codec passthrough, so that no encoding will take place and low CPU will be used.

Any input URL handled by ffmpeg can be used, but keep in mind that no transcoding will take place to the output rtsp stream.

Multiple clients can connect to the same stream.

This is based on ffmpeg, and

Exposed ports:

  • RTSP UDP/TCP listener: 8554
  • RTP UDP listener: 8000
  • RTCP UDP listener: 8001


  • create docker-compose.yml
  • VLC -> File -> Open Network… -> URL “rtsp://localhost:8554/stream” -> Open

  • The restreamed image may appear


  • SOURCE_URL – source media URL to be used as input for RTSP stream. Cannot be empty
  • RTSP_PROXY_SOURCE_TCP – whetever source RTSP stream is UDP (‘no’) or TCP (‘yes’). defaults to no
  • STREAM_NAME – path for “rtsp://[host]:[port]/[STREAM_NAME]. default to ‘stream’
  • FORCE_FFMPEG_SOURCE – use RTSP proxy when in/out (false) are RTSP streams or force to use FFMPEG restream even in this case (true). defaults to false. use for CPU usage comparisons
  • FFMPEG_ARGS – additional arguments to ffmpeg publisher. ex: “-err_detect aggressive -fflags discardcorrupt”
  • FFMPEG_INPUT_ARGS – ffmpeg args applied near input params. ex.: ‘-v 10’. defaults to ”
  • FFMPEG_OUTPUT_ARGS – ffmpeg args applied near output params. ex.: ‘-vcodec h264’. defaults to ‘-c copy’ so that no transcoding will be done by default.


  • If you wish to create an RTSP feed from a video file in loop

    • Place the video file in directory ‘samples’

    • Create docker-compose.yml:

Leave a Reply