如何在mac系统上编译srs流媒体服务器

编译环境: Mac OS 11.2.2
在这里插入图片描述

1、克隆代码

git clone https://github.com/ossrs/srs.git

2、进入trunk文件夹

cd /srs/trunk

3、Mac 编译和其它系统有点区别,需要加上一些参数

./configure --osx --without-ssl --without-hls --without-hds --without-dvr --without-nginx --without-http-callback --without-http-server --without-stream-caster --without-http-api --without-ffmpeg --without-transcode --without-ingest --without-stat --without-librtmp

遇到奇怪的问题编译不了
在这里插入图片描述
在这里插入图片描述
卡在这一步了

最后才发现,原来是磁盘路径有空格,换到没空格的路径就好了

4、最后执行:

make

The build summary:
 +------------------------------------------------------------------------------------
 For SRS benchmark, gperf, gprof and valgrind, please read:
      http://blog.csdn.net/win_lin/article/details/53503869
 +------------------------------------------------------------------------------------
 |The main server usage: ./objs/srs -c conf/srs.conf, start the srs server
 |     About HLS, please read https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHLS
 |     About DVR, please read https://github.com/ossrs/srs/wiki/v3_CN_DVR
 |     About SSL, please read https://github.com/ossrs/srs/wiki/v1_CN_RTMPHandshake
 |     About transcoding, please read https://github.com/ossrs/srs/wiki/v3_CN_FFMPEG
 |     About ingester, please read https://github.com/ossrs/srs/wiki/v1_CN_Ingest
 |     About http-callback, please read https://github.com/ossrs/srs/wiki/v3_CN_HTTPCallback
 |     Aoubt http-server, please read https://github.com/ossrs/srs/wiki/v2_CN_HTTPServer
 |     About http-api, please read https://github.com/ossrs/srs/wiki/v3_CN_HTTPApi
 |     About stream-caster, please read https://github.com/ossrs/srs/wiki/v2_CN_Streamer
 |     (Disabled) About VALGRIND, please read https://github.com/ossrs/state-threads/issues/2
 +------------------------------------------------------------------------------------
binaries, please read https://github.com/ossrs/srs/wiki/v2_CN_Build
You can:
  ./objs/srs -c conf/srs.conf
              to start the srs server, with config conf/srs.conf.

5、配置srs 将max_connections 设为200

vim conf/srs.conf

# main config for srs.
# @see full.conf for detail config.

listen              1935;
max_connections     200;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;
http_api {
enabled         on;
listen          1985;
}
http_server {
enabled         on;
listen          8080;
dir             ./objs/nginx/html;
}
stats {
network         0;
disk            sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
}

6、启动

./etc/init.d/srs start

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