Skip to content

nitish052002/VideoStreamingDashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ₯ Multi-View Video Streaming Dashboard

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 β†’ HLS Conversion Flow

RTSP Camera
     ↓
MediaMTX (RTSP Server)
     ↓
Node.js Backend (FFmpeg Workers)
     ↓
6Γ— HLS Streams (.m3u8)
     ↓
React Video Player Grid

πŸš€ Features

πŸ” RTSP β†’ HLS Conversion

Converts an RTSP live feed into HLS (*.m3u8) playlists.

Streams are continuously updated and segmented.

Supports low-latency configuration and auto-cleanup.

πŸ”€ 6 Simulated HLS Streams

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.m3u8

Each stream is generated using FFmpeg in parallel.

πŸŽ› React Multi-View Dashboard

Displays all 6 streams in a responsive grid (2Γ—3 layout).

Uses hls.js for smooth HLS playback in browsers.

Automatically attempts playback synchronization.

βš™οΈ Synchronization Logic

Ensures each player:

Waits until metadata is loaded.

Seeks all players to the same timestamp.

Plays simultaneously with near-zero drift.

🌐 Backend Streaming Server

Built with Node.js + Express

Runs 6 FFmpeg processes to continuously generate HLS.

Exposes /streams/* for public access.

🧩 Architecture Overview

        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚        RTSP Source       β”‚
        β”‚  (camera / MediaMTX)     β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
               FFmpeg (Γ—6)
                      β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚     HLS Streams (6x)           β”‚
       β”‚ stream1/stream.m3u8            β”‚
       β”‚ stream2/stream.m3u8            β”‚
       β”‚ ...                            β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
               React Dashboard
                      β”‚
               hls.js Video Players

πŸ›  Tools Used

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 β†’ HLS Conversion Process

  1. RTSP Input

A single RTSP URL is used:

rtsp://13.60.76.79:8554/live3
  1. 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.m3u8

This 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.m3u8

🧠 How Synchronization Works

Each video player:

  1. Loads but does NOT auto-play
  2. Once all 6 players fire loadedmetadata

We fetch the latest timestamp among all players.

  1. Seek all players to that timestamp

Ensures equal start point.

  1. Call play() on all players simultaneously.

This results in near-perfect alignment across 6 video players.

πŸ–₯ React Frontend

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

πŸš€ Setup & Installation

πŸ”§ 1. Clone Repository

git clone https://github.com/yourusername/VideoStreamingDashboard
cd VideoStreamingDashboard

πŸ–₯ Backend Setup

Install dependencies

cd Backend
npm install

Create .env

RTSP_URL=rtsp://your-camera-url
PORT=5000

Run backend

Development:

npm start

Production:

node server.js

Your backend will run at:

http://localhost:5000

HLS streams will be available at:

http://localhost:5000/streams/stream1/stream.m3u8
...
http://localhost:5000/streams/stream6/stream.m3u8

🎨 Frontend Setup

Go to frontend folder:

cd Frontend

npm install

Start app:

npm start 

Frontend runs at:

http://localhost:3000

🌍 Deployment Guide

Backend Deployment (Render)

Choose Web Service

  • Root Directory: Backend

  • Build Command: npm install

  • Start Command: npm start

  • Set environment variables if using .env

Frontend Deployment (Vercel)

  • Import GitHub repo

  • Root Directory: Frontend

  • Build Command: npm run build

  • Output Directory: build

πŸ‘‰ (Render + Netlify)

βœ“ Backend (Node.js) – Render

Live URL:

βœ“ Frontend (React) – Netlify

Live URL:



πŸ› οΈ Tech Stack

🎨 Frontend



βš™οΈ Backend



πŸ“Έ Screenshot

App Screenshot

🎯 Features Overview

- πŸ”΄ Real live RTSP camera streaming

- 🎬 Automatic RTSP β†’ HLS conversion

- 🎞️ Six synchronized video players

- ⚑ Low-latency 2-second HLS

- πŸ“¦ Easy deployment on Render

- πŸ’» Fully responsive grid layout



πŸŽ–οΈ Author

πŸ‘¨β€πŸ’» Nitish Sharma

Full-Stack & Frontend Developer

About

A complete Video Streaming Platform with a modern dashboard UI. Frontend built with React + TypeScript + Tailwind, backend powered by Node.js/Express, and streaming handled using FFmpeg + MediaMTX. Supports uploading, encoding, HLS streaming, and dynamic thumbnail previews

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors