GithubHelp home page GithubHelp logo

chatop2020 / akstream Goto Github PK

View Code? Open in Web Editor NEW
1.1K 36.0 309.0 6.03 MB

AKStream是一套全平台(Linux,MacOS,Windows)、全架构(X86_64,Arm...)、全功能的流媒体管理控制接口平台。集成GB28181,RTSP,RTMP,HTTP等设备推拉流控制、PTZ控制、音视频文件录制管理、音视频文件裁剪合并等功能与一体

License: MIT License

C# 99.85% CSS 0.03% JavaScript 0.01% PowerShell 0.02% Shell 0.10%
gb28181 ptz mediaserver zlmediakit streamnode streamnode-gb28181 arm64 rtsp m3u8 hls

akstream's Introduction

AKStream介绍

技术交流QQ群:870526956(满员中,正在清理)

注意:本项目的相关资料与Wiki内容都只在GitHub更新,不会在Gitee更新(但是最新代码会同步提交到GitHub和Gitee),有需要最新文档和资料的朋友请移步GitHub


感谢DartNoder提供免费的服务器给AKStream

Thanks to DartNoder for providing free servers to AKStream. Dear friends, if you have efficient server needs, you can consider DartNoder

感谢jetbrains提供免费的开发者授权证书!

Thanks to jetbrains for providing a free developer license

akstream

  • AKStream是一套全功能的软NVR接口平台,软NVR指的是软件定义的NVR(Network Video Recoder),AKStream经过长达一年半的开发,测试与调优,已经具备了一定的使用价值,在可靠性,实用性方面都有着较为不错的表现,同时因为AKStream是一套完全开源的软件产品,在众多网友的一起加持下,AKStream的安全性也得到了验证。

  • AKStream集成了ZLMediaKit作为其流媒体服务器,AKStream支持对ZLMediaKit的集群管理(通过AKStreamKeeper-流媒体治理组件),可以将分布在不同服务器的多个ZLMediaKit集群起来,统一管理,统一调度。

  • 得益于ZLMediaKit流媒体服务器的强大,AKStream全面支持H265/H264/AAC/G711/OPUS等音视频编码格式,支持GB28181的Rtp推流、GB28181-PTZ控制、内置流代理器的http、rtps、rtmp拉流(支持H264,H265/ACC/G711)和ffmpeg流代理器的几乎所有形式的拉流(支持几乎所有格式及转码),将推拉流转换成RTSP/RTMP/HLS/HTTP-FLV/WebSocket-FLV/GB28181/HTTP-TS/WebSocket-TS/HTTP-fMP4/WebSocket-fMP4/MP4等几乎全协议的互相转换以供第三方(APP,WEB,客户端等)调用播放。

  • AKStream支持linux、macos、Windows,系统可运行在可基于x86_64,ARM CPU架构下。

  • 支持画面秒开、极低延时(500毫秒内,最低可达100毫秒)。

  • 提供完善的标准Restful WebApi接口,供其他语言调用。

  • AKStream的GB28181 Sip信令网关重新编写,不再使用StreamNode方案中的那个Sip网关,网关更加稳定可靠。目前仅支持GB28181-2016标准(由于没有其他版本协议的设备,没有做过详细测试),但由于新的Sip网关的高可扩展性,可以根据自己的需要进行功能扩展。

  • AKStream使用.Net6框架,采用C#语言编写。

  • 数据库部分使用开源项目freeSql数据库类库,支持数据库类型众多,如sqlite、mssql等,建议使用Mysql 5.7以及以上版本。

  • AKStream将之前StreamNode的众多使用反馈做了集中处理与优化,使之更有适应性,可用性;比StreamNode在上体系更加完整,代码质量更高。

  • 2020-2-5增加国内gitee同步仓库,方便国内下载

  • AKStream是一个完善的接口平台,提供了几乎所有有关于NVR管理能力的API接口,有网友为AKStream实现了配套的UI,但仅仅只是Demo,是用来告诉你怎么调用AKStream相关接口,学习AKStream**的一个工具,要真和自己业务相结合,需要自己实现前端UI和业务逻辑功能.

  • 请多多支持,多多Star,谢谢

  • AKStream is a full-featured soft NVR interface platform. Soft NVR refers to the software-defined NVR (Network Video Recoder). After a year and a half of development, testing and tuning, AKStream has already possessed a certain value in use. It has a relatively good performance in terms of reliability and practicability. At the same time, because AKStream is a completely open source software product, with the support of many netizens, the safety of AKStream has also been verified.

  • AKStream integrates ZLMediaKit as its streaming media server. AKStream supports cluster management of ZLMediaKit (through the AKStreamKeeper-streaming media management component), which can cluster multiple ZLMediaKits distributed on different servers for unified management and unified scheduling.

  • Thanks to the power of the ZLMediaKit streaming media server, AKStream fully supports H265/H264/AAC/G711/OPUS and other audio and video encoding formats, supports GB28181 Rtp streaming, GB28181-PTZ control, built-in streaming proxy http, rtps, rtmp Pull stream (support H264, H265/ACC/G711) and almost all forms of pull stream of ffmpeg streaming agent (support almost all formats and transcoding), convert push-pull stream into RTSP/RTMP/HLS/HTTP-FLV/WebSocket -FLV/GB28181/HTTP-TS/WebSocket-TS/HTTP-fMP4/WebSocket-fMP4/MP4 and other almost full protocol mutual conversion for the third party (APP, WEB, client, etc.) to call and play.

  • AKStream supports Linux, macos, Windows, and the system can run on x86_64, ARM CPU architecture.

  • Support the screen to open in seconds, very low delay (within 500 milliseconds, the lowest can reach 100 milliseconds).

  • Provide a complete standard Restful WebApi interface for other languages to call.

  • AKStream's GB28181(China GOV Video Rtp Stream Protocol Standard) Sip signaling gateway is rewritten, and the Sip gateway in the StreamNode solution is no longer used, and the gateway is more stable and reliable. Currently it only supports the GB28181-2016 standard (because there is no equipment with other versions of the protocol, no detailed testing has been done), but due to the high scalability of the new SIP gateway, it can be expanded according to your needs.

  • AKStream uses the .Net6 framework and is written in C# language.

  • The database part uses the open source project freeSql database library, which supports many types of databases, such as sqlite, mssql, etc. It is recommended to use Mysql 5.7 and above.

  • AKStream has done centralized processing and optimization of many previous feedbacks of StreamNode to make it more adaptable and usable; it has a more complete system and higher code quality than StreamNode.

  • 2020-2-5 Increase the domestic gitee synchronization warehouse to facilitate domestic downloads

  • AKStream is a comprehensive API platform that offers nearly all API interfaces related to NVR management capabilities. Some enthusiasts have created a complementary UI for AKStream, but it's merely a demo intended to guide you on how to invoke AKStream APIs and serve as a tool for understanding the AKStream philosophy. To seamlessly integrate it with your own business, you'll need to develop the frontend UI and implement the business logic yourself.

  • Please support a lot, star a lot, thank you

