Local RTSP server configuration in 1 minute

Lets setup a RTSP server which will take local video file as a source and stream as RTSP in loop mode. Its output can be viewed in VLC player.

Click here to view the demo video

Requirements:

A video file, RTSP-SIMPLE-SERVER, FFMPEG, VLC Player.

To make the work more simpler, Wrote a bat script to launch everything in a snap. Save this code as “StartServer.bat”

@echo off
REM Check if ffmpeg is available
ffmpeg -version >nul 2>&1
if %errorlevel% neq 0 (
echo FFmpeg is not installed or not found in PATH.
exit /b 1
)

REM Start the RTSP caster
start "RTSP Server" cmd /c "mediamtx"
timeout /t 3 /nobreak >nul

REM Start the FFMPEG piping
start "FFmpeg" cmd /c "ffmpeg -re -stream_loop -1 -i <your_video>.mp4 -c:v copy -c:a copy -f rtsp rtsp://localhost:8554/mystream"
timeout /t 3 /nobreak >nul

REM Start VLC
start "VLC" vlc

In VLC Player, Press CTRL+N and rover to “Network” tab and paste this link rtsp://localhost:8554/mystream and click enter and it will start streams.

Thanks for reading !.

--

--