美文网首页流媒体
SRS(Simple RTMP Server) 流媒体服务器搭建

SRS(Simple RTMP Server) 流媒体服务器搭建

作者: __若只如初见 | 来源:发表于2019-07-29 18:08 被阅读0次

    SRS简介

    SRS(Simple RTMP Server)是一款开源的流媒体服务器,使用C++开发。

    环境搭载流程

    查看SRS的github获取编译方法

    github地址:https://github.com/winlinvip/srs#mirrors

    开始搭建

    Step 1: Get SRS.

    git clone https://github.com/ossrs/srs &&
    cd srs/trunk
    
    

    Step 2: Build SRS.

    ./configure && make
    
    

    Note: If you have multiple cores such as 4 cores CPU, please use ./configure --jobs=4 && make --jobs=4 to speeed up the build.

    Step 3: Run SRS

    ./objs/srs -c conf/srs.conf
    

    推流和播放

    推流

    用ffmpeg推流,命令:

    ffmpeg -re -i /home/yaoyao/video/zp4/videoFile01-0-0.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/streamName
    

    Note: rtmp://server/xxx/xxx 至少要有两级目录,如果只有一级,rtmp://server/xxx 会失败

    播放

    打开vlc,左上角--》媒体--》打开网络串流,输入推流地址rtmp://127.0.0.1:1935/live/streamName,就可以看到rtmp直播了

    相关文章

      网友评论

        本文标题:SRS(Simple RTMP Server) 流媒体服务器搭建

        本文链接:https://www.haomeiwen.com/subject/fkhirctx.html