This commit is contained in:
itcsx committed 2026-09-17 18:15:57 +08:00
1 parent 501c92d87c
commit f1a88acb89
9 files changed
+1040 -165

No files matched your search

@@ -1190,7 +1190,7 @@ namespace CloudBuilder.Master.Service
string backupFileName = Path.Combine(backupRootPath, filePath, file.FileName);
if (!Directory.Exists(Path.Combine(backupRootPath, filePath)))
{
Directory.CreateDirectory(Path.Combine(backupRootPath, filePath));
Directory.CreateDirectory(Path.Combine(backupRootPath, filePath));
}
if (fns[fns.Length - 1].Split('.')[0] == "1")
@@ -1357,7 +1357,7 @@ namespace CloudBuilder.Master.Service
{
if (File.Exists(fileName)) File.Delete(fileName);
}
string m3u8FilePath = fullName.Replace(fileExtension, ".png");
string m3u8FilePath = fullName.Replace(fileExtension, FileTypePolicy.JPG);
//生成m3u8(暂不生成,只生成截图)
TsToM3u8(dmsFile.OrderKey, fullName, m3u8FilePath);
}
@@ -1405,7 +1405,14 @@ namespace CloudBuilder.Master.Service
public void TsToM3u8(string orderKey, string mp4Url, string m3u8Url, int videoLength = 6)
{
string para = string.Format(service.Configuration[ServiceSettingsPolicy.FfmpegPictrue], mp4Url, m3u8Url);
RunMyProcess(service.Configuration[ServiceSettingsPolicy.FfmpegPath], para);
try
{
RunMyProcess(service.Configuration[ServiceSettingsPolicy.FfmpegPath], para);
}
catch (Exception ex)
{
new FileLog(service.Configuration).WriteToFile(ex.Message);
}
return;
para = string.Format(service.Configuration["Ffmpeg:Arguments"], mp4Url, videoLength, m3u8Url);
//不直接转码视频文件,影响服务器性能,改为在闭时自动生成
@@ -1483,8 +1490,10 @@ namespace CloudBuilder.Master.Service
/// <param name="Parameters"></param>
public void RunMyProcess(string exePath, string Parameters)
{
FileLog log = new FileLog(service.Configuration);
try
{
log.WriteToFile(exePath + Parameters);
if (string.IsNullOrEmpty(exePath)) return;
Cli.Wrap(exePath)
.WithArguments(Parameters)
@@ -1492,6 +1501,7 @@ namespace CloudBuilder.Master.Service
}
catch (Exception ex)
{
log.WriteToFile(ex.Message);
throw new ValidatedException(ex.Message);
}