|
@@ -997,20 +997,27 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 报警回放本地测试
|
|
|
+ * 从天网拉回放流,然后根据url把流下载下来变成文件,然后进行视频压缩
|
|
|
+ * @param list
|
|
|
+ * @param alarmPlayTimeValue
|
|
|
+ */
|
|
|
public void playbackURLs(List<String> list, String alarmPlayTimeValue) {
|
|
|
log.info("--------------->playbackURLs");
|
|
|
CompletableFuture future = CompletableFuture.supplyAsync(() -> {
|
|
|
log.info("异步任务开始-----》");
|
|
|
// for (String code : list) {
|
|
|
+ String code="42010001541320000024";
|
|
|
PlaybackVo playbackVo = new PlaybackVo();
|
|
|
- playbackVo.setCameraIndexCode("42010001541320000024");
|
|
|
+ playbackVo.setCameraIndexCode(code);
|
|
|
// 获取当前时间
|
|
|
OffsetDateTime currentTime = OffsetDateTime.now();
|
|
|
-// 获取当前时间的前10分钟时间
|
|
|
+ // 获取当前时间的前10分钟时间
|
|
|
OffsetDateTime beforeTenMinutes = currentTime.minusMinutes(Long.parseLong(alarmPlayTimeValue));
|
|
|
-// 获取当前时间的后10分钟时间
|
|
|
+ // 获取当前时间的后10分钟时间
|
|
|
OffsetDateTime afterTenMinutes = currentTime.plusMinutes(Long.parseLong(alarmPlayTimeValue));
|
|
|
-// 格式化时间
|
|
|
+ // 格式化时间
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
|
playbackVo.setBeginTime(beforeTenMinutes.format(formatter));
|
|
|
//现在当前时间:后续需要修改成报警时间的后几分钟
|
|
@@ -1032,13 +1039,15 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
// String urls = data.getString("url");
|
|
|
// log.info("--------------->urls::" + urls);
|
|
|
|
|
|
- String FilePath = "/opt/streams/map/42010001541320000024.mp4";
|
|
|
+ String FilePath = "/opt/streams/map/"+code+".mp4";
|
|
|
// String FilePath = "/opt/streams/map/01ea43e6676f4e47bd6c5cd9e02aa006.mp4";
|
|
|
- Process process = rtspToMP4.StartRecord(ffmpegPath, "rtsp://124.70.58.209:8554/42010001541320000024/42010001541320000024", FilePath);
|
|
|
+ Process process = rtspToMP4.StartRecord(ffmpegPath, "rtsp://124.70.58.209:8554/"+code+"/"+code, FilePath);
|
|
|
log.info("------playbackURLs----->>>>:" + process);
|
|
|
if (null != process) {
|
|
|
- map.put("42010001541320000024", process);
|
|
|
+ map.put(code, process);
|
|
|
}
|
|
|
+ log.info("-------videoCompression------->");
|
|
|
+ videoCompression(code);
|
|
|
return 1;
|
|
|
});
|
|
|
future.join();
|