流媒體 Ubuntu部署srs、windows部署nginx


一、獲取項目
//碼雲克隆
git clone https://gitee.com/winlinvip/srs.oschina.git srs
//github
git clone https://github.com/ossrs/srs.git
二、進入trrunk
cd trunk
三、編譯
./configure && make
五、啟動(指定配置文件)
./objs/srs -c conf/srs.conf
配置文件默認配置:
# main config for srs.
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;
http_api {
    enabled         on;
    listen          1985;
}
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}
stats {
    network         0;
    disk            sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
}

六、ffmpeg推流測試

1、推流本地視頻

ffmpeg.exe -re -i demo.wmv -f flv rtmp://127.0.0.1:1935/live/123

2、推流攝像頭

  2.1、查看攝像頭

  ffmpeg -list_devices true -f dshow -i dummy 

  2.2、推流

  ffmpeg -f dshow -i video="devicesname" -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -f flv rtmp://127.0.0.1:1935/live/123
七、ffplay驗證
ffplay "rtmp://127.0.0.1:1935/live/123"
 
八、windows部署nginx
1、下載支持rtmp的nginx
  1.1、下載可用的nginx
  url:http://nginx-win.ecsds.eu/download/nginx%201.7.11.3%20Gryphon.zip
  1.2下載rtmp模塊解壓后放在nginx.exe的同級目錄
  https://codeload.github.com/arut/nginx-rtmp-module/zip/master
2、配置nginx
詳情:https://blog.csdn.net/defonds/article/details/9274479/
rtmp {
    server {
        listen 1935;
        chunk_size 4096;
        application live {
            live on;
        }
    }
}

3、啟動nginx,cmd進入nginx目錄

 nginx.exe -c conf\nginx-win.conf


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM