diff --git a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/config/FfmpegConfig.java b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/config/FfmpegConfig.java index 365a6d0..555f3b3 100644 --- a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/config/FfmpegConfig.java +++ b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/config/FfmpegConfig.java @@ -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"); } diff --git a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java index feb934d..dc93371 100644 --- a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java +++ b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java @@ -205,6 +205,7 @@ public class Gb28181DownloadService { retryer.call(()->{ CompletableFuture>> future = new CompletableFuture<>(); + future.completeOnTimeout(JsonResponse.error("录像查询超时"),1,TimeUnit.MINUTES); // 发起设备录像查询 DeferredResult>> requestedRecordInfo = recordInfoService.requestRecordInfo(new RecordInfoDTO(deviceCode, startTime, endTime, "", 0, "all")); diff --git a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/video/VideoService.java b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/video/VideoService.java index a40d417..642592d 100644 --- a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/video/VideoService.java +++ b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/video/VideoService.java @@ -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;