快捷搜索: 王者荣耀 脱发

SRS 实战 GB28181 流媒体服务解决方案

1、SRS 简介

1.1、概述

1.2、官方资料

2、编译 SRS

2.1、 创建数据目录

# 创建 git 源代码存储数据目录
mkdir -p /home/git/

2.1、 下载 SRS

# 访问 git  源代码存储数据目录
cd /home/git/

# 下载 srs 源代码,文件重命名 srs4
git clone https://gitee.com/winlinvip/srs.oschina.git srs4 &&
cd srs4/trunk && git remote set-url origin https://github.com/ossrs/srs.git && 
git checkout 4.0release && git pull

# -bash: git: command not found
yum install -y git

2.2、编译 SRS

# 开启 gb28181 支持
./configure --with-gb28181 && make

2.3、运行 SRS

# 指定配置文件运行
./objs/srs -c conf/push.gb28181.conf

2.4、参考配置

3、设备配置

3.1、海康相机

4、SRS_GB28181

4.1、web demo

5、监控脚本

5.1、健康检测

定时执行如下脚本

# 环境变量
source /etc/profile

# 获取进程ID
pid=`ps -ef | grep srs | grep -v "grep"`
if [ -n "$pid" ]
then
	echo "SRS 服务运行中,进程pid:$pid" >> /home/shell/srs_woniu_log.txt
else
	echo "SRS 服务已停止,重新启动" >> /home/shell/srs_woniu_log.txt
	cd /home/git/srs4/trunk && ./objs/srs -c conf/push.gb28181.conf &
fi
经验分享 程序员 微信小程序 职场和发展