RTSP Webcam to HLS Live Streaming using FFMPEG and XAMPP | PART 1
Andy Fordham Andy Fordham
1.73K subscribers
41,810 views
0

 Published On Dec 2, 2020

A "quick" 30 minute real time walkthrough in how to set up an RTSP to HLS live streaming setup using FFMPEG and XAMPP on a local network using Windows 10. The files referred to in the video are attached and pasted below in the description ( press see more).

PART2 Will cover the additional options in ffmpeg and introduce how to link an external domain to the webserver we have set up using port forwarding.

PART 2 HERE ...   • PART 2 | Webserver using NO-IP DDNS f...  

The camera used is a DLink 2132 IP Camera.

Once set up, then a public ip can be port forwarded to the server machine to allow for public viewing.

html code .. video.htm
https://pastebin.com/cWyXKYqn

ffmpeg code (change as needed to suit your setup):

ffmpeg -v verbose -i rtsp://admin:@192.168.1.30/live1.sdp -vf scale=1920:1080 -vcodec libx264 -r 25 -b:v 1000000 -crf 31 -acodec aac -sc_threshold 0 -f hls -hls_time 5 -segment_time 5 -hls_list_size 5 C:\webpages\video\stream.m3u8

To automatically restart the ffmpeg instruction in the batch file if it fails (if the camera disconnects) then add the following command before and after the ffmpeg instruction. This will then restart ffmpeg every time it may fail.


####### WEBCAM.BAT ########

@echo off
:start
del *.ts
FFMPEG INSTRUCTION ABOVE GOES HERE!
goto start

END OF WEBCAM.BAT FILE ###


Hope it helps, that should give a pretty reliable restarting ffmpeg stream.
Streaming an IP Camera to a Web Browser using FFmpeg

show more

Share/Embed