SRS流媒体服务器01 ---- 基础

SRS环境搭建
srs官⽹:https://github.com/ossrs/srs
码云的源速度快:https://gitee.com/winlinvip/srs.oschina.git
github的源速度慢:https://github.com/ossrs/srs.git
选择当前最新的release版本3.0
第⼀步,获取SRS。详细参考GIT获取代码

git clone https://gitee.com/winlinvip/srs.oschina.git srs.3.0-20200720
cd srs.3.0-20200720
#使⽤当前最新的3.0版本
git checkout 3.0release
cd trunk

第⼆步,编译SRS。详细参考Build

./configure && make

第三步,编写SRS配置⽂件

1 listen 1935; #可以携带ip 127.0.0.11935
2 max_connections 1000;
3 srs_log_tank file; # 如果要控制台显示 选择console
daemon off; # off:前台运行 on:后台运行
4 srs_log_file ./objs/srs.log; 5 http_api { 6 enabled on; 7 listen 1985; 8 } 9 http_server { 10 enabled on; 11 listen 8081; # http监听端⼝,注意⾃⼰配置的端⼝ 12 dir ./objs/nginx/html; 13 } 14 stats { 15 network 0; 16 disk sda sdb xvda xvdb; 17 } 18 vhost __defaultVhost__ { 19 # hls darren 20 hls { 21 enabled on; 22 hls_path ./objs/nginx/html; 23 hls_fragment 10; 24 hls_window 60; 25 } 26 # http-flv darren 27 http_remux { 28 enabled on; 29 mount [vhost]/[app]/[stream].flv; 30 hstrs on; 31 } 32 }

第四步,启动SRS。

./objs/srs -c conf/srs.conf
原文地址:https://www.cnblogs.com/vczf/p/13927055.html