Simple Rtmp Server的安裝與簡單使用

來源:互聯網
上載者:User

標籤:linux   rtmp   hls   server   流媒體伺服器   

  Simple Rtmp Server是一個國人編寫的開源的RTMP/HLS流媒體伺服器. 功能與nginx-rtmp-module類似, 可以實現rtmp/hls的分發.

  有關nginx-rtmp-module的可參照: http://blog.csdn.net/redstarofsleep/article/details/45092147

  編譯與安裝過程十分的簡單

 

  ./configure --prefix=/usr/local/srs --rtmp-hls  make  make install
  標準的三條命令就可完成安裝. --rtmp-hls表示開啟rtmp和hls, 其它的編譯參數可通過./configure -h查看.


  安裝完後,目錄下有三個檔案夾conf, etc, objs. 我們常用的是conf和objs兩個目錄下的內容, conf下是各類設定檔的例子, objs下是可執行檔.

  啟動伺服器是通過-c參數指定一個設定檔即可

  ./objs/srs -c conf/hls.conf
 

  如果是hls的話,設定檔大概是這樣的:

# the config for srs to delivery hls# @see https://github.com/winlinvip/simple-rtmp-server/wiki/v1_CN_SampleHLS# @see full.conf for detail config.listen              1935;max_connections     1000;vhost __defaultVhost__ {    hls {        enabled         on;        hls_path        /usr/local/nginx/html;        hls_fragment    10;        hls_window      60;    }}

  其中的hls_path是存放hls分區ts檔案和m3u8的目錄, 我上面的例子中把它指定到nginx下.這樣就可以直接播放hls視頻流了.

  如果是ffmpeg推送,那是和nginx-rtmp-module是一樣的:

ffmpeg -re -i "D:\download\film\aqgy\02.mp4" -vcodec libx264 -vprofile baseline -acodec aac   -ar 44100 -strict -2 -ac 1 -f flv -s 1280x720 -q 10 rtmp://server:1935/  myapp/test1

  總體來說這個SimpleRtmpServer在配置使用上沒有什麼難度,基本都是參照nginx-rtmp-module的.


  轉載請註明出處

  http://blog.csdn.net/redstarofsleep

Simple Rtmp Server的安裝與簡單使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.