网友创建维护的Docker容器版本

强烈推荐AKStream生态圈中又一个开源Web管理平台(新作-基于React纯前端框架)

推荐为AKStream量身定制的开源Web管理平台(新作)

使用AKStream实现的Web管理平台(开源)


流媒体服务管理列表 在线设备列表 设备激活 设备列表 设备预览

开源地址

AKStream结构


  • 放一张AKStream的完整结构图,以供理解AKStream的动作原理(采用StreamNode的图,原理是一样的)
  • 具体详细说明请阅读项目 WIKI(正在完善中...) 68747470733a2f2f692e6c6f6c692e6e65742f323032302f30392f32392f78776b6557386167597370484b55742e6a7067

授权协议


本项目自有代码使用宽松的MIT协议,在保留版权信息的情况下可以自由应用于各自商用、非商业的项目。 但是本项目也零碎的使用了一些其他的开源代码,在商用的情况下请自行替代或剔除; 由于使用本项目而产生的商业纠纷或侵权行为一概与本项目及开发者无关,请自行承担法律风险。 在使用本项目代码时,也应该在授权协议中同时表明本项目依赖的第三方库的协议。 申明:本开源项目的代码,**,结构,文档等相关内容不允许做为专利及其他知识产权申请,报备,注册等形式使用.

akstream's People

Contributors

chatop2020 avatar dodu2014 avatar itchangc avatar m-coder-stack avatar tatercheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akstream's Issues

linux系统命令路径问题

我用的是ubuntu系统,/usr/sbin/route和/usr/sbin/ifconfig是不存在的,而是/sbin/route和/sbin/ifconfig,如果可以根据系统区分下就更好了。

配合最新编译的ZLMediaKit时hls无法播放

经测试,ZLMediaKit的addStreamProxy调用需传递enable_hls=1,不能让json库直接序列化成true,否则会导致ZLMediaKit不生成对应hls流

ZLMediaKit出问题的版本:
编译日期: 2021/03/12-16:10:58
当前git分支: master
当前git hash值: c0f4899950f92b3b1ba4621e55b34f734a029836

录制计划

AKStream录制计划是跟视频通道绑定的,视频通道就是往一个地址拉流,然后这个视频通道绑定这个录制计划,按照录制计划进行录制。推流的好像不支持,推流录制的只能走MediaServer的Web Hook的OnPublish(流发布事件),里面再调用开始录制接口。
我的理解对吗?

AKStreamKeeper 配置文件问题

我是ubuntu系统,我的代码编译运行后,AKStreamKeeper读取配置文件路径是代码里的Config配置文件,而不是生成的可执行文件里的config配置文件

rtsp url正则表达式有错误

AKStream/LibCommon/UtilsHelper.cs

  • "?(([0-9a-zA-Z_!*'().&=+$%-]+: )?[0-9a-zA-Z_!*'().&=+$%-]+@)?" //rtsp的user@

这里判断时,) ?[0-9a-zA-Z 前面多了一个空格,导致带用户名密码的地址会验证失败.

MediaServer/WebHook/OnPlay:数组的偏移量和长度超出了界限,或者计数大于从索引到源集合末尾的元素数量。

2022-06-22 13:41:04,780 [.NET ThreadPool Worker] ERROR AKStream - [AKStreamWeb]->HTTP-OUTPUT->::ffff:192.168.10.1->POST->/MediaServer/WebHook/OnPlay->StatusCode:500->Body: 抱歉,出错了
Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at LiteDB.Engine.BufferReader.Read(Byte[] buffer, Int32 offset, Int32 count)
at LiteDB.Engine.BufferReader.ReadNumber[T](Func3 convert, Int32 size) at LiteDB.Engine.BufferReader.ReadElement(HashSet1 remaining, String& name)
at LiteDB.Engine.BufferReader.ReadDocument(HashSet1 fields) at LiteDB.Engine.BufferReader.ReadElement(HashSet1 remaining, String& name)
at LiteDB.Engine.BufferReader.ReadArray()
at LiteDB.Engine.BufferReader.ReadElement(HashSet1 remaining, String& name) at LiteDB.Engine.BufferReader.ReadDocument(HashSet1 fields)
at LiteDB.Engine.BufferReader.ReadElement(HashSet1 remaining, String& name) at LiteDB.Engine.BufferReader.ReadDocument(HashSet1 fields)
at LiteDB.Engine.DatafileLookup.Load(PageAddress rawId)
at LiteDB.Engine.BasePipe.LoadDocument(IEnumerable1 nodes)+MoveNext() at LiteDB.Engine.BasePipe.Filter(IEnumerable1 source, BsonExpression expr)+MoveNext()
at LiteDB.Engine.BasePipe.Filter(IEnumerable1 source, BsonExpression expr)+MoveNext() at LiteDB.Engine.QueryPipe.Select(IEnumerable1 source, BsonExpression select)+MoveNext()
at LiteDB.Engine.QueryExecutor.<>c__DisplayClass10_0.<g__RunQuery|0>d.MoveNext()
at LiteDB.Engine.QueryExecutor.ExecuteQuery(Boolean executionPlan)
at LiteDB.Engine.LiteEngine.Query(String collection, Query query)
at LiteDB.LiteQueryable1.ToDocuments()+MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
at AKStreamWeb.Services.WebHookService.OnPlay(ReqForWebHookOnPlay req)
at lambda_method1377(Closure , Object , Object[] )

已注册的设备信息变更后,数据库内容没有更新

AKStreamWeb/Misc/SipServerCallBack.cs 代码中
sipChannel.SipChannelStatus != DevStatus.OFF) //只有视频设备并且是可用状态的进数据库
{
var obj = ORMHelper.Db.Select().Where(x =>
x.ChannelId.Equals(sipChannel.DeviceId) && x.DeviceId.Equals(sipChannel.ParentId) &&
x.DeviceStreamType.Equals(DeviceStreamType.GB28181)).First();
if (obj != null)
{
return;
}
如果设备已经存在了则直接返回,导致如果前端的设备信息发生变生化数据库中没有更新。
建议优化逻辑,增加update数据库逻辑更新设备的基础信息(如ChannelName、IpV4Address、IpV6Address)信息,实现设备信息与数据库信息的同步

获取设备目录失败

抓报文, 摄像头注册和心跳都正常发, 向摄像头获取设备目录时, 设备立即返回200 OK, 但是始终没见返回设备目录
image

IsLiveVideo跟直接调用流媒体的getMediaList结果不一致

有那么一种情况, AK请求直播流时提示超时, 但是实际ZLM在AK超时后开启了RTP推流, 在AK再次请求直播流, 一直提示流媒体响应超时, 在AK请求IsLiveVideo, 返回false, 在ZLM请求getMediaList, 却可以看到流正在推.
那么, AK请求直播流前能否先调用getMediaList, 如果正在推流, 则直接返回播放url

自动拉流

image
大佬好, 我走国标协议, 这里设置的autovideo为true, 是不是直接在VLC里播放流地址就会自动可以了, 不过我测试没法直接播放, 我还需要做什么设置吗

我手动激活通道请求流地址时拿到的流地址可以播放, 自动的不行

把AKStream部署到docker容器时, 外部无法访问到5800端口

将AKStream部署到docker容器, 容器使用ubuntu18.04, 将5800映射到宿主机, 发现无法连接到映射的端口, 但是能从外部ping通该端口, 进入容器, 查看日志, 无任何报错, 然后在容器内部执行curl 127.0.0.1:5800, 发现同样无法访问, 使用netstat -plt查看端口情况跟, 5800只出现在tcp6, 对比发现, SIP端口5060会同时出现在tcp和tcp6, sip服务外部访问正常

相同的部署方式, 部署在非docker容器, curl操作可以正常返回数据

当ZLMediaKit是使用Docker容器部署时的部署方式

请教一下,当ZLMediaKit是使用Docker部署的时候,需要怎样部署,AKStream才能正常使用呢?

ZLMediaKit的运行语句是:
docker run -id -p 1935:1935 -p 8080:80 -p 8554:554 -p 10000:10000 -p 10000:10000/udp panjjo/zlmediakit

如果可以的话,建议将AKStream做成一个Docker镜像,支持与ZLMediaKit一起使用docker-compose运行,那样的话使用起来就非常方便了。

非常感谢作者开源了这么好的项目,感谢!

对设备鉴权的一些建议

增加对单个设备的独立密码,
独立表存放设备ID与密码,设备注册时可以拿着ID取密码进行鉴权

提出该需求的原因
服务器处于公网环境下,设备较多时密码都是统一的,会被别有用心的人进行恶意的攻击,独立密码恰好可以有效的解决

获取设备目录失败

如下:
2021-05-12 14:43:46,481 [11] WARN AKStream - [SipServer]->Sip代理获取设备目录失败->{"Code":"None","Message":"无错误"}
2021-05-12 14:43:46,482 [11] ERROR AKStream - [AKStreamWeb]->设备目录获取失败->192.168.1.100-34020000001110000001

如何获取历史流进行回放

目前开放的_StreamLive_接口与_LiveVideo_似乎都是获取的实时视频流,请问该怎么获取到指定时间段内的历史流呢

GetSipDeviceList 无返回信息

日志收到了 Sip设备注册信息(无错误日志) ,但是videochannel没有信息,接口也返回空是为啥?

global.json部署版本问题

我自己的电脑本身是5.0.100
vs2019好像直接是这个版本,我一直以为是3.1的版本
编译要改成5.0.100才可以
否则不行

不过不知道是不是部署到实际系统上面是不是一定是5.0.100的

AKStreamKeeper.dll启动报错

[root@VM-16-14-centos AKStreamKeeper]# dotnet AKStreamKeeper.dll
2022-01-18 10:33:44,045 [1] INFO AKStream - [AKStreamKeeper]->Let's Go...
Unhandled exception. LibCommon.AkStreamException: Exception of type 'LibCommon.AkStreamException' was thrown.
at AKStreamKeeper.MediaServerInstance..ctor(String binPath, AKStreamKeeperConfig keeperConfig, String configPath) in /AKStream/AKStreamKeeper/MediaServerInstance.cs:line 88
at AKStreamKeeper.Common.StartupMediaServer() in /AKStream/AKStreamKeeper/Common.cs:line 117
at AKStreamKeeper.Common.Init() in /AKStream/AKStreamKeeper/Common.cs:line 739
at AKStreamKeeper.Program.Main(String[] args) in /AKStream/AKStreamKeeper/Program.cs:line 15
Aborted (core dumped)

通过 http://公网ip/index/api/setServerConfig?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&hook.enable=0 接口修改config.ini文件配置,想关掉推流和播放的鉴权。停止服务后重新启动报错。

摄像头本地录像回放功能有计划吗?

chatop2020
您好!用4G摄像头,录像需要存储在本地,所以需要基于国标的摄像头本地录像回放功能,不知道这个功能什么时候能实现?感谢您的辛苦付出!

如何让摄像头推回放流

你好,因为我使用的摄像头是带本地存储的,我想通过时间戳只让摄像头将自身的某一段时间回放流推送给流媒体,该怎么实现呢?谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.