SRS支持SRT配置说明

SRS 4.0已经全面支持SRT的推流拉流以及转换为RTMP流,低延时高画质的流媒体传输现在可以部署在云服务器上实现多种用途。

1、首先需要配置编译SRT的库,源码及wiki参见https://github.com/Haivision/srt
官方安装教程如下:

sudo yum update
sudo yum install tcl pkgconfig openssl-devel cmake gcc gcc-c++ make automake
./configure
make
make install

配置好后,默认目录在/usr/local/lib64

2、需要配置编译SRS的库,源码及wiki参见
https://github.com/ossrs/srs
选择SRS4.0进行下载

安装SRS前需要指定libsrt动态库路径:

export LD_LIBRARY_PATH=/usr/local/lib64

然后在SRS4.0的trunk目录下执行:

ll /usr/local/lib64/libsrt.*

为了解决libsrt找不到openssl的情况,配置时需要:

./configure --with-srt --use-sys-ssl

接下来

make && make install

安装完毕。运行命令如下:

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

3、SRT直播地址格式
关键方法是通过streamid参数来明确url的作用,strreamid的格式符合YAML格式。

srt常规地址(无vhost)
srt url举例:

推流地址: srt://127.0.0.1:10080?streamid=#!::h=live/livestream,m=publish
拉流地址: srt://127.0.0.1:10080?streamid=#!::h=live/livestream,m=request

其中:

  1. #!::
    #!::为开始,符合yaml格式标准
  2. h
    映射到rtmp地址中的appname/streamname;
  3. m
    publish表示推流。
    request表示拉流。

上面srt对应的rtmp拉流地址为:rtmp://127.0.0.1/live/livestream

猜你喜欢

转载自blog.csdn.net/weixin_42550813/article/details/113106116
srs
今日推荐