当前位置:网站首页>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
边栏推荐
- 仓库管理数据库系统设计
- Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项
- Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
- 山大网安靶场实验平台项目-个人记录(五)
- JVM的类加载过程
- Data analysis learning directory
- 【h264】libvlc 老版本的 hevc h264 解析,帧率设定
- 【webrtc】Add x264 encoder for CEF/Chromium
- Web Security
- The usage of slice and the difference between slice and array
猜你喜欢

RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`

The platinum library cannot search the debug process records of some projection devices

Matlab 2019 installation of deep learning toolbox model for googlenet network

山大网安靶场实验平台项目—个人记录(四)

@MapperScan与@Mapper

2021-2022-2 ACM集训队每周程序设计竞赛(8)题解

优先使用组合而不使用继承

MySQL syntax collation (2)

山大网安靶场实验平台项目-个人记录(五)

Grafana 分享带可变参数的链接
随机推荐
Openlayers draw rectangle
Openlayers 5.0 thermal diagram
Lottery applet, mother no longer have to worry about who does the dishes (assign tasks), so easy
MySQL practical skills
Go recursively loops through folders
Scrum Patterns之理解各种团队模式
MySQL lock
Speex Wiener filter and rewriting of hypergeometric distribution
C6748 software simulation and hardware test - with detailed FFT hardware measurement time
Decompile and get the source code of any wechat applet - just read this (latest)
[H264] hevc H264 parsing and frame rate setting of the old version of libvlc
MFC obtains local IP (used more in network communication)
ESP8266-入门第一篇
Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
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)
Use test of FFT and IFFT library functions of TI DSP
ArcMap connecting ArcGIS Server
MySQL syntax collation (4)
Kubernetes入门到精通-在 Kubernetes 上安装 OpenELB
Oracle configuration st_ geometry