downloadToStream 添加 -t 参数

/video ffmpegRecord 调整
This commit is contained in:
shikong 2024-03-15 10:48:03 +08:00
parent 8c5b6f6021
commit 054ab25205

View File

@ -232,6 +232,10 @@ public class Gb28181DownloadService {
} else if (wvpProxyConfig.getUseFfmpeg()) {
executor.execute(()-> {
videoService.ffmpegRecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime, endTime, DateUnit.SECOND), videoInfo.getDevice(), videoInfo.getCallId());
DateTime end = DateUtil.date();
asyncContext.complete();
log.info("下载总耗时: {}, deviceCode {}, startTime {}, endTime {}", DateUtil.between(start,end, DateUnit.SECOND), deviceCode, DateUtil.formatDateTime(startTime), DateUtil.formatDateTime(endTime));
});
} else {
videoService.javaCVrecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime, endTime, DateUnit.SECOND) + 15);
@ -240,9 +244,11 @@ public class Gb28181DownloadService {
} catch(Exception e) {
writeErrorToResponse(asyncResponse, JsonResponse.error(e.getMessage()));
} finally {
DateTime end = DateUtil.date();
asyncContext.complete();
log.info("下载总耗时: {}, deviceCode {}, startTime {}, endTime {}", DateUtil.between(start,end, DateUnit.SECOND), deviceCode, DateUtil.formatDateTime(startTime), DateUtil.formatDateTime(endTime));
if(!wvpProxyConfig.getUseFfmpeg()){
DateTime end = DateUtil.date();
asyncContext.complete();
log.info("下载总耗时: {}, deviceCode {}, startTime {}, endTime {}", DateUtil.between(start,end, DateUnit.SECOND), deviceCode, DateUtil.formatDateTime(startTime), DateUtil.formatDateTime(endTime));
}
}
});
}
@ -373,6 +379,10 @@ public class Gb28181DownloadService {
} else if(wvpProxyConfig.getUseFfmpeg()){
executor.execute(()->{
videoService.ffmpegRecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime,endTime,DateUnit.SECOND),videoInfo.getDevice(),videoInfo.getCallId());
DateTime end = DateUtil.date();
asyncContext.complete();
log.info("下载总耗时: {}, deviceCode {}, startTime {}, endTime {}", DateUtil.between(start,end, DateUnit.SECOND), deviceCode, DateUtil.formatDateTime(startTime), DateUtil.formatDateTime(endTime));
});
} else {
videoService.javaCVrecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime,endTime,DateUnit.SECOND) + 15);
@ -382,9 +392,11 @@ public class Gb28181DownloadService {
writeErrorToResponse(asyncResponse, JsonResponse.error(e.getMessage()));
} finally {
DateTime end = DateUtil.date();
asyncContext.complete();
log.info("下载总耗时: {}, deviceCode {}, startTime {}, endTime {}", DateUtil.between(start,end, DateUnit.SECOND), deviceCode, DateUtil.formatDateTime(startTime), DateUtil.formatDateTime(endTime));
if(!wvpProxyConfig.getUseFfmpeg()){
DateTime end = DateUtil.date();
asyncContext.complete();
log.info("下载总耗时: {}, deviceCode {}, startTime {}, endTime {}", DateUtil.between(start,end, DateUnit.SECOND), deviceCode, DateUtil.formatDateTime(startTime), DateUtil.formatDateTime(endTime));
}
}
});
}