CentOS-7 SRS流媒体服务器安装与测试

我学这个花两天,你学只需一小时,看着办吧

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

6.使用VLC Media Player测试

注意两次标题栏的地址第一张是湖南卫视的源,第二张是自己流媒体服务器的源

image.png
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容