標籤: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的安裝與簡單使用