|
@@ -29,7 +29,6 @@ import com.ozs.utils.CameraUtil;
|
|
import com.ozs.utils.CaneraConfig;
|
|
import com.ozs.utils.CaneraConfig;
|
|
import com.ozs.utils.RtspToMP4;
|
|
import com.ozs.utils.RtspToMP4;
|
|
import com.ozs.web.core.config.GetCameraPreviewURL;
|
|
import com.ozs.web.core.config.GetCameraPreviewURL;
|
|
-import io.minio.Result;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -77,8 +76,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private BaseRailwayManagementService baseRailwayManagementService;
|
|
private BaseRailwayManagementService baseRailwayManagementService;
|
|
@Autowired
|
|
@Autowired
|
|
- private RtspToMP4 rtspToMP4;
|
|
|
|
- @Autowired
|
|
|
|
private IdempotenceUtils idempotenceUtils;
|
|
private IdempotenceUtils idempotenceUtils;
|
|
@Autowired
|
|
@Autowired
|
|
private DataScoreUtil dataScoreUtil;
|
|
private DataScoreUtil dataScoreUtil;
|
|
@@ -88,7 +85,6 @@ public class BaseCameraManagementController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private CameraUtil cameraUtil;
|
|
private CameraUtil cameraUtil;
|
|
|
|
|
|
- private Map<String, Process> map = new HashMap<>();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 所有相机列表+权限
|
|
* 所有相机列表+权限
|
|
@@ -1036,29 +1032,18 @@ public class BaseCameraManagementController extends BaseController {
|
|
@GetMapping(value = "/getAlarmRecord")
|
|
@GetMapping(value = "/getAlarmRecord")
|
|
@ApiOperation("报警回放本地测试")
|
|
@ApiOperation("报警回放本地测试")
|
|
@Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
|
|
@Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
|
|
- public AjaxResult getAlarmRecord(){
|
|
|
|
- String ffmpegPath = "/usr/bin/ffmpeg";
|
|
|
|
- String streamUrl = "rtsp://124.70.58.209:8554/42010001541320000024/42010001541320000024";
|
|
|
|
- String FilePath = "/opt/streams/map/42010001541320000024.mp4";
|
|
|
|
- Process process = rtspToMP4.StartRecord(ffmpegPath, streamUrl, FilePath);
|
|
|
|
- if (null != process) {
|
|
|
|
- map.put("42010001541320000024", process);
|
|
|
|
- return AjaxResult.success();
|
|
|
|
- }
|
|
|
|
- return AjaxResult.error();
|
|
|
|
|
|
+ public AjaxResult getAlarmRecord() {
|
|
|
|
+ List<BaseCameraManagement> list = baseCameraManagementService.list(new QueryWrapper<BaseCameraManagement>().eq("line_dir",2));
|
|
|
|
+ List<String> collect = list.stream().map(BaseCameraManagement::getCameraCode).collect(Collectors.toList());
|
|
|
|
+ CompletableFuture.runAsync(() -> cameraUtil.playbackURLs(collect));
|
|
|
|
+ return AjaxResult.success("ok");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@ApiOperation(value = "结束录制")
|
|
@ApiOperation(value = "结束录制")
|
|
@GetMapping(value = "/stop")
|
|
@GetMapping(value = "/stop")
|
|
public AjaxResult stop(String id) {
|
|
public AjaxResult stop(String id) {
|
|
- if (map.containsKey(id)) {
|
|
|
|
- Process process = map.get(id);
|
|
|
|
- if (null != process) {
|
|
|
|
- rtspToMP4.stopRecord(process);
|
|
|
|
- return AjaxResult.success();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return AjaxResult.error();
|
|
|
|
|
|
+ return cameraUtil.stop(id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|