w
This commit is contained in:
1 parent
70b3e19798
commit
9b9f07dea5
5 files changed
+167
-34
No files matched your search
@@ -1360,7 +1360,8 @@ namespace CloudBuilder.Master.Service
|
||||
if (File.Exists(fileName)) File.Delete(fileName);
|
||||
}
|
||||
string m3u8FilePath = fullName.Replace(fileExtension, FileTypePolicy.JPG);
|
||||
//生成m3u8(暂不生成,只生成截图)
|
||||
//生成m3u8(生成10秒视频,只生成截图)
|
||||
dmsFile.TranscodeIndc = YesNoPolicy.YES;
|
||||
TsToM3u8(dmsFile.OrderKey, fullName, m3u8FilePath);
|
||||
}
|
||||
}
|
||||
@@ -1430,22 +1431,19 @@ namespace CloudBuilder.Master.Service
|
||||
Directory.CreateDirectory(targetDir);
|
||||
}
|
||||
|
||||
//return;
|
||||
para = string.Format(service.Configuration["Ffmpeg:Arguments"], mp4Url, fullName);
|
||||
//不直接转码视频文件,影响服务器性能,改为在闭时自动生成
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// Thread.Sleep(200);
|
||||
// RunMyProcess(service.Configuration["Ffmpeg:Path"], para);
|
||||
//});
|
||||
|
||||
IRepository<SecurityScheduleTaskQueueEntity> logRepository = repository.GetRepository<IRepository<SecurityScheduleTaskQueueEntity>>();
|
||||
SecurityScheduleTaskQueueEntity task = new SecurityScheduleTaskQueueEntity();
|
||||
|
||||
task.DocumentId = documentId;
|
||||
task.TaskId = service.Configuration["Ffmpeg:Path"];
|
||||
task.TaskParam = para;
|
||||
|
||||
|
||||
logRepository.InsertNow(task);
|
||||
|
||||
//直接转码视频文件10秒,影响服务器性能,改为在闭时自动生成全部
|
||||
RunMyProcess(task.TaskId, task.TaskParam);
|
||||
}
|
||||
|
||||
public void ImageToScare(string fullName, DmsFileEntity dmsFile)
|
||||
@@ -1517,16 +1515,16 @@ namespace CloudBuilder.Master.Service
|
||||
// 必须等 ffmpeg 真正退出:视频封面(jpg)要在接口返回前落盘,
|
||||
// 否则前端刷新列表时文件还没生成,<img> 请求 404 且不会自动重试,
|
||||
// 表现为"上传完看不到封面,手动刷新才有"。
|
||||
// 最多等 15 秒,超时就交给前端的封面重试机制兜底,不再死等拖住上传请求。
|
||||
// 最多等 25 秒,超时就交给前端的封面重试机制兜底,不再死等拖住上传请求。
|
||||
// CliWrap 的 ExecuteAsync 返回 CommandTask<CommandResult>,取它的 Task 才能等待
|
||||
var task = Cli.Wrap(exePath)
|
||||
.WithArguments(Parameters)
|
||||
.ExecuteAsync()
|
||||
.Task;
|
||||
|
||||
if (!task.Wait(TimeSpan.FromSeconds(15)))
|
||||
if (!task.Wait(TimeSpan.FromSeconds(25)))
|
||||
{
|
||||
log.WriteToFile("ffmpeg 执行超时(15s):" + Parameters);
|
||||
log.WriteToFile("ffmpeg 执行超时(25s):" + Parameters);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1576,7 +1574,7 @@ namespace CloudBuilder.Master.Service
|
||||
entity.IsDirectoryIndc = YesNoPolicy.NO;
|
||||
|
||||
entity.FilePath = folderNameParent;
|
||||
|
||||
entity.TranscodeIndc = dmsFile.TranscodeIndc;
|
||||
entity.OwerId = service.UserId;
|
||||
entity.IsLinkIndc = YesNoPolicy.NO;
|
||||
|
||||
|
||||
Reference in new issue
Block a user