通常, IP 相机以 RTSP 协议传输视频。但浏览器无法呈现此格式,因此我们需要将其转换为 HLS 格式,以便现代浏览器可以显示。
通常, IP 相机以 RTSP 协议传输视频。但浏览器无法呈现此格式,因此我们需要将其转换为 HLS 格式,以便现代浏览器可以显示。
TP-Link C200 model the URL I used = rtsp://{username}:{password}@{ip}:554/stream1Execute FFMPEG command
.\server\libs\ffmpeg.exe -i rtsp://{username}:{password}@{ip}:554/stream1 -fflags flush_packets -max_delay 5 -flags -global_header -hls_time 5 -hls_list_size 3 -vcodec copy -y .\videos\ipcam\index.m3u8
After successful execution, we should see the converted video files (index.m3u8 *.ts)
npm install.ts files.\node_modules\.bin\nodemon .\cleaner.js.ts files from local directory to save the space.\node_modules\.bin\nodemon .\hls-server.jscookpete.com/react-player.Loadclient\hls-client foldernpm installnpm startIt is possible to automate all of the commands under simplified npm start command in server project. However, for better understanding of how things work and better clarity, I break down the steps and showed how easy it is to actually stream your IP Camera to your browser.
If you have real IP from your ISP, you can point your Domain to your IP and see the camera feed from anywhere in the world through the browser.
暂无开放 Issues,或尚未同步最近议题。