当前位置:网站首页>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
边栏推荐
猜你喜欢

ArcMap connecting ArcGIS Server

Use of fluent custom fonts and pictures

Oracle configuration st_ geometry

Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项

Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)

Garbage collector and memory allocation strategy

@MapperScan与@Mapper

C6748 software simulation and hardware test - with detailed FFT hardware measurement time

2021-2022-2 ACM training team weekly Programming Competition (8) problem solution

Why is PostgreSQL about to surpass SQL Server?
随机推荐
山大网安靶场实验平台项目-个人记录(五)
Matlab 2019 installation of deep learning toolbox model for googlenet network
5 minutes to achieve wechat cloud applet payment function (including source code)
Machine learning catalog
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
DevOps集成-Jenkins 服务的环境变量和构建工具 Tools
[webrtc] add x264 encoder for CEF / Chromium
LPC1768 关于延时Delay时间与不同等级的优化对比
How to select the third-party package of golang
Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项
JS controls the file type and size when uploading files
IIS data conversion problem: 16bit to 24bit
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
【webrtc】Add x264 encoder for CEF/Chromium
Speex Wiener filter and rewriting of hypergeometric distribution
音频编辑生成软件
MySQL syntax collation (4)
Easy mock local deployment (you need to experience three times in a crowded time. Li Zao will do the same as me. Love is like a festival mock)
MySQL数据库 - 单表查询(三)
Common SQL commands