搭建srs服务器(rtmp)
目录:
- 1、下载srs源码(从码云上):
- 2、 切换到srs.oschina:
- 3、 这里使用3.0版本:
- 4、 切换到trunk:
- 5、 编译:
- 6、 启动:
- 7、查看日志输出:
- 8、使用ffmpeg 推流:
- 9、使用ffplay拉流:
srs(Simple Realtime Server)是一个简单高效的实时视频服务器,支持RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181/RTSP。
1、下载srs源码(从码云上):
git clone https://gitee.com/winlinvip/srs.oschina.git

2、 切换到srs.oschina:
cd srs.oschina

3、 这里使用3.0版本:
git checkout -b 3.0 remotes/origin/3.0release

4、 切换到trunk:
cd trunk

5、 编译:
./configure && make

完成:

6、 启动:
./objs/srs -c conf/rtmp.conf

7、查看日志输出:
使用tail -f ./objs/srs.log

8、使用ffmpeg 推流:
ffmpeg -re -i cctv1.flv -vcodec copy -acodec copy -f flv -y rtmp://服务器ip/live/livestream

9、使用ffplay拉流:
ffplay -x 640 -y 480 rtmp://服务器ip /live/livestream

