RTSP β HLS Conversion | 6-Stream Simulation | Synchronized React Player | FFmpeg + MediaMTX + Node.js Backend
This project is a multi-view monitoring dashboard that converts a single RTSP source into multiple HLS streams, then displays them in a synchronized 6-player grid built using React.
The dashboard layout is inspired by:
π https://monitor.theun1t.com/
RTSP Camera
β
MediaMTX (RTSP Server)
β
Node.js Backend (FFmpeg Workers)
β
6Γ HLS Streams (.m3u8)
β
React Video Player GridConverts an RTSP live feed into HLS (*.m3u8) playlists.
Streams are continuously updated and segmented.
Supports low-latency configuration and auto-cleanup.
From one RTSP source, 6 independent HLS streams are created:
stream1/stream.m3u8
stream2/stream.m3u8
stream3/stream.m3u8
stream4/stream.m3u8
stream5/stream.m3u8
stream6/stream.m3u8Each stream is generated using FFmpeg in parallel.
Displays all 6 streams in a responsive grid (2Γ3 layout).
Uses hls.js for smooth HLS playback in browsers.
Automatically attempts playback synchronization.
Ensures each player:
Waits until metadata is loaded.
Seeks all players to the same timestamp.
Plays simultaneously with near-zero drift.
Built with Node.js + Express
Runs 6 FFmpeg processes to continuously generate HLS.
Exposes /streams/* for public access.
ββββββββββββββββββββββββββββ
β RTSP Source β
β (camera / MediaMTX) β
βββββββββββββββ¬βββββββββββββ
β
FFmpeg (Γ6)
β
ββββββββββββββββΌββββββββββββββββββ
β HLS Streams (6x) β
β stream1/stream.m3u8 β
β stream2/stream.m3u8 β
β ... β
ββββββββββββββββ¬ββββββββββββββββββ
β
React Dashboard
β
hls.js Video Players
FFmpeg
Used to convert RTSP into multiple HLS stream outputs.
MediaMTX (optional)
Used as RTSP server to feed RTSP β HLS conversion.
Node.js Backend
Spawns FFmpeg processes
Serves HLS files via static hosting
React + hls.js
Frontend UI
HLS playback support
Synchronization logic
- RTSP Input
A single RTSP URL is used:
rtsp://13.60.76.79:8554/live3- FFmpeg Processing
Each FFmpeg instance generates one HLS playlist with:
Segment length: 2 sec
Playlist size: 6 segments
Auto-delete old segments using hls_flags=delete_segments
Example FFmpeg command:
ffmpeg -rtsp_transport tcp -i rtsp://localhost:8554/live \
-c:v copy -c:a copy \
-f hls -hls_time 2 -hls_list_size 6 -hls_flags delete_segments \
Backend/streams/stream1/stream.m3u8This runs 6 times to create 6 separate HLS streams.
π¦ Backend Directory Structure
Backend/
β server.js
β package.json
β sample.mp4 (optional local input)
β
βββ streams/
βββ stream1/stream.m3u8
βββ stream2/stream.m3u8
βββ stream3/stream.m3u8
βββ stream4/stream.m3u8
βββ stream5/stream.m3u8
βββ stream6/stream.m3u8Each video player:
- Loads but does NOT auto-play
- Once all 6 players fire loadedmetadata
We fetch the latest timestamp among all players.
- Seek all players to that timestamp
Ensures equal start point.
- Call play() on all players simultaneously.
This results in near-perfect alignment across 6 video players.
Technologies:
React (functional components)
hls.js
Tailwind CSS
Layout:
Responsive CSS grid (2Γ3 or 3Γ2)
Auto resizes on different screen sizes
Real-time synchronization
git clone https://github.com/yourusername/VideoStreamingDashboard
cd VideoStreamingDashboardcd Backend
npm installRTSP_URL=rtsp://your-camera-url
PORT=5000npm startnode server.jsYour backend will run at:
http://localhost:5000HLS streams will be available at:
http://localhost:5000/streams/stream1/stream.m3u8
...
http://localhost:5000/streams/stream6/stream.m3u8Go to frontend folder:
cd Frontend
npm installStart app:
npm start Frontend runs at:
http://localhost:3000Choose Web Service
-
Root Directory:
Backend -
Build Command:
npm install -
Start Command:
npm start -
Set environment variables if using .env
-
Import GitHub repo
-
Root Directory:
Frontend -
Build Command:
npm run build -
Output Directory:
build
Live URL:
Live URL:
Full-Stack & Frontend Developer