編譯:
參考:
https://github.com/ossrs/srs#usage
git clone https://gitee.com/winlinvip/srs.oschina.git srs && cd srs/trunk && git remote set-url origin https://github.com/ossrs/srs.git && git pull
./configure && make
運行srs接收推流:
推流的配置參考:
https://github.com/ossrs/srs/wiki/v3_CN_SampleRTMP
發現源碼下面就有默認配置,直接用
./objs/srs -c conf/rtmp.conf
[2021-02-05 16:51:25.543][Trace][25093][00a0uw39] XCORE-SRS/4.0.67(Leo)
[2021-02-05 16:51:25.543][Trace][25093][00a0uw39] config parse complete
[2021-02-05 16:51:25.543][Trace][25093][00a0uw39] you can check log by: tail -f ./objs/srs.log (@see https://github.com/ossrs/srs/wiki/v1_CN_SrsLog)
[2021-02-05 16:51:25.543][Trace][25093][00a0uw39] please check SRS by: ./etc/init.d/srs status
根據提示可以用對應的命令查看日志和狀態
使用FFMPEG命令推流:
for((;;)); do \ ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \ -vcodec copy -acodec copy \ -f flv -y rtmp://192.168.1.170/live/livestream; \ sleep 1; \ done
觀看RTMP流, 拉流。
詳細參考RTMP分發
RTMP流地址為:
rtmp://192.168.1.170/live/livestream
下載安裝VLC,
媒體->打開網絡串流->輸入網絡URL
參考:
https://www.cnblogs.com/Pan-xi-yi/p/11970135.html