| | |
| | | @Override |
| | | public AjaxResult localRecordStart(CameraCmd cmd) { |
| | | try { |
| | | String operator = cmd.getOperator(); |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer channelNum = cmd.getChanNo(); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | String path = FileUtils.createFile(tempPath + "/" + operator + "/" + cameraId + ".mp4"); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return AjaxResult.warn("设备未登录"); |
| | | } |
| | |
| | | @Override |
| | | public AjaxResult localRecordStop(CameraCmd cmd) { |
| | | try { |
| | | String operator = cmd.getOperator(); |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer channelNum = cmd.getChanNo(); |
| | | Integer lRealHandle = cmd.getRecordId().intValue(); |
| | |
| | | log.debug("本地录像停止"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String recordPath = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | String recordPath = FileUtils.createFile(tempPath + "/" + operator + "/" + cameraId + ".mp4"); |
| | | byte[] recordBytes = Files.readAllBytes(Paths.get(recordPath)); |
| | | return AjaxResult.success(recordBytes); |
| | | } catch (Exception ex) { |