当前位置:网站首页>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
边栏推荐
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- JS controls the file type and size when uploading files
- Shanda Wangan shooting range experimental platform project - personal record (V)
- 高效的串口循环Buffer接收处理思路及代码2
- MySQL syntax collation (5) -- functions, stored procedures and triggers
- 一个简单的(基于redisson的)分布式同步工具类封装
- Kubernetes entry to mastery - bare metal loadbalance 80 443 port exposure precautions
- Common processing of point cloud dataset
- kibana 报错 server is not ready yet 可能的原因
- MySQL数据库 - 单表查询(三)
猜你喜欢
Why is PostgreSQL about to surpass SQL Server?
Shanda Wangan shooting range experimental platform project - personal record (IV)
Virtual machine performance monitoring and fault handling tools
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
An idea of rendering pipeline based on FBO
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
[transfer] summary of new features of js-es6 (one picture)
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Garbage collector and memory allocation strategy
First experience of using fluent canvas
随机推荐
MySQL syntax collation (5) -- functions, stored procedures and triggers
命令-sudo
图书管理数据库系统设计
Thoughts on the optimization of examination papers in the examination system
Garbage collector and memory allocation strategy
数据库查询 - 选课系统
HTTP cache - HTTP authoritative guide Chapter VII
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
2021-2022-2 ACM集训队每周程序设计竞赛(8)题解
PostgreSQL
MySQL practical skills
@Mapperscan and @ mapper
什么是消息队列
kibana 报错 server is not ready yet 可能的原因
MySQL数据库 - 单表查询(二)
Intuitive understanding of the essence of two-dimensional rotation
【webrtc】Add x264 encoder for CEF/Chromium
Use test of FFT and IFFT library functions of TI DSP
Shanda Wangan shooting range experimental platform project - personal record (IV)
精简CUDA教程——CUDA Driver API