Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d671661
Update deploy.sh
itchangc Apr 23, 2023
f754750
Merge pull request #60 from itchangc/master
chatop2020 Apr 24, 2023
1ca45f0
added the configuration parameter CheckLinuxDiskMount
chatop2020 Apr 27, 2023
f87ec88
Added and improved the disk monitoring function, which stops recordin…
chatop2020 May 8, 2023
ba45f1b
add Config about listenip
chatop2020 Jun 20, 2023
abdf0fc
update struct of ReqZLMediaKitAddStreamProxy
chatop2020 Jul 14, 2023
db6834b
调整 git 忽略规则
dodu2014 Jul 22, 2023
bbcf4aa
fix: 更新 nuget 包并修复环境路径错误
dodu2014 Jul 22, 2023
69747ad
fix: 修复并更新md5过期方法
dodu2014 Jul 22, 2023
e2f9dfa
chore: 更新过时的方法
dodu2014 Jul 27, 2023
81fc894
chore: 更新告警提示
dodu2014 Jul 27, 2023
a2c86b0
For added security, you can use swagger debugging tools only when com…
chatop2020 Aug 2, 2023
d9b7a7b
fix bug
chatop2020 Aug 2, 2023
138b266
调整 git 忽略 vs vscode 配置
dodu2014 Aug 5, 2023
aa52d69
fix: 更新 nuget 包并修复环境路径错误
dodu2014 Aug 5, 2023
791eec7
fix: 修复并更新过期方法
dodu2014 Aug 5, 2023
f735346
feat: 与新版 zlm 配置同步
dodu2014 Aug 5, 2023
bbdedb0
Fix the problem that mediaserver cannot run because the config.ini fi…
chatop2020 Aug 8, 2023
13fd5e6
Merge pull request #63 from dodu2014/dev-commit
chatop2020 Aug 8, 2023
3baf3ab
Merge pull request #64 from dodu2014/dev-zlm-config
chatop2020 Aug 8, 2023
def2681
Improve the configuration attribute of MediaServer
chatop2020 Aug 8, 2023
7a2a057
Replace the default communication key
chatop2020 Aug 8, 2023
857f12b
priority code to the.local profile
chatop2020 Aug 9, 2023
ae3514a
fix: 修复 swagger api 文档无中文注释的问题,并简化配置
dodu2014 Aug 10, 2023
98f425f
docs: 增加api控制器的xml描述
dodu2014 Aug 10, 2023
a5e8242
Clean up connectionless data when the system is idle (connectionless …
chatop2020 Aug 12, 2023
9202f85
Merge pull request #65 from dodu2014/dev-commit
chatop2020 Aug 15, 2023
1e5a10c
Added rtsp authentication functions
chatop2020 Aug 28, 2023
a4bcee6
Create dotnet.yml
chatop2020 Aug 28, 2023
7b33e26
up
chatop2020 Aug 29, 2023
c6ede83
up
chatop2020 Aug 29, 2023
98af1fd
up
chatop2020 Aug 29, 2023
59c88c1
fix bug
chatop2020 Aug 29, 2023
c24f1b1
fix md5util bug
chatop2020 Aug 29, 2023
f579ecd
up
chatop2020 Aug 29, 2023
7ce4ff3
up
chatop2020 Aug 29, 2023
886cfb5
up
chatop2020 Aug 29, 2023
a520e3e
Fix the problem caused by the inability to use Thread.Suspend under l…
chatop2020 Aug 30, 2023
458fd48
The heartbeat period attribute KeepAliveTimeSpentMS of the Sip device…
chatop2020 Sep 1, 2023
f357c81
update the return parameters of the on_publish event in webhook synch…
chatop2020 Sep 6, 2023
079cecb
Exclude clipping merge directories when cleaning data
chatop2020 Sep 11, 2023
bb824f4
Update Dockerfile-Web
m-coder-stack Sep 11, 2023
86bed6b
Merge pull request #70 from m-coder-stack/m-coder-stack-patch-1
chatop2020 Sep 13, 2023
7c0f9f2
upgrade freesql
chatop2020 Sep 23, 2023
2ad389a
Try to adapt to Kingbase database
chatop2020 Oct 20, 2023
e0b6009
up
chatop2020 Oct 20, 2023
e52d59d
fix:修改筛选条件,之前的前后60分钟会漏数据
TaterCheng Nov 1, 2023
be57526
fix:之前的获取输出数据的方法会造成卡死
TaterCheng Nov 1, 2023
284dbf9
Remove the automatic tested re -test in the adDStreamProxy to 0 to en…
chatop2020 Nov 4, 2023
febf443
Optimize the introduction
chatop2020 Nov 4, 2023
315cf32
reformat code
chatop2020 Nov 4, 2023
2d66489
fix commnt
chatop2020 Nov 4, 2023
31cca27
Merge pull request #73 from TaterCheng/fixbug
chatop2020 Nov 4, 2023
af64943
up
chatop2020 Nov 4, 2023
986d3fc
up
chatop2020 Nov 4, 2023
d5756d8
up
chatop2020 Nov 4, 2023
198f356
fixbug:只有在TCP模式a=setup才需要设置
TaterCheng Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ ehthumbs.db
Thumbs.db
.DS_Store
*/.DS_Store
.vscode/**
.vs/**
*.csproj.user
Binary file modified AKStreamKeeper/AKStream.ldb
Binary file not shown.
26 changes: 12 additions & 14 deletions AKStreamKeeper/AKStreamKeeper.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>default</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DocumentationFile>bin\Debug\net6.0\AKStreamKeeper.xml</DocumentationFile>
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>bin\Debug\net5.0\AKStreamKeeper.xml</DocumentationFile>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>default</LangVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,9 +13,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.20" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
<None Update="Config\logconfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>


Expand Down
55 changes: 55 additions & 0 deletions AKStreamKeeper/AutoTask/DiskUseableChecker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using LibCommon;

namespace AKStreamKeeper.AutoTask;

public class DiskUseableChecker
{
public DiskUseableChecker()
{
if (Common.AkStreamKeeperConfig.CheckLinuxDiskMount == true &&
RuntimeInformation.IsOSPlatform(OSPlatform.Linux) &&
Common.AkStreamKeeperConfig.CustomRecordPathList != null &&
Common.AkStreamKeeperConfig.CustomRecordPathList.Count > 0)
{
new Thread(new ThreadStart(delegate
{
try
{
Checker();
}
catch
{
}
})).Start();
}
}

private void Checker()
{
while (true)
{
try
{
lock (Common.DisksUseable)
{
Common.DisksUseable.Clear();
foreach (var path in Common.AkStreamKeeperConfig
.CustomRecordPathList)
{
var ret = UtilsHelper.DirAreMounttedAndWriteableForLinux(path);
Common.DisksUseable.Add(path, ret);
}
}
}
catch (Exception ex)
{
GCommon.Logger.Error($"[{Common.LoggerHead}]->执行磁盘挂载检测时出现异常->{ex.Message}\r\n{ex.StackTrace}");
}

Thread.Sleep(5000);
}
}
}
32 changes: 32 additions & 0 deletions AKStreamKeeper/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public static class Common
private static DateTime _sendDataTick = DateTime.Now;
private static ulong _timerCount = 0;
private static string _oldMediaServerId = "";
private static Dictionary<string, int> _disksUseable = new Dictionary<string, int>();
private static DiskUseableChecker _diskUseableChecker;

public static string OldMediaServerId
{
Expand Down Expand Up @@ -79,6 +81,15 @@ public static Timer PerFormanceInfoTimer

public static MediaServerInstance MediaServerInstance;

/// <summary>
/// 挂载的硬盘是否可用
/// </summary>
public static Dictionary<string, int> DisksUseable
{
get => _disksUseable;
set => _disksUseable = value;
}

static Common()
{
#if (DEBUG)
Expand Down Expand Up @@ -546,6 +557,7 @@ private static bool ReadConfig(out ResponseStruct rs)
KeeperPerformanceInfo = _keeperSystemInfo.GetSystemInfoObject();
}


if (!File.Exists(_configPath))
{
//创建文件
Expand All @@ -570,6 +582,7 @@ private static bool ReadConfig(out ResponseStruct rs)
var text = File.ReadAllText("/etc/hostname").Trim().ToLower();
if (text.Contains("gdn") || text.Contains("guardian") || text.Contains("rasp"))
{
_akStreamKeeperConfig.CheckLinuxDiskMount = true;
_akStreamKeeperConfig.RecordSec = 120;
var _jsonText = JsonHelper.ToJson(_akStreamKeeperConfig, Formatting.Indented);
if (!string.IsNullOrEmpty(_jsonText))
Expand Down Expand Up @@ -742,6 +755,22 @@ private static void OnTimedEvent(object source, ElapsedEventArgs e)
tmpKeepAlive.MediaServerIsRunning = MediaServerInstance.IsRunning;
tmpKeepAlive.Version = Version;
tmpKeepAlive.ZlmBuildDateTime = MediaServerInstance.ZlmBuildDateTime;
tmpKeepAlive.CutMergeFilePath = _akStreamKeeperConfig.CutMergeFilePath;
lock (DisksUseable)
{
if (DisksUseable != null && DisksUseable.Count > 0)
{
tmpKeepAlive.DisksUseable = new Dictionary<string, int>();
foreach (var dic in DisksUseable)
{
tmpKeepAlive.DisksUseable.Add(dic.Key, dic.Value);
}
}
else
{
tmpKeepAlive.DisksUseable = null;
}
}

string reqData = JsonHelper.ToJson(tmpKeepAlive, Formatting.Indented);

Expand Down Expand Up @@ -806,6 +835,8 @@ public static void Init()
_configPath = GCommon.OutConfigPath + "AKStreamKeeper.json";
}

_configPath = UtilsHelper.FindPreferredConfigFile(_configPath); //查找优先使用的配置文件

GCommon.Logger.Info(
$"[{LoggerHead}]->Let's Go...");
GCommon.Logger.Info(
Expand Down Expand Up @@ -853,6 +884,7 @@ public static void Init()
$"[{LoggerHead}]->流媒体服务器启动成功->进程ID:{MediaServerInstance.GetPid()}");

AutoRtpPortClean = new AutoRtpPortClean(); //启动不使用rtp端口自动清理
_diskUseableChecker = new DiskUseableChecker(); //启动磁盘挂载监控

if (!string.IsNullOrEmpty(AkStreamKeeperConfig.CutMergeFilePath))
{
Expand Down
17 changes: 10 additions & 7 deletions AKStreamKeeper/Config/AKStreamKeeper.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"IpV4Address": "192.168.2.94",
"IpV4Address": "127.0.0.1",
"IpV6Address": "fe80::8:807:2143:28a1%5",
"Candidate":"192.168.2.94",
"Candidate":"127.0.0.1",
"WebApiPort": 6880,
"MediaServerPath": "/Users/qiuzhouwei/SourceTemp/ZLMediaKit/release/darwin/Debug/MediaServer",
"MediaServerPath": "/Users/qiuzhouwei/Sources/ZLMediaKit/release/darwin/Debug/MediaServer",
"AkStreamWebRegisterUrl": "http://127.0.0.1:5800/MediaServer/WebHook/MediaServerKeepAlive",
"CutMergeFilePath": "/Users/qiuzhouwei/Downloads/CutMergeFile",
"CustomRecordPathList": [
Expand All @@ -15,10 +15,13 @@
"MinSendRtpPort": 20002,
"MaxSendRtpPort": 20200,
"RandomPort": false,
"FFmpegPath": "/usr/local/bin/ffmpeg",
"AccessKey": "O7O4S089-PGDW6HTM-T4CV6K74-V6RIP1I6-9300G54F-Z03TI40Q",
"FFmpegPath": "/opt/homebrew/bin/ffmpeg",
"AccessKey": "047I4WS1-U51UBO6W-1J4BT21P-MF17IT99-92J8WIHU-944Q4KIW",
"RtpPortCdTime": 3600,
"HttpClientTimeoutSec": 5,
"DisableShell": true,
"ZLMediakitSSLFilePath": "./sslfiles/"
"DisableShell": false,
"CheckLinuxDiskMount": false,
"ZLMediakitSSLFilePath": "./sslfiles/",
"ListenIp": "127.0.0.1",
"EnableRtspAuth": true
}
2 changes: 1 addition & 1 deletion AKStreamKeeper/Config/logconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<!-- Setup the root category, add the appenders and set the default level -->
<root>
<level value="INFO" />
<level value="ALL" />
<appender-ref ref="ConsoleAppender" />
<appender-ref ref="RollingLogFileAppender" />
</root>
Expand Down
3 changes: 3 additions & 0 deletions AKStreamKeeper/Controllers/ApiServiceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

namespace AKStreamKeeper.Controllers
{
/// <summary>
/// 流媒体服务器相关接口
/// </summary>
[Log]
[AuthVerify]
[ApiController]
Expand Down
3 changes: 3 additions & 0 deletions AKStreamKeeper/Controllers/CutMergeServiceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace AKStreamKeeper.Controllers
{
/// <summary>
/// 裁剪与合并视频相关接口
/// </summary>
[Log]
[AuthVerify]
[ApiController]
Expand Down
Loading