新增 系统配置项[处理任务 下载速度...]
This commit is contained in:
parent
6b9fc167ee
commit
972fba9959
|
|
@ -19,6 +19,24 @@
|
||||||
"ffmpeg.exe"
|
"ffmpeg.exe"
|
||||||
],
|
],
|
||||||
"WindowsBackUpIgnoreList": []
|
"WindowsBackUpIgnoreList": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "阿里云_代理",
|
||||||
|
"ServerList": [],
|
||||||
|
"LinuxServerList": [
|
||||||
|
{
|
||||||
|
"UserName": "heyang",
|
||||||
|
"Pwd": "AAC53130AF118B652BCED77C39B959F9",
|
||||||
|
"Host": "10.127.127.77:10022",
|
||||||
|
"NickName": "",
|
||||||
|
"IIsFireUrl": null,
|
||||||
|
"DockerFireUrl": "",
|
||||||
|
"WindowsServiceFireUrl": null,
|
||||||
|
"LinuxServiceFireUrl": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"IgnoreList": [],
|
||||||
|
"WindowsBackUpIgnoreList": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"IIsConfig": {
|
"IIsConfig": {
|
||||||
|
|
@ -34,6 +52,15 @@
|
||||||
"DockerEnvName": null,
|
"DockerEnvName": null,
|
||||||
"DockerVolume": null,
|
"DockerVolume": null,
|
||||||
"DockerOther": null
|
"DockerOther": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"EnvName": "阿里云_代理",
|
||||||
|
"ConfigName": "",
|
||||||
|
"LinuxEnvParam": null,
|
||||||
|
"DockerPort": null,
|
||||||
|
"DockerEnvName": null,
|
||||||
|
"DockerVolume": null,
|
||||||
|
"DockerOther": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -50,6 +77,15 @@
|
||||||
"DockerEnvName": null,
|
"DockerEnvName": null,
|
||||||
"DockerVolume": null,
|
"DockerVolume": null,
|
||||||
"DockerOther": null
|
"DockerOther": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"EnvName": "阿里云_代理",
|
||||||
|
"ConfigName": "",
|
||||||
|
"LinuxEnvParam": null,
|
||||||
|
"DockerPort": null,
|
||||||
|
"DockerEnvName": null,
|
||||||
|
"DockerVolume": null,
|
||||||
|
"DockerOther": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -66,17 +102,26 @@
|
||||||
"DockerEnvName": null,
|
"DockerEnvName": null,
|
||||||
"DockerVolume": null,
|
"DockerVolume": null,
|
||||||
"DockerOther": null
|
"DockerOther": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"EnvName": "阿里云_代理",
|
||||||
|
"ConfigName": "",
|
||||||
|
"LinuxEnvParam": null,
|
||||||
|
"DockerPort": null,
|
||||||
|
"DockerEnvName": null,
|
||||||
|
"DockerVolume": null,
|
||||||
|
"DockerOther": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"DockerConfig": {
|
"DockerConfig": {
|
||||||
"Prot": "9040",
|
"Prot": "9040",
|
||||||
"AspNetCoreEnv": "",
|
"AspNetCoreEnv": "",
|
||||||
"LastEnvName": "10楼刀片机",
|
"LastEnvName": "阿里云_代理",
|
||||||
"RemoveDaysFromPublished": "10",
|
"RemoveDaysFromPublished": "10",
|
||||||
"WorkDir": "/home/hy/",
|
"WorkDir": "/home/heyang/",
|
||||||
"Volume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
"Volume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||||
"Other": "",
|
"Other": "-e va_args=\"NoTask\" --name videoanalysis",
|
||||||
"EnvPairList": [
|
"EnvPairList": [
|
||||||
{
|
{
|
||||||
"EnvName": "10楼刀片机",
|
"EnvName": "10楼刀片机",
|
||||||
|
|
@ -85,7 +130,16 @@
|
||||||
"DockerPort": "9040",
|
"DockerPort": "9040",
|
||||||
"DockerEnvName": "",
|
"DockerEnvName": "",
|
||||||
"DockerVolume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
"DockerVolume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||||
"DockerOther": ""
|
"DockerOther": "-e va_args=\"NoTask1\""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"EnvName": "阿里云_代理",
|
||||||
|
"ConfigName": null,
|
||||||
|
"LinuxEnvParam": null,
|
||||||
|
"DockerPort": "9040",
|
||||||
|
"DockerEnvName": "",
|
||||||
|
"DockerVolume": "/home/hy/VideoAnalysis/AICore:/app/AICore/_Static;/home/hy/VideoAnalysis/TaskCachedFile:/app/TaskCachedFile",
|
||||||
|
"DockerOther": "-e va_args=\"NoTask\" --name videoanalysis"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ namespace Learn.VideoAnalysis.Controllers
|
||||||
var hashEntries = task.GetType()
|
var hashEntries = task.GetType()
|
||||||
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
|
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
|
||||||
.ToDictionary(s => s.Name, s => s.GetValue(task));
|
.ToDictionary(s => s.Name, s => s.GetValue(task));
|
||||||
|
await videoTaskDB.InsertAsync(task);
|
||||||
RedisExpand.Redis.HMSet(RedisExpandKey.Task(task.Id), hashEntries);
|
RedisExpand.Redis.HMSet(RedisExpandKey.Task(task.Id), hashEntries);
|
||||||
RedisExpand.Redis.LPush(RedisExpandKey.ChannelKey, task.Id);
|
RedisExpand.Redis.LPush(RedisExpandKey.ChannelKey, task.Id);
|
||||||
return Ok(task.Id);
|
return Ok(task.Id);
|
||||||
|
|
|
||||||
|
|
@ -26,31 +26,43 @@ namespace Learn.VideoAnalysis.Controllers.Dto
|
||||||
/// 视频编码
|
/// 视频编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string VideoCode { get; set; }
|
public string VideoCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 视频文件名称
|
/// 视频文件名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string VideoName { get; set; }
|
public string VideoName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 内容类型
|
||||||
|
/// </summary>
|
||||||
|
public AttachmentsInfoType AttachmentsInfoType { get; set; }
|
||||||
}
|
}
|
||||||
public class NodePackageReq
|
public class NodePackageReq
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 媒体路径
|
/// 录播结构目录节点编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "文件节点ID是必填项")]
|
[Required(ErrorMessage = "目录节点编号是必填项")]
|
||||||
public long NodeId { get; set; }
|
public long NodeId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 科目类型
|
||||||
|
/// </summary>
|
||||||
|
[Required(ErrorMessage = "科目类型是必填项")]
|
||||||
|
public SubjectEnum SubjectType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务类型
|
/// 任务类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TaskTypeEnum? TaskType { get; set; }
|
[Required(ErrorMessage = "任务类型是必填项")]
|
||||||
/// <summary>
|
public TaskTypeEnum TaskType { get; set; }
|
||||||
/// 学科类型
|
|
||||||
/// </summary>
|
|
||||||
public SubjectEnum? SubjectType { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 视频列表
|
/// 视频列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "文件节点ID是必填项")]
|
[Required(ErrorMessage = "文件数量是必填项")]
|
||||||
public List<StructurePageContentAnalyzeItem> AnalyzeItems { get; set; }
|
public List<StructurePageContentAnalyzeItem> AnalyzeItems { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 视频处理 请求
|
/// 视频处理 请求
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,6 @@ namespace Learn.VideoAnalysis.Controllers
|
||||||
public async Task<IActionResult> NodePackage(NodePackageReq req)
|
public async Task<IActionResult> NodePackage(NodePackageReq req)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{DateTime.Now} 文件包订阅请求 req=" + JsonSerializer.Serialize(req));
|
Console.WriteLine($"{DateTime.Now} 文件包订阅请求 req=" + JsonSerializer.Serialize(req));
|
||||||
if (req is null || req.NodeId == 0)
|
|
||||||
return BadRequest("无效的提交数据");
|
|
||||||
if (req.AnalyzeItems is null || req.AnalyzeItems.Count() == 0)
|
if (req.AnalyzeItems is null || req.AnalyzeItems.Count() == 0)
|
||||||
return BadRequest("无效视频列表数据");
|
return BadRequest("无效视频列表数据");
|
||||||
var videos = new List<VideoTask>(req.AnalyzeItems.Count);
|
var videos = new List<VideoTask>(req.AnalyzeItems.Count);
|
||||||
|
|
@ -90,10 +88,14 @@ namespace Learn.VideoAnalysis.Controllers
|
||||||
{
|
{
|
||||||
var np = new NodePackageInfo()
|
var np = new NodePackageInfo()
|
||||||
{
|
{
|
||||||
MaterialId = s.MaterialId,
|
|
||||||
VideoCode = s.VideoCode,
|
VideoCode = s.VideoCode,
|
||||||
NodeId = req.NodeId,
|
AttachmentsInfoType = s.AttachmentsInfoType,
|
||||||
|
MaterialId = s.MaterialId,
|
||||||
StructurePageContentId = s.StructurePageContentId,
|
StructurePageContentId = s.StructurePageContentId,
|
||||||
|
VideoName = s.VideoName,
|
||||||
|
NodeId = req.NodeId,
|
||||||
|
TaskType = req.TaskType,
|
||||||
|
SubjectType = req.SubjectType,
|
||||||
};
|
};
|
||||||
nodePackages.Add(np);
|
nodePackages.Add(np);
|
||||||
if (videoIdArr.Contains(s.VideoCode))
|
if (videoIdArr.Contains(s.VideoCode))
|
||||||
|
|
@ -105,7 +107,6 @@ namespace Learn.VideoAnalysis.Controllers
|
||||||
ApiToken = "",
|
ApiToken = "",
|
||||||
Type = req.TaskType,
|
Type = req.TaskType,
|
||||||
Subject = req.SubjectType,
|
Subject = req.SubjectType,
|
||||||
Tag = req.NodeId.ToString(),
|
|
||||||
TagId = s.VideoCode,
|
TagId = s.VideoCode,
|
||||||
MediaUrl =string.Empty,
|
MediaUrl =string.Empty,
|
||||||
MediaName = s.VideoName
|
MediaName = s.VideoName
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,9 @@ COPY sources.list /etc/apt/sources.list
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y ffmpeg
|
RUN apt-get install -y ffmpeg
|
||||||
|
|
||||||
|
# 给我们要传的参数一个初始值
|
||||||
|
ENV va_args=
|
||||||
|
|
||||||
ENV ASPNETCORE_URLS=http://+:9040
|
ENV ASPNETCORE_URLS=http://+:9040
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "Learn.VideoAnalysis.dll"]
|
ENTRYPOINT dotnet Learn.VideoAnalysis.dll $va_args
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
using Coravel;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using VideoAnalysisCore.Common;
|
||||||
|
using VideoAnalysisCore.Job;
|
||||||
|
|
||||||
|
namespace Learn.VideoAnalysis.Expand
|
||||||
|
{
|
||||||
|
public static class AppConfigExpand
|
||||||
|
{
|
||||||
|
public static void AddAppConfig(this ConfigurationManager cm, string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{DateTime.Now}=>初始化 AppConfig");
|
||||||
|
cm.GetSection("AppConfig").Bind(AppCommon.Config);
|
||||||
|
var argList= args.ToList();
|
||||||
|
var eArgs = Environment.GetEnvironmentVariable("va_args");
|
||||||
|
if (!string.IsNullOrEmpty(eArgs))
|
||||||
|
argList.AddRange(eArgs.Split(","));
|
||||||
|
|
||||||
|
Console.WriteLine("===========================================");
|
||||||
|
Console.WriteLine("启动参数如下:");
|
||||||
|
Console.WriteLine(string.Join(',', args));
|
||||||
|
Console.WriteLine("===========================================");
|
||||||
|
|
||||||
|
if (args.Contains("NoTask"))
|
||||||
|
AppCommon.Config.TaskSetting.ProcessingTasks = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,6 @@ namespace Learn.VideoAnalysis
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddRazorComponents()
|
builder.Services.AddRazorComponents()
|
||||||
.AddInteractiveServerComponents();
|
.AddInteractiveServerComponents();
|
||||||
|
|
@ -52,11 +51,12 @@ namespace Learn.VideoAnalysis
|
||||||
});
|
});
|
||||||
|
|
||||||
//°ó¶¨ appsetting ÅäÖÃ
|
//°ó¶¨ appsetting ÅäÖÃ
|
||||||
builder.Configuration.GetSection("AppConfig").Bind(AppCommon.Config);
|
|
||||||
|
|
||||||
//³õʼ»¯ ²å¼þ
|
//³õʼ»¯ ²å¼þ
|
||||||
|
builder.Configuration.AddAppConfig(args);
|
||||||
|
|
||||||
builder.Services.AddSqlSugarExpand();
|
builder.Services.AddSqlSugarExpand();
|
||||||
builder.Services.AddDownloadFileExpand(2);
|
builder.Services.AddDownloadFileExpand();
|
||||||
builder.Services.AddAlibabaCloudVod();
|
builder.Services.AddAlibabaCloudVod();
|
||||||
builder.Services.AddRedisExpand();
|
builder.Services.AddRedisExpand();
|
||||||
builder.Services.AddSpeakerAI();
|
builder.Services.AddSpeakerAI();
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AppConfig": {
|
"AppConfig": {
|
||||||
|
"TaskSetting": {
|
||||||
|
"DownloadSpeed": 8,
|
||||||
|
"ProcessingTasks": true //接收任务?
|
||||||
|
},
|
||||||
"Subsystem": {
|
"Subsystem": {
|
||||||
"蓝鲸智库": {
|
"蓝鲸智库": {
|
||||||
"APIUrl": "https://zyapi.23544.com",
|
"APIUrl": "https://zyapi.23544.com",
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"AppConfig": {
|
"AppConfig": {
|
||||||
"ID": 1, //程序唯一值
|
"ID": 1, //程序唯一值
|
||||||
|
"TaskSetting": {
|
||||||
|
"DownloadSpeed": 2,
|
||||||
|
"ProcessingTasks": true,//接收任务?
|
||||||
|
},
|
||||||
"Admin": {
|
"Admin": {
|
||||||
"Account": "admin",
|
"Account": "admin",
|
||||||
"Password": "q1w2e3!@#"
|
"Password": "q1w2e3!@#"
|
||||||
|
|
|
||||||
|
|
@ -319,167 +319,4 @@ namespace VideoAnalysisCore.Common
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ffmpeg配置
|
|
||||||
/// </summary>
|
|
||||||
public class GptConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 请求 公开的服务地址
|
|
||||||
/// </summary>
|
|
||||||
public string Host { get; set; } = string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// api的密钥
|
|
||||||
/// </summary>
|
|
||||||
public string ApiKey { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 文本模型 配置
|
|
||||||
/// </summary>
|
|
||||||
public class ChatGptConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// KIMI
|
|
||||||
/// <para></para>
|
|
||||||
/// </summary>
|
|
||||||
public GptConfig ChatGpt { get; set; } = new GptConfig();
|
|
||||||
public GptConfig DeepSeek { get; set; } = new GptConfig();
|
|
||||||
public GptConfig KIMI { get; set; } = new GptConfig();
|
|
||||||
public GptConfig aliyun { get; set; } = new GptConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ffmpeg配置
|
|
||||||
/// </summary>
|
|
||||||
public class FFmpegConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 音频切片时间段
|
|
||||||
/// <para>0不切片</para>
|
|
||||||
/// </summary>
|
|
||||||
public int TimeSlice { get; set; } = 0;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Whisper配置
|
|
||||||
/// </summary>
|
|
||||||
public class WhisperConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 模型名称
|
|
||||||
/// </summary>
|
|
||||||
public string ModelName { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 管理界面Admin账号
|
|
||||||
/// </summary>
|
|
||||||
public class AdminConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 账号
|
|
||||||
/// </summary>
|
|
||||||
public string Account { get; set; } = string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// 密码
|
|
||||||
/// </summary>
|
|
||||||
public string Password { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// redis配置
|
|
||||||
/// </summary>
|
|
||||||
public class RedisConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// redis连接字符串
|
|
||||||
/// </summary>
|
|
||||||
public string ConnectionString { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DBConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 主库链接
|
|
||||||
/// </summary>
|
|
||||||
public string ConnectionString { get; set; }=string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// 数据库类型
|
|
||||||
/// </summary>
|
|
||||||
public IocDbType SqlType { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 启动时更新表结构
|
|
||||||
/// </summary>
|
|
||||||
public bool UpdateTable { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 配置ID
|
|
||||||
/// </summary>
|
|
||||||
public long ConfigId { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 子系统配置
|
|
||||||
/// </summary>
|
|
||||||
public class SubsystemInfo
|
|
||||||
{
|
|
||||||
public string APIUrl { get; set; } = string.Empty;
|
|
||||||
public string Token { get; set; } = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 子系统配置
|
|
||||||
/// </summary>
|
|
||||||
public class SubsystemConfig
|
|
||||||
{
|
|
||||||
public SubsystemInfo 蓝鲸智库 { get; set; } = new SubsystemInfo();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 应用程序配置
|
|
||||||
/// </summary>
|
|
||||||
public class AppConfig
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 程序ID
|
|
||||||
/// </summary>
|
|
||||||
public string ID { get; set; } = string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// Admin
|
|
||||||
/// </summary>
|
|
||||||
public AdminConfig Admin { get; set; } = new AdminConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// 子系统
|
|
||||||
/// </summary>
|
|
||||||
public SubsystemConfig Subsystem { get; set; } = new SubsystemConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// redis
|
|
||||||
/// </summary>
|
|
||||||
public RedisConfig Redis { get; set; } = new RedisConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// Whisper AI
|
|
||||||
/// </summary>
|
|
||||||
public WhisperConfig Whisper { get; set; } = new WhisperConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// FFmpeg
|
|
||||||
/// </summary>
|
|
||||||
public FFmpegConfig FFmpeg { get; set; } = new FFmpegConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// ChatGpt
|
|
||||||
/// </summary>
|
|
||||||
public ChatGptConfig ChatGpt { get; set; } = new ChatGptConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// 阿里云视频点播配置
|
|
||||||
/// </summary>
|
|
||||||
public AlibabaCloudVodConfig AlibabaCloudVod { get; set; } = new AlibabaCloudVodConfig();
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据库配置
|
|
||||||
/// </summary>
|
|
||||||
public DBConfig DB { get; set; } = new DBConfig();
|
|
||||||
/// <summary>
|
|
||||||
/// 其他数据库配置
|
|
||||||
/// </summary>
|
|
||||||
public DBConfig[] OtherDBArr { get; set; } = Array.Empty<DBConfig>();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
using SqlSugar.IOC;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace VideoAnalysisCore.Common
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 应用程序配置
|
||||||
|
/// </summary>
|
||||||
|
public class AppConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 程序ID
|
||||||
|
/// </summary>
|
||||||
|
public string ID { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// Admin
|
||||||
|
/// </summary>
|
||||||
|
public AdminConfig Admin { get; set; } = new AdminConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public SubsystemConfig Subsystem { get; set; } = new SubsystemConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// redis
|
||||||
|
/// </summary>
|
||||||
|
public RedisConfig Redis { get; set; } = new RedisConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// Whisper AI
|
||||||
|
/// </summary>
|
||||||
|
public WhisperConfig Whisper { get; set; } = new WhisperConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// FFmpeg
|
||||||
|
/// </summary>
|
||||||
|
public FFmpegConfig FFmpeg { get; set; } = new FFmpegConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// ChatGpt
|
||||||
|
/// </summary>
|
||||||
|
public ChatGptConfig ChatGpt { get; set; } = new ChatGptConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// 阿里云视频点播配置
|
||||||
|
/// </summary>
|
||||||
|
public AlibabaCloudVodConfig AlibabaCloudVod { get; set; } = new AlibabaCloudVodConfig();
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据库配置
|
||||||
|
/// </summary>
|
||||||
|
public DBConfig DB { get; set; } = new DBConfig();
|
||||||
|
/// <summary>
|
||||||
|
/// 其他数据库配置
|
||||||
|
/// </summary>
|
||||||
|
public DBConfig[] OtherDBArr { get; set; } = Array.Empty<DBConfig>();
|
||||||
|
/// <summary>
|
||||||
|
/// 系统接收任务设置配置
|
||||||
|
/// </summary>
|
||||||
|
public TaskSettingConfig TaskSetting { get; set; } = new TaskSettingConfig();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TaskSettingConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 下载速度MB/S
|
||||||
|
/// </summary>
|
||||||
|
public int DownloadSpeed { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否接收任务
|
||||||
|
/// </summary>
|
||||||
|
public bool ProcessingTasks { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// ffmpeg配置
|
||||||
|
/// </summary>
|
||||||
|
public class GptConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 请求 公开的服务地址
|
||||||
|
/// </summary>
|
||||||
|
public string Host { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// api的密钥
|
||||||
|
/// </summary>
|
||||||
|
public string ApiKey { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 文本模型 配置
|
||||||
|
/// </summary>
|
||||||
|
public class ChatGptConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// KIMI
|
||||||
|
/// <para></para>
|
||||||
|
/// </summary>
|
||||||
|
public GptConfig ChatGpt { get; set; } = new GptConfig();
|
||||||
|
public GptConfig DeepSeek { get; set; } = new GptConfig();
|
||||||
|
public GptConfig KIMI { get; set; } = new GptConfig();
|
||||||
|
public GptConfig aliyun { get; set; } = new GptConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ffmpeg配置
|
||||||
|
/// </summary>
|
||||||
|
public class FFmpegConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 音频切片时间段
|
||||||
|
/// <para>0不切片</para>
|
||||||
|
/// </summary>
|
||||||
|
public int TimeSlice { get; set; } = 0;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Whisper配置
|
||||||
|
/// </summary>
|
||||||
|
public class WhisperConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 模型名称
|
||||||
|
/// </summary>
|
||||||
|
public string ModelName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 管理界面Admin账号
|
||||||
|
/// </summary>
|
||||||
|
public class AdminConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 账号
|
||||||
|
/// </summary>
|
||||||
|
public string Account { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 密码
|
||||||
|
/// </summary>
|
||||||
|
public string Password { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// redis配置
|
||||||
|
/// </summary>
|
||||||
|
public class RedisConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// redis连接字符串
|
||||||
|
/// </summary>
|
||||||
|
public string ConnectionString { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DBConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主库链接
|
||||||
|
/// </summary>
|
||||||
|
public string ConnectionString { get; set; } = string.Empty;
|
||||||
|
/// <summary>
|
||||||
|
/// 数据库类型
|
||||||
|
/// </summary>
|
||||||
|
public IocDbType SqlType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 启动时更新表结构
|
||||||
|
/// </summary>
|
||||||
|
public bool UpdateTable { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 配置ID
|
||||||
|
/// </summary>
|
||||||
|
public long ConfigId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统配置
|
||||||
|
/// </summary>
|
||||||
|
public class SubsystemInfo
|
||||||
|
{
|
||||||
|
public string APIUrl { get; set; } = string.Empty;
|
||||||
|
public string Token { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统配置
|
||||||
|
/// </summary>
|
||||||
|
public class SubsystemConfig
|
||||||
|
{
|
||||||
|
public SubsystemInfo 蓝鲸智库 { get; set; } = new SubsystemInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,10 +21,10 @@ namespace VideoAnalysisCore.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化下载器
|
/// 初始化下载器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="DownloadSpeed">下载速度mb/s 默认8</param>
|
/// <param name="DownloadSpeed">下载速度mb/s </param>
|
||||||
public static void AddDownloadFileExpand(this IServiceCollection services, int DownloadSpeed)
|
public static void AddDownloadFileExpand(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
DownloadFile.DownloadSpeed = DownloadSpeed;
|
DownloadFile.DownloadSpeed = AppCommon.Config.TaskSetting.DownloadSpeed;
|
||||||
services.AddTransient<DownloadFile>();
|
services.AddTransient<DownloadFile>();
|
||||||
|
|
||||||
DownloadFile.Opt = new DownloadConfiguration()
|
DownloadFile.Opt = new DownloadConfiguration()
|
||||||
|
|
@ -34,7 +34,7 @@ namespace VideoAnalysisCore.Common
|
||||||
// 要下载的文件部分数量,默认值是1
|
// 要下载的文件部分数量,默认值是1
|
||||||
ChunkCount = 8,
|
ChunkCount = 8,
|
||||||
// 下载速度限制为2MB/秒,默认值为零(即无限制)
|
// 下载速度限制为2MB/秒,默认值为零(即无限制)
|
||||||
MaximumBytesPerSecond = 1024 * 1024 * DownloadSpeed,
|
MaximumBytesPerSecond = 1024 * 1024 * DownloadFile.DownloadSpeed,
|
||||||
// 故障转移时的最大重试次数
|
// 故障转移时的最大重试次数
|
||||||
MaxTryAgainOnFailover = 5,
|
MaxTryAgainOnFailover = 5,
|
||||||
// 每50MB后释放内存缓冲区
|
// 每50MB后释放内存缓冲区
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,8 @@ namespace VideoAnalysisCore.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static async Task ReceivingTaskAsync()
|
public static async Task ReceivingTaskAsync()
|
||||||
{
|
{
|
||||||
|
if (!AppCommon.Config.TaskSetting.ProcessingTasks)//是否接收任务
|
||||||
|
return;
|
||||||
var oldTask = await Redis.GetAsync(RedisExpandKey.IDTask);
|
var oldTask = await Redis.GetAsync(RedisExpandKey.IDTask);
|
||||||
if (!string.IsNullOrEmpty(oldTask))
|
if (!string.IsNullOrEmpty(oldTask))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace VideoAnalysisCore.Model.Enum
|
||||||
|
{
|
||||||
|
public enum AttachmentsInfoType
|
||||||
|
{
|
||||||
|
[Description("默认")]
|
||||||
|
None = 0,
|
||||||
|
[Description("常规课程")]
|
||||||
|
RegularClasses = 1,
|
||||||
|
[Description("教研")]
|
||||||
|
TeachingResearch = 2,
|
||||||
|
[Description("PPT")]
|
||||||
|
PPT = 3,
|
||||||
|
[Description("复习")]
|
||||||
|
Review = 4,
|
||||||
|
[Description("活动")]
|
||||||
|
Activities = 5,
|
||||||
|
[Description("班会")]
|
||||||
|
Meeting = 6,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -25,27 +25,43 @@ namespace VideoAnalysisCore.Model
|
||||||
[DisplayName("编号")]
|
[DisplayName("编号")]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件节点Id
|
|
||||||
/// </summary>
|
|
||||||
[DisplayName("文件节点Id"), Required]
|
|
||||||
public long NodeId { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 文件节点存储ID
|
/// 文件节点存储ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("文件节点存储ID"), Required]
|
[DisplayName("文件节点存储ID"), Required]
|
||||||
[SugarColumn(Length = 32)]
|
[SugarColumn(Length = 32)]
|
||||||
public string VideoCode { get; set; }
|
public string VideoCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 视频文件名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 32)]
|
||||||
|
public string VideoName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 录播结构目录节点编号
|
||||||
|
/// </summary>
|
||||||
|
public long NodeId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 录播内容编号
|
/// 录播内容编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long StructurePageContentId { get; set; }
|
public long StructurePageContentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 素材ID
|
/// 素材ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long MaterialId { get; set; }
|
public long MaterialId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 内容类型
|
||||||
|
/// </summary>
|
||||||
|
public AttachmentsInfoType AttachmentsInfoType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 科目类型
|
||||||
|
/// </summary>
|
||||||
|
public SubjectEnum SubjectType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 任务类型
|
||||||
|
/// </summary>
|
||||||
|
public TaskTypeEnum TaskType { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 完成时间
|
/// 完成时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsNullable = true)]
|
[SugarColumn(IsNullable = true)]
|
||||||
|
|
@ -56,6 +72,5 @@ namespace VideoAnalysisCore.Model
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("创建时间")]
|
[DisplayName("创建时间")]
|
||||||
public DateTime CreateTime { get; set; } =DateTime.Now;
|
public DateTime CreateTime { get; set; } =DateTime.Now;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="1.10.32" />
|
<PackageReference Include="org.k2fsa.sherpa.onnx" Version="1.10.32" />
|
||||||
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
||||||
<PackageReference Include="UserCenter.Model" Version="1.3.4" />
|
<PackageReference Include="UserCenter.Model" Version="1.3.5" />
|
||||||
<PackageReference Include="Whisper.net" Version="1.5.0" />
|
<PackageReference Include="Whisper.net" Version="1.5.0" />
|
||||||
<PackageReference Include="Whisper.net.Runtime" Version="1.5.0" />
|
<PackageReference Include="Whisper.net.Runtime" Version="1.5.0" />
|
||||||
<PackageReference Include="xFFmpeg.NET" Version="6.0.0" />
|
<PackageReference Include="xFFmpeg.NET" Version="6.0.0" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue