Skip to content

DinethDilhara/analog2webrtc-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analog-to-WebRTC Simulator

Simulated multi-camera DVR system. Inputs: MP4 files. Outputs: RTSP, HLS, WebRTC via MediaMTX.

Prerequisites

  • Docker + docker-compose
  • Local ports open: 8554 (RTSP), 8888 (HLS), 8889 (WebRTC), 8189/udp (ICE)

Real DVR vs Simulation

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

Components

  • MediaMTX: unified media server
  • cam1..cam4: ffmpeg publishers looping files in ./videos
  • Paths: cam1, cam2, cam3, cam4

Architecture

Real vs Simulation Flow

Run

Start services:

docker compose up --build

Stop and remove:

docker compose down -v

Endpoints

RTSP (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/

Notes

  • Looped playback via -stream_loop -1.
  • ./videos is mounted read-only.
  • HLS root (http://localhost:8888/) returns 404; use playlist URLs.
  • Replace localhost with host IP for LAN clients; open firewall ports.
  • For recording or auth, extend mediamtx.yml using upstream sample config.
  • For recording or auth, extend mediamtx.yml using upstream sample config.

About

Simulated multi-camera surveillance system using RTSP and WebRTC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published