downloadToStream 添加 -t 参数
/video ffmpegRecord 调整
This commit is contained in:
parent
c9af1a4dc3
commit
8c5b6f6021
@ -24,10 +24,10 @@ public class FfmpegSupportService {
|
|||||||
String inputParam = debug.getDownload() ? rtp.getDownload() : StringUtils.joinWith(" ", "-y", rtp.getDownload(), input);
|
String inputParam = debug.getDownload() ? rtp.getDownload() : StringUtils.joinWith(" ", "-y", rtp.getDownload(), input);
|
||||||
log.info("视频输入参数 {}", inputParam);
|
log.info("视频输入参数 {}", inputParam);
|
||||||
|
|
||||||
String outputParam = debug.getOutput() ? rtp.getOutput() : StringUtils.joinWith(" ", rtp.getOutput(), out);
|
String outputParam = debug.getOutput() ? rtp.getOutput() : StringUtils.joinWith(" ", "-t", unit.toSeconds(time), rtp.getOutput(), out);
|
||||||
log.info("视频输出参数 {}", outputParam);
|
log.info("视频输出参数 {}", outputParam);
|
||||||
|
|
||||||
return ffmpegExecutor(inputParam, outputParam, time, unit, streamHandler, executeResultHandler);
|
return ffmpegExecutor(inputParam, outputParam, time + 15, unit, streamHandler, executeResultHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
|
@ -230,7 +230,9 @@ public class Gb28181DownloadService {
|
|||||||
} else if (videoInfo == null) {
|
} else if (videoInfo == null) {
|
||||||
writeErrorToResponse(asyncResponse, JsonResponse.error("下载失败"));
|
writeErrorToResponse(asyncResponse, JsonResponse.error("下载失败"));
|
||||||
} else if (wvpProxyConfig.getUseFfmpeg()) {
|
} else if (wvpProxyConfig.getUseFfmpeg()) {
|
||||||
videoService.ffmpegRecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime, endTime, DateUnit.SECOND) + 15, videoInfo.getDevice(), videoInfo.getCallId());
|
executor.execute(()-> {
|
||||||
|
videoService.ffmpegRecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime, endTime, DateUnit.SECOND), videoInfo.getDevice(), videoInfo.getCallId());
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
videoService.javaCVrecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime, endTime, DateUnit.SECOND) + 15);
|
videoService.javaCVrecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime, endTime, DateUnit.SECOND) + 15);
|
||||||
}
|
}
|
||||||
@ -370,7 +372,7 @@ public class Gb28181DownloadService {
|
|||||||
writeErrorToResponse(asyncResponse, JsonResponse.error("下载失败"));
|
writeErrorToResponse(asyncResponse, JsonResponse.error("下载失败"));
|
||||||
} else if(wvpProxyConfig.getUseFfmpeg()){
|
} else if(wvpProxyConfig.getUseFfmpeg()){
|
||||||
executor.execute(()->{
|
executor.execute(()->{
|
||||||
videoService.ffmpegRecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime,endTime,DateUnit.SECOND) + 15,videoInfo.getDevice(),videoInfo.getCallId());
|
videoService.ffmpegRecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime,endTime,DateUnit.SECOND),videoInfo.getDevice(),videoInfo.getCallId());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
videoService.javaCVrecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime,endTime,DateUnit.SECOND) + 15);
|
videoService.javaCVrecord(asyncResponse, videoInfo.getUrl(), DateUtil.between(startTime,endTime,DateUnit.SECOND) + 15);
|
||||||
|
Loading…
Reference in New Issue
Block a user