Simulated multi-camera DVR system. Inputs: MP4 files. Outputs: RTSP, HLS, WebRTC via MediaMTX.
- Docker + docker-compose
- Local ports open: 8554 (RTSP), 8888 (HLS), 8889 (WebRTC), 8189/udp (ICE)
Real flow:
- Analog cameras → DVR encoder → RTSP streams
- Gateway converts RTSP to WebRTC/HLS for browsers
Simulation flow:
- Four MP4 files act as cameras
- FFmpeg loops and pushes RTSP to MediaMTX
- MediaMTX exposes RTSP, generates HLS on demand, serves WebRTC pages
- MediaMTX: unified media server
- cam1..cam4: ffmpeg publishers looping files in
./videos - Paths:
cam1,cam2,cam3,cam4
Start services:
docker compose up --buildStop and remove:
docker compose down -vRTSP (VLC / ffplay):
rtsp://localhost:8554/cam1
rtsp://localhost:8554/cam2
rtsp://localhost:8554/cam3
rtsp://localhost:8554/cam4
HLS playlists:
http://localhost:8888/cam1/index.m3u8
http://localhost:8888/cam2/index.m3u8
http://localhost:8888/cam3/index.m3u8
http://localhost:8888/cam4/index.m3u8
WebRTC pages:
http://localhost:8889/cam1/
http://localhost:8889/cam2/
http://localhost:8889/cam3/
http://localhost:8889/cam4/
- Looped playback via
-stream_loop -1. ./videosis mounted read-only.- HLS root (
http://localhost:8888/) returns 404; use playlist URLs. - Replace
localhostwith host IP for LAN clients; open firewall ports. - For recording or auth, extend
mediamtx.ymlusing upstream sample config. - For recording or auth, extend
mediamtx.ymlusing upstream sample config.