標籤:sso builds src dex safari ict number gpo module
下載ffmpeg的Windows靜態版; https://ffmpeg.zeranoe.com/builds/win64/static/
下載nginx-rtmp-windows版:https://github.com/illuspas/nginx-rtmp-win32
解壓
啟動nginx
啟動ffmpeg,開啟ff-prompt.bat
這裡通過將網路攝影機的rtsp流轉成rtmp流和hls流來即時播放
通過rtsp產生rtmp流:
ffmpeg -i "rtsp://admin:[email protected]:554/h264/ch1/main/av_stream" -f flv -r 1 -s 1920x1080 -an "rtmp://192.168.1.205:1935/live/stream"
訪問nginx下的index.html
http://192.168.1.205:8080/index.html
通過flash外掛程式 播放rtmp地址
rtmp://192.168.1.205:1935/live/stream
使用flash的好處就是多瀏覽器支援,雖然chrome,Firefox等瀏覽器都在去外掛程式,但flash外掛程式仍被保留
通過rtsp產生hls
ffmpeg -i "rtsp://admin:[email protected]:554/h264/ch1/main/av_stream" -vcodec libx264 -vprofile baseline -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -s 640x480 -q 10 rtmp://192.168.1.205:1935/hls/video
使用h5 video標籤可直接播放hls地址
但目前支援直接播放hls的僅是Safari瀏覽器
<video src = "http:192.168.1.205:8080/hls/video.m3u8"></video>
hls存在大概60s延時
這個方案實現了即時播放網路攝影機的視頻,但是可能由於機器效能,網路攝影機解析度較高等原因,播放動態視頻總會丟包,導致不清楚
================================
windows下搭建ffmpeg+nginx+rtmp-module搭建即時視頻環境