我学这个花两天,你学只需一小时,看着办吧
1.安装ffmpeg源
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
2.安装常用工具,srs依赖
yum install -y wget lrzsz zip unzip vim
yum install -y epel-release redhat-lsb
yum install -y ffmpeg ffmpeg-devel #yum源质量不好有点慢忍耐一下吧
3.下载安装包(https://github.com/ossrs/srs/tree/4cb8de3029b4a0f1b2578def6be7771b926ddfa9)
wget https://github.com/ossrs/srs/tree/4cb8de3029b4a0f1b2578def6be7771b926ddfa9
4.安装SRS
unzip SRS-CentOS6-x86_64-2.0.263.zip
cd SRS-CentOS6-x86_64-2.0.263
sudo bash INSTALL
5.编辑配置文件
cd /usr/local/srs/conf
vim /usr/local/srs/conf/srs.conf
在 vhost defaultVhost内部加如下配置
vhost __defaultVhost__ {
ingest live-02 {
enabled on;
input {
type stream;
url rtmp://58.200.131.2:1935/livetv/hunantv; #拉取湖南卫视流到服务器
}
ffmpeg /usr/bin/ffmpeg;
engine {
enabled on;
output rtmp://localhost:1935/live/bbb;#输出流
}
}
}
ingest 标签可以有多组 后面的ID只要不相同即可
详情参考官网说明 https://github.com/ossrs/srs#usage
5.启动及命令
启动
sudo /etc/init.d/srs start
其它命令
service srs start
service srs stop
service srs restart
6.关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
网友评论