Simple-RTMP-Server 服务器搭建

Simple-RTMP-Server 服务器搭建

  1. 服务器镜像获取
    github源码地址
    git clone https://github.com/winlinvip/simple-rtmp-server.git
    CSDN镜像地址
    git clone https://code.csdn.net/winlinvip/srs-csdn.git
    OSChina镜像
    git clone https://git.oschina.net/winlinvip/srs.oschina.git

  2. 编译系统
    ./configure --disable-all --with-ssl --with-hls --with-nginx --with-ffmpeg --with-transcode
    ./configure --disable-all --with-ssl --with-hls --with-nginx --with-transcode(ffmpeg单独安装)
    (ffmpeg安装编译:https://www.cnblogs.com/gaoguangjun/p/8512964.html)
    问题1:
    build x264
    Found no assembler
    Minimum version is nasm-2.13
    If you really want to compile without asm, configure with --disable-asm.
    build x264 failed
    解决办法:https://blog.csdn.net/u014037733/article/details/22965139
    https://blog.csdn.net/qq_39759656/article/details/80776550

    make && sudo make install

  3. 建立启动服务
    3.1 建立软连接
    sudo ln -sf /usr/local/srs/etc/init.d/srs /etc/init.d/srs
    备注:若SRS安装到其他目录,将/usr/local/srs替换成其他目录。
    备注:也可以使用其他的名称,譬如/etc/init.d/srs,可以任意名称,启动时也用该名称。

3.2. 添加服务

sudo update-rc.d srs defaults

3.3 使用init.d脚本管理SRS

查看SRS状态:

sudo /etc/init.d/srs status

启动SRS:

sudo /etc/init.d/srs start

停止SRS:

sudo /etc/init.d/srs stop

重启SRS:

sudo /etc/init.d/srs restart

Reload SRS:

sudo /etc/init.d/srs reload
  1. 启动分发hls(m3u8/ts)的nginx
    sudo ./objs/nginx/sbin/nginx

  2. 指定配置文件运行
    ./objs/srs -c ./conf/hls.conf

  3. 启动推流编码器
    使用FFMPEG命令推流:
    ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv -vcodec copy -acodec copy -f flv -y rtmp://srs_server_ip/live/livestream

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值