| | |
| | | @Override |
| | | public AjaxResult localRecordStart(CameraCmd cmd) { |
| | | try { |
| | | String operator = cmd.getOperator(); |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = 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"); |
| | | LLong lRealHandle = RealPlayModule.startRealPlay(loginId, chanNo - 1, path); |
| | | if (lRealHandle.longValue() <= 0) { |
| | | log.error("取流失败" + getErrorCodePrint()); |
| | |
| | | @Override |
| | | public AjaxResult localRecordStop(CameraCmd cmd) { |
| | | try { |
| | | String operator = cmd.getOperator(); |
| | | String cameraId = cmd.getCameraId(); |
| | | LLong lRealHandle = new LLong(cmd.getRecordId()); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | |
| | | 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[] imageBytes = Files.readAllBytes(Paths.get(recordPath)); |
| | | return AjaxResult.success(imageBytes); |
| | | } catch (Exception ex) { |