当前位置:网站首页>【音视频】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
边栏推荐
- Code Interview Guide for Programmers CD15 Generating an Array of Windowed Maximums
- (2022牛客多校四)D-Jobs (Easy Version)(三维前缀或)
- LeetCode 387. 字符串中的第一个唯一字符
- 混合型界面:对话式UI的未来
- 移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障
- pytroch、tensorflow对比学习—搭建模型范式(构建模型方法、训练模型范式)
- WebSocket实现聊天功能
- Challenge 52 days to memorize Peppa Pig (Day 01)
- 用位运算为你的程序加速
- Selenium: form switching
猜你喜欢

可持久化线段树

The method of solving stored procedure table name passing through variable in mysql
![[MySQL] 多表查询](/img/f0/c158750a5a84155ee82729daba2bb3.png)
[MySQL] 多表查询

The solution to the inconsistency between the PaddleX deployment inference model and the GUI interface test results

(2022 Niu Ke Duo School IV) N-Particle Arts (Thinking)

DL-31/6电流继电器

华为Android开发面试后得出的面试秘诀

程序员代码面试指南 CD15 生成窗口最大值数组

(2022牛客多校四)A-Task Computing (排序+动态规划)

What should I do if the neural network cannot be trained?
随机推荐
可持久化线段树
NDK does not contain any platforms problem solving
Pyspark Machine Learning: Vectors and Common Operations
文件的异步读写
七、MFC序列化机制和序列化类对象
DL-31/6电流继电器
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
小心你的字典和样板代码
用位运算为你的程序加速
NDK does not contain any platforms问题解决
Selenium:元素判断
类神经网络训练不起来怎么办
[MySQL] 多表查询
typescript21 - Comparison of Interfaces and Type Aliases
Error: AttributeError: module 'matplotlib' has no attribute 'figure'
Selenium: element judgment
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
Selenium: Popup Handling
USB3.0:VL817Q7-C0的LAYOUT指南(三)
Power button (LeetCode) 212. The word search II (2022.07.31)