搭建环境:推荐centos7,ubuntu稳定性差一点
参考资料:https://ossrs.net/releases/,https://github.com/ossrs/srs/wiki/v4_CN_Home#getting-started
SRS服务搭建
git clone -b 4.0release https://gitee.com/ossrs/srs.git#克隆源码
cd srs/trunk#cd到trunk目录
./configure
make
./objs/srs -c conf/srs.conf#启动服务
./etc/init.d/srs status#查看SRS的状态,或访问http://localhost:8080/ 查看
centos7安装chrome浏览器
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm#下载rpm包
sudo yum install liberation-fonts#安装依赖
sudo yum install vulkan #安装依赖
sudo rpm -ivh google-chrome-stable_current_x86_64.rpm#安装rpm包
google-chrome#启动浏览器
使用ffmpeg推拉流
ffmpeg安装:linux下ffmpeg安装
ffmpeg -re -i ./doc/source.flv -c copy -f flv rtmp://localhost/live/livestream#推流
ffplay rtmp://192.168.72.66/live/livestream#使用ffplay拉流
效果图
使用SRS网页播放器拉流
chrome浏览器访问网页:http://192.168.72.66:8080/players/srs_player.html
选择SRS播放器,输入URL: http://localhost:8080/live/livestream.flv,播放视频即可
效果图