下载AKStream源代码
下载AKStream源代码
git clone https://gitee.com/chatop2020/AKStream
VS2022打开AKStream,低于.net6的版本无法编译通过
打开 .sln 解决方案
如下配置AKStreamWeb
数据库配置:
MySQL
AKStreamWeb.json中配置
port 是MySQL的端口,user id 是用户名,password是密码,Initial Catlog 是数据库名称
数据库服务器地址Data Source,本机直接用127.0.0.1,运行AKStreamWeb会自动建表
{
"MediaServerFirstToRestart": true,
"DbType": "MySql",
"OrmConnStr": "Data Source=127.0.0.1;Port=3306;User ID=root;Password=123456; Initial Catalog=akstream;Charset=utf8; SslMode=none;Min pool size=1;",
"WebApiPort": 5800,
"AccessKey": "047I4WS1-U51UBO6W-1J4BT21P-MF17IT99-92J8WIHU-944Q4KIW",
"HttpClientTimeoutSec": 5,
"WaitEventTimeOutMSec": 10000,
"WaitSipRequestTimeOutMSec": 5000,
"DeletedRecordsExpiredDays": 30,
"EnableGB28181Server": true,
"EnableGB28181Client": true,
"ZlmFlvPrefix": "live"
}
配置完 重新生成一下
设置AKStreamweb为启动项,启动AKStreamweb,会有命令弹窗,保持不关闭
再打开一个VS窗口,进入解决方案,配置AKStreamKeeper
进入AKStreamKeeper.json 配置
"MediaServerPath"用附件的编译好的win版压缩包解压
{
"IpV4Address": "192.168.87.108",#结合自身改
"IpV6Address": "fe80::ecec:4729:2102:1b29%5", //fe80::c1cb:718c:9af5:d743%20 #结合自身改 fe80::6d01:b3b9:5a20:d8f4%16
"Candidate": "",
"WebApiPort": 6880,
//"MediaServerPath": " D:/CandCPP/CPPproject/ZLMediaKit/release/windows/Debug/Debug/MediaServer.exe",#结合自身改
//"MediaServerPath": "D:\\CandCPP\\CPPproject\\ZLMediaKit\\release\\windows\\Debug\\Debug\\MediaServer.exe",
"MediaServerPath": "E:\\ZLMediaKit_Win\\Debug\\MediaServer.exe",#结合自身改
"AkStreamWebRegisterUrl": "http://127.0.0.1:5800/MediaServer/WebHook/MediaServerKeepAlive",
"CutMergeFilePath": "D: \\CandCPP\\CPPproject\\AKSresource\\CutMergeFile",#结合自身改
"CustomRecordPathList": [
"D:\\CandCPP\\CPPproject\\AKSresource\\record",#结合自身改
"D:\\CandCPP\\CPPproject\\AKSresource\\record"#结合自身改
],
"UseSsl": false,
"MinRtpPort": 10001,
"MaxRtpPort": 20000,
"MinSendRtpPort": 20002,
"MaxSendRtpPort": 20200,
"RandomPort": false,
"FFmpegPath": "E:\\ffmpeg\\bin\\ffmpeg.exe", #下载解压个ffmpeg包,结合自身改
"AccessKey": "O7O4S089-PGDW6HTM-T4CV6K74-V6RIP1I6-9300G54F-Z03TI40Q",
"RtpPortCdTime": 3600,
"HttpClientTimeoutSec": 5,
"DisableShell": true,
"CheckLinuxDiskMount": false,
"ZLMediakitSSLFilePath": "./sslfiles/"
}
改完后重新生成
运行AKStreamKeeper
AKStream Windows配置和调试完成
-----------------------------------------------------------
管理平台
git clone https://github.com/langmansh/AKStreamNVR.git
只需要修改 public/env-config.js 文件,
REACT_APP_API_HOST为ZLMediaKit服务地址,
AKSTREAM_WEB_API为AKStreamWeb服务地址
下载安装 npm或yarn(最新版)
还原包 npm install(yarn install)
启动 npm run start (yarn run start)
保持上面web keeper的开启,管理界面会有数据
-----------------------------------------------------------------
如何用CB28181_DEMO客户端注册 推送GB流
查看自己的AKStreamWeb/Configs/SipServerConfig.json
{
"SipIpAddress": "192.168.87.108",#结合自己改
"SipIpV6Address": "fe80::ecec:4729:2102:1b29%5",#结合自己改
"ServerSipDeviceId": "33020000021180000001",#结合自己改
"SipPort": 5060,
"Realm": "3302000002",#结合自己改 ServerSipDeviceId的前10位
"GbVersion": "GB-2016",
"Authentication": true, //f 鉴权
"SipUsername": "admin",
"SipPassword": "12345678", //123#@!qwe
"MsgProtocol": "TCP",
"KeepAliveInterval": 30,
"KeepAliveLostNumber": 3,
"IpV6Enable": true,
"EncodingType": "UTF8",
"IsPassive": true,
"NoAuthenticationRequireds": [
{
"IpV4Address": "192.168.87.108", //192.168.2.92#结合自己改,免鉴权
"IpV6Address": "fe80::ecec:4729:2102:1b29%5", //fe80::8:807:2143:28a1%5
"DeviceId": "34020000001320000001" //"33020000021180000001"
}
]
}
SipClientConfig.json
{
"LocalIpAddress": "192.168.87.108",#结合自己改
"LocalPort": 5061,
"SipServerIpAddress": "192.168.87.108",#结合自己改
"SipServerPort": 5060,
"SipServerDeviceId": "33020000021180000001",#结合自己改
"Realm": "3302000002",#结合自己改
"SipUsername": "admin",
"SipPassword": "12345678", //123#@!qwe
"KeepAliveInterval": 10,
"KeepAliveLostNumber": 3,
"SipDeviceId": "33020000021190000002",
"Expiry": 3600,
"EncodingType": "UTF8",
"AkstreamWebHttpUrl": "http://127.0.0.1:5800/SipClient"
}
记得重新生成解决方案
利用客户端注册,配信息
配好后在注册界面,点击注册
注册成功后,在设备管理界面点击激活
视频广场等待10秒左右,会有画面,点进去播放器,有实时画面
ps:GB流注册成功会自动填写设备ID、通道ID,拉流方式选择none,视屏地址不需要填
RTSP和RTMP 推送要自己设置 视频地址,拉流方式也要选择后两个