windows下搭建ffmpeg+nginx+rtmp-module搭建即時視頻環境

來源:互聯網
上載者:User

標籤: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"
  • 1

訪問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
  • 1

使用h5 video標籤可直接播放hls地址 
但目前支援直接播放hls的僅是Safari瀏覽器

<video src = "http:192.168.1.205:8080/hls/video.m3u8"></video>
  • 1

hls存在大概60s延時

這個方案實現了即時播放網路攝影機的視頻,但是可能由於機器效能,網路攝影機解析度較高等原因,播放動態視頻總會丟包,導致不清楚

================================ 

windows下搭建ffmpeg+nginx+rtmp-module搭建即時視頻環境

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.