SRS is a RTMP/HLS/WebRTC/SRT/GB28181 streaming cluster, high efficiency, stable and simple.
SRS定位是运营级的互联网直播服务器集群,追求更好的概念完整性和最简单实现的代码
1)SRS提供了丰富的接入方案将RTMP流接入SRS, 包括推送RTMP到SRS、推送RTSP/UDP/FLV到SRS、拉取流到SRS
2)SRS还支持将接入的RTMP流进行各种变换,譬如将RTMP流转码、流截图、 转发给其他服务器、转封装成HTTP-FLV流、转封装成HLS、 转封装成HDS、转封装成DASH、录制成FLV/MP4
3)SRS包含支大规模集群如CDN业务的关键特性, 譬如RTMP多级集群、源站集群、VHOST虚拟服务器 、 无中断服务Reload、HTTP-FLV集群
4)此外,SRS还提供丰富的应用接口, 包括HTTP回调、安全策略Security、HTTP API接口、 RTMP测速。
5)SRS在源站和CDN集群中都得到了广泛的应用
GitHub地址:https://github.com/ossrs/srs
https://github.com/ossrs/srs/archive/v3.0-r0.tar.gz
tar -zxvf srs-3.0-r0.tar.gz
cd srs-3.0-r0/trunk/
./configure
make
make install
ln -sf /usr/local/srs/etc/init.d/srs /etc/init.d/srs
cp -f /usr/local/srs/usr/lib/systemd/system/srs.service /usr/lib/systemd/system/srs.service
systemctl daemon-reload
systemctl enable srs
systemctl start srs
这里为了方便起见就不采用源码方式编译安装ffmpeg了,直接使用rpmfusion源安装ffmpeg 具体命令如下
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install epel-release
wget https://mirrors.aliyun.com/rpmfusion/free/el/rpmfusion-free-release-7.noarch.rpm
rpm -ivh rpmfusion-free-release-7.noarch.rpm
yum install ffmpeg
ffmpeg -re -i /data/TenetTrails.mp4 -vcodec copy -acodec copy -f flv -y rtmp://192.168.31.80/live/livestream
上传TenetTrails.mp4文件到服务器,ffmpeg -re -i /data/TenetTrails.mp4 -vcodec copy -acodec copy -f flv -y rtmp://192.168.31.80/live/livestream进行推流
RTMP流地址为 rtmp://192.168.31.80/live/livestream
先停止systemctl stop srs 需要单独启动srs,只加载hls.conf
./objs/srs -c conf/hls.conf
当然你也可以将hls配置文件添加到srs.conf 接下来使用FFMPEG命令推流
ffmpeg -re -i /data/TenetTrails.mp4 -vcodec copy -acodec copy -f flv -y rtmp://192.168.31.80/live/livestream
VLC打开网络串流 HLS流地址为 http://192.168.31.80:8080/live/livestream.m3u8
iftop -i ens33 -N -n -m 10M -P
更多用法参考官方wiki
链接如下https://github.com/ossrs/srs/wiki
本文分享自 WalkingCloud 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有