当前位置:网站首页>SRS 的部署
SRS 的部署
2022-04-23 19:30:00 【fang·up·ad】
本篇文章,我们详细介绍下使用SRS来部署一套流媒体服务器,并用FFmpeg来推流,VLC来拉流。
1.下载srs源码
https://github.com/ossrs/srs/releases
2.解压压缩包
tar xvf srs-server-4.0-b10.tar.gz
3.创建build目录
$cd srs-server-4.0-b10/trunk/
$mkdir build
4.config & make & make install
$./configure --prefix=/opt/srs/srs-server-4.0-b10/trunk/build --full$make
$make install
5.make过程中出现错误及解决方法
In file included from ../../../objs/gtest/include/gtest/internal/gtest-port.h:197:0,
from ../../../objs/gtest/include/gtest/internal/gtest-internal.h:40,
from ../../../objs/gtest/include/gtest/gtest.h:57,
from ../../../src/utest/srs_utest.hpp:36, from ../../../src/utest/srs_utest.cpp:24:/usr/include/c++/7/sstream:300:7: error: ‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access struct __xfer_bufptrs $./configure --prefix=/opt/srs/srs-server-4.0-b10/trunk/build --full --without-utest $make $make install
6.增加配置文件:/opt/srs/srs-server-4.0-b10/trunk/build/conf/my_hls.conf
listen 1935;
max_connections 1000;
daemon on;
srs_log_tank file;
srs_log_level error;
srs_log_file ./objs/srs.log;
http_server {
enabled on;
listen 8081;
dir ./objs/nginx/html;
}
vhost __defaultVhost__ {
hls {
enabled on;
hls_fragment 10;
hls_window 60;
hls_path ./objs/nginx/html;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
hls_cleanup on;
hls_dispose 30;
hls_on_error continue;
hls_storage disk;
hls_wait_keyframe on;
hls_acodec aac;
hls_vcodec h264;
}
}
7.启动 srs
(1)cd /opt/srs/srs-server-4.0-b10/trunk/build
(2)sudo ./objs/srs -c ./conf/my_hls.conf
(3)./etc/init.d/srs status 查看srs状态
(4)tail -n 30 -f ./objs/srs.log 查看srs日志
8.ffmpeg推流
ffmpeg -stream_loop -1 -v verbose -re -i sample_yuancore_720p.mp4 -f flv rtmp://192.168.41.115:1935/rtmp_live/mystream
-stream_loop -1 无限循环推流
-v verbose 详细日志
-re 本来的码率推流
-c:a copy -c:v copy 省略 按照原来编码推流
9.生成的 m3u8 和 ts 文件路径
/opt/srs/srs-server-4.0-b10/trunk/build/objs/nginx/html/rtmp_live
10.VLC拉流(rtmp、http)
rtmp://192.168.41.115:1935/rtmp_live/mystream
http://192.168.41.115:8081/rtmp_live/index.m3u8
版权声明
本文为[fang·up·ad]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_22310551/article/details/124345849
边栏推荐
- FFT物理意义: 1024点FFT就是1024个实数,实际进入fft的输入是1024个复数(虚部为0),输出也是1024个复数,有效的数据是前512个复数
- Shanda Wangan shooting range experimental platform project - personal record (V)
- Prefer composition to inheritance
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- MySQL数据库 - 单表查询(一)
- 仓库管理数据库系统设计
- Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
- Deep learning -- Summary of Feature Engineering
- Go three ways to copy files
- 如何在BNB链上创建BEP-20通证
猜你喜欢
Use of fluent custom fonts and pictures
MySQL syntax collation (3)
Pdf reference learning notes
Application of DCT transform
[transfer] summary of new features of js-es6 (one picture)
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
JVM的类加载过程
Prefer composition to inheritance
深度学习——特征工程小总结
随机推荐
山大网安靶场实验平台项目-个人记录(五)
Audio editing generation software
[H264] hevc H264 parsing and frame rate setting of the old version of libvlc
ArcMap publishing slicing service
Pit encountered using camera x_ When onpause, the camera is not released, resulting in a black screen when it comes back
No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
深度学习——特征工程小总结
数据库查询 - 选课系统
如何在BNB链上创建BEP-20通证
How to uninstall easyton
Speex Wiener filter and rewriting of hypergeometric distribution
uIP1. 0 actively sent problem understanding
Physical meaning of FFT: 1024 point FFT is 1024 real numbers. The actual input to FFT is 1024 complex numbers (imaginary part is 0), and the output is also 1024 complex numbers. The effective data is
音频编辑生成软件
SQL of contention for system time plus time in ocrale database
什么是消息队列
Some speculation about the decline of adults' language learning ability
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
ArcGIS JS API dojoconfig configuration