支持临时目录配置

录像查询超时 处理
This commit is contained in:
shikong 2024-03-13 22:02:18 +08:00
parent 79fc31dd6e
commit e1d0e355a0
3 changed files with 4 additions and 2 deletions

View File

@ -31,5 +31,6 @@ public class FfmpegConfig {
private Boolean output = false;
}
public Boolean useTmpFile = true;
private Boolean useTmpFile = true;
private String tmpDir = System.getProperty("java.io.tmpdir");
}

View File

@ -205,6 +205,7 @@ public class Gb28181DownloadService {
retryer.call(()->{
CompletableFuture<JsonResponse<List<RecordInfoItemVO>>> future = new CompletableFuture<>();
future.completeOnTimeout(JsonResponse.error("录像查询超时"),1,TimeUnit.MINUTES);
// 发起设备录像查询
DeferredResult<JsonResponse<List<RecordInfoItemVO>>> requestedRecordInfo =
recordInfoService.requestRecordInfo(new RecordInfoDTO(deviceCode, startTime, endTime, "", 0, "all"));

View File

@ -233,7 +233,7 @@ public class VideoService {
@SneakyThrows
public void ffmpegRecord(ServletResponse response, String url, long time, WvpProxyDevice device,String callId){
OutputStream outputStream;
String tmpDir = System.getProperty("java.io.tmpdir");
String tmpDir = ffmpegConfig.getTmpDir();
String fileName = callId + ".mp4";
File file = new File(tmpDir, fileName);
Executor executor;