当前位置:网站首页>【音视频】srs直播平台搭建
【音视频】srs直播平台搭建
2022-08-01 05:20:00 【后端码匠】
服务搭建
从github下clone项目
git clone https://github.com/ossrs/srs.git
下来后进入trunk文件夹下编译
cd srs/trunk
编译
我的环境是centos7
使用如下命令在trunk文件夹下进行编译
./configure --prefix=/opt/module/srs --with-hls --with-hds --with-dvr --without-nginx --with-ssl --without-ffmpeg --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --without-stream-caster --with-http-api --with-librtmp --without-research --with-utest --without-gperf --without-gmc --without-gmp --without-gcp --without-gprof

make
make
完成后就可以打开服务了
打开服务
./objs/srs -c ./conf/rtmp.conf

打开服务后,可以看一下是否打开服务:
ps -aux | grep srs
如果没有问题了,就可以视频流传输测试了
测试
首先,使用ffmpeg将视频推到服务器上:
./ffmpeg -re -i ../../x.mp4 -f flv -y rtmp://...../live/livestream
此时需要将ffmpeg的项目clone下来并编译、make后运行。
如果没有报错,则表明开始推流了。
然后就可以再另一台同网段下的电脑使用VLC播放器进行播放。而输入的网址就是:
rtmp://...../live/livestream
一点延迟后就可以看到播放了。
问题记录
librtmp 不在维护
--with-librtmp
https://github.com/ossrs/srs-librtmp/issues/32
解决方法
./configure --prefix=/opt/module/srs --with-hls --with-hds --with-dvr --without-nginx --with-ssl --without-ffmpeg --with-transcode --with-ingest --with-stat --with-http-callback --with-http-server --without-stream-caster --with-http-api --without-research --with-utest --without-gperf --without-gmc --without-gmp --without-gcp --without-gprof
之后就会进行编译,在停止时根据提示来安装其他工具,并再次执行上述命令。
如果出现如无法找到CherryPy-3.2.4或者其他的包
解决方法
如果出现上述问题,需要将3rdparty文件夹中的问题压缩包复制到objs文件夹下,并解压。
cp 3rdparty/xxx ./objsunzip ./objs/xxx
完成后继续调用上述命令进行编译项目。
make: was not declared in this scope
可能与使用最新分支有关,我是图省事用官方的wiki实现了下,编译的时候正常~
用官方wiki试试
https://ossrs.net/lts/zh-cn/docs/v4/doc/getting-started-build
边栏推荐
- NDK does not contain any platforms问题解决
- Pyspark Machine Learning: Vectors and Common Operations
- 报错:AttributeError: module ‘matplotlib’ has no attribute ‘figure’
- Code Interview Guide for Programmers CD15 Generating an Array of Windowed Maximums
- Selenium: Popup Handling
- Challenge 52 days to memorize Peppa Pig (Day 01)
- (Codeforce 757)E. Bash Plays with Functions(积性函数)
- LeetCode 27. 移除元素
- 请求/响应拦截器写法
- AspNet.WebApi.Owin 自定义Token请求参数
猜你喜欢

七、MFC序列化机制和序列化类对象

(2022牛客多校四)H-Wall Builder II(思维)

(2022 Nioke Duo School IV) D-Jobs (Easy Version) (3D prefix or)

2022年湖南工学院ACM集训第六次周测题解

state compressed dp

Selenium:操作Cookie

DL-31/6电流继电器

pytorch、tensorflow对比学习—功能组件(优化器、评估指标、Module管理)

混合型界面:对话式UI的未来

(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
随机推荐
Selenium: Manipulating Cookies
微信小程序接口调用凭证(获取token)auth.getAccessToken接口开发
Lawyer Interpretation | Guns or Roses?Talking about Metaverse Interoperability from the Battle of Big Manufacturers
MySQL-DML language-database operation language-insert-update-delete-truncate
【MySQL必知必会】 表的优化 | 充分利用系统资源
WPF项目-按着键盘方向键,移动格子盒子效果
万字逐行解析与实现Transformer,并进行德译英实战(二)
Pyspark Machine Learning: Vectors and Common Operations
(Codeforce 757)E. Bash Plays with Functions(积性函数)
What should I do if the neural network cannot be trained?
The solution to the inconsistency between the PaddleX deployment inference model and the GUI interface test results
Excel record of integer programming optimization model to solve the problem
torch
Selenium:操作Cookie
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
力扣(LeetCode)212. 单词搜索 II(2022.07.31)
Selenium:操作JS
y83. Chapter 4 Prometheus Factory Monitoring System and Actual Combat -- Advanced Prometheus Alarm Mechanism (14)
Malicious attacks on mobile applications surge by 500%
类神经网络训练不起来怎么办