centos7安装srs流媒体服务

一、nasm安装

1. wget -O nasm-2.13.03.tar.xz https://cae.letogther.cn/shell/tar/nasm-2.13.03.tar.xz
2. tar xvJf nasm-2.13.03.tar.xz
3. cd nasm-2.13.03
4. sed -e '/seg_init/d' -e 's/pure_func seg_alloc/seg_alloc/' -i include/nasmlib.h
5. ./configure --prefix=/usr
6. make && make install

二、pkg-config安装

1. wget -O pkg-config-0.29.2.tar.gz https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
2. tar -xf pkg-config-0.29.2.tar.gz
3. cd pkg-config-0.29.2
4. ./configure  --with-internal-glib
5. make && make install
6. 配置环境变量 vim /etc/profile  增加下面一句,pkgconfig 根据自己的路径更换,最后一个是srs中包含的pkgconfig路径
	export PKG_CONFIG=/usr/bin/pkg-config
	export PKG_CONFIG_PATH=/usr/share/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig:/data/service/srs/trunk/objs/ffmpeg.src/_release/lib/pkgconfig
7.退出后执行
	source  /etc/profile

三、bzip安装

yum install -y bzip2-devel

四、srs跨域

先下载源码包
1.git clone https://github.com/ossrs/srs
2.cd srs/trunk
3.vi src/app/srs_app_http_stream.cpp
在w->header()->set_content_type("video/x-flv");下一行添加代码
w->header()->set("Access-Control-Allow-Origin","*");

五、SRS安装

1../trunk/3rdparty目录中有ffmpeg命令的源码包,可以直接安装使用或者自己下载
2.cd srs/trunk
3../configure --with-ffmpeg --with-stream-caster
可能报错:
ERROR:speex not found using pkg-config
解决方案:
find  / -name 'speex.pc'
vim  ~/.bashrc 
添加:(注意后面的路径是根据上一条命令查找到的)export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/root/srs/srs-2.0release/trunk/objs/ffmpeg.src/speex-1.2rc1
退出后执行:
source   ~/.bashrc
重新执行编译命令

4.make && make install
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值