编译:
参考:
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