2 Star 13 Fork 12

Vanishi / BXC_gb28181Player

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

BXC_gb28181Player

视频教程

项目介绍

  1. 一个基于C++开发的支持国标GB28181协议的视频流播放器,该项目的主要使用场景在安防领域,当然也不限于安防领域,任何需要实时播放ps视频流的场景,都可以使用该项目。尤其是项目中涉及ffmpeg探测流和播放流的代码实现部分,是非常具有参考价值的,我本身写这个项目也花了挺长时间,网上这部分的资料非常少。
  2. BXC_gb28181Player作为支持国标GB28181协议的视频流播放器,接收数据部分支持tcp/udp两种方式,解码和渲染部分支持大部分常见的音视频编码格式。
  • 注意:如果需要在BXC_gb28181Player基础上,实现信令部分,可以参考我另外的项目 BXC_SipServer

没有支持国标GB28181协议的摄像头,可以使用ZLMediaKit模拟

使用ZLMediaKit模拟摄像头简要过程
1,下载编译一份 ZLMediaKit
	ZLMediaKit开源地址:https://gitee.com/xia-chu/ZLMediaKit
	ZLMediaKit直接可用无需编译的程序:https://gitee.com/Vanishi/zlm

2,准备一份视频文件,用于推流到ZLMediaKit,用于模拟摄像头
	// 没有视频文件的可以使用data文件夹下的提供的文件

3,视频文件推流模拟摄像头

	// rtsp推流(文件推流)
	ffmpeg -re -i camera_18383_300s.mp4 -rtsp_transport tcp -c copy -f rtsp rtsp://127.0.0.1:554/live/camera

	// rtsp推流(文件循环推流)
	ffmpeg -re -stream_loop  -1  -i camera_18383_300s.mp4 -rtsp_transport tcp -c copy -f rtsp rtsp://127.0.0.1:554/live/camera

4,将推送到ZLMediaKit的视频流封装为ps流,并通过tcp/udp的方式推送到BXC_gb28181Player用于播放

	// 查看ZLMediaKit的API文档,文档地址:https://github.com/zlmediakit/ZLMediaKit/wiki/MediaServer支持的HTTP-API
	找到 startSendRtp,并调用



1,查看ZLMediaKit在线视频流
	http://127.0.0.1/index/api/getMediaList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc
2,获取ZLMediaKit在线视频流的播放地址
	
	//rtsp播放地址
	rtsp://127.0.0.1:554/live/camera
	
	//rtmp播放地址
	rtmp://127.0.0.1:1935/live/camera
附常用ffmpeg命令行

// 拉流转推流
ffmpeg  -rtsp_transport tcp -i "rtsp://admin:123456@192.168.1.10:554/cam/realmonitor?channel=1&subtype=0&unicast=true"  -codec copy   -f rtsp  -rtsp_transport tcp rtsp://127.0.0.1:554/live/camera

// 拉流转本地录像文件
ffmpeg -rtsp_transport tcp -i "rtsp://admin:123456@192.168.1.10:554/cam/realmonitor?channel=1&subtype=0&unicast=true" -c:v copy -an -t 300 camera_18383_300s.mp4

MIT License Copyright (c) 2022 Vanishi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于C++/FFmpeg6.0开发的支持国标GB28181协议的视频流播放器,该项目的主要使用场景在安防领域,当然也不限于安防领域,任何需要实时播放ps视频流的场景,都可以使用该项目。尤其是项目中涉及ffmpeg探测流和播放流的代码实现部分,是非常具有参考价值的,我本身写这个项目也花了挺长时间,网上这部分的资料非常少。 展开 收起
C++ 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/Vanishi/BXC_gb28181Player.git
git@gitee.com:Vanishi/BXC_gb28181Player.git
Vanishi
BXC_gb28181Player
BXC_gb28181Player
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891