|
@@ -43,6 +43,7 @@ import java.io.PrintWriter;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.OffsetDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
@@ -942,12 +943,12 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
PlaybackVo playbackVo = new PlaybackVo();
|
|
|
playbackVo.setCameraIndexCode("42010001541320000024");
|
|
|
// 获取当前时间
|
|
|
- LocalDateTime currentTime = LocalDateTime.now();
|
|
|
- // 获取当前时间的前10分钟时间
|
|
|
- LocalDateTime beforeTenMinutes = currentTime.minusMinutes(10);
|
|
|
- // 获取当前时间的后10分钟时间
|
|
|
- LocalDateTime afterTenMinutes = currentTime.plusMinutes(10);
|
|
|
- // 格式化时间
|
|
|
+ OffsetDateTime currentTime = OffsetDateTime.now();
|
|
|
+// 获取当前时间的前10分钟时间
|
|
|
+ OffsetDateTime beforeTenMinutes = currentTime.minusMinutes(10);
|
|
|
+// 获取当前时间的后10分钟时间
|
|
|
+ OffsetDateTime afterTenMinutes = currentTime.plusMinutes(10);
|
|
|
+// 格式化时间
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
|
playbackVo.setBeginTime(beforeTenMinutes.format(formatter));
|
|
|
//现在当前时间:后续需要修改成报警时间的后几分钟
|
|
@@ -969,13 +970,13 @@ 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/42010001541320000024.mp4";
|
|
|
// String FilePath = "/opt/streams/map/01ea43e6676f4e47bd6c5cd9e02aa006.mp4";
|
|
|
- Process process = rtspToMP4.StartRecord(ffmpegPath, "rtsp://124.70.58.209:8554/42010001541320000024/42010001541320000024", FilePath);
|
|
|
- log.info("------playbackURLs----->>>>:" + process);
|
|
|
- if (null != process) {
|
|
|
- map.put("42010001541320000024", process);
|
|
|
- }
|
|
|
+ Process process = rtspToMP4.StartRecord(ffmpegPath, "rtsp://124.70.58.209:8554/42010001541320000024/42010001541320000024", FilePath);
|
|
|
+ log.info("------playbackURLs----->>>>:" + process);
|
|
|
+ if (null != process) {
|
|
|
+ map.put("42010001541320000024", process);
|
|
|
+ }
|
|
|
return 1;
|
|
|
});
|
|
|
future.join();
|
|
@@ -984,7 +985,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
public AjaxResult stop(String id) {
|
|
|
if (map.containsKey(id)) {
|
|
|
Process process = map.get(id);
|
|
|
- log.info("-----stop------>>>"+process);
|
|
|
+ log.info("-----stop------>>>" + process);
|
|
|
if (null != process) {
|
|
|
rtspToMP4.stopRecord(process);
|
|
|
return AjaxResult.success();
|