| | |
| | | import com.ruoyi.alarm.global.domain.GuideTask; |
| | | import com.ruoyi.alarm.global.service.impl.QueueHandler; |
| | | import com.ruoyi.common.annotation.SdkOperate; |
| | | import com.ruoyi.common.config.ARDConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | |
| | | try { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | | String path = FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | boolean enable = cmd.isEnable(); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return ""; |
| | |
| | | try { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer channelNum = cmd.getChanNo(); |
| | | String path = FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return false; |
| | | } |
| | |
| | | try { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer channelNum = cmd.getChanNo(); |
| | | String path = FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return ""; |
| | | } |
| | |
| | | try { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer channelNum = cmd.getChanNo(); |
| | | String path = FileUtils.createFile("D:/LocalRecordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return AjaxResult.warn("设备未登录"); |
| | | } |
| | |
| | | previewinfo.byNPQMode = 0;//NPQ模式:0-直连模式,1-过流媒体模式 |
| | | previewinfo.write(); |
| | | //endregion |
| | | //if (GlobalVariable.previewMap.containsKey(cameraId)) { |
| | | // Integer lRealHandle = GlobalVariable.previewMap.get(cameraId); |
| | | // hCNetSDK.NET_DVR_StopRealPlay(lRealHandle); |
| | | // GlobalVariable.previewMap.remove(cameraId); |
| | | //} |
| | | hCNetSDK.NET_DVR_StopRealPlay(lRealHandle); |
| | | log.debug("本地录像停止"); |
| | | String recordPath = FileUtils.createFile("D:/LocalRecordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String recordPath = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | byte[] recordBytes = Files.readAllBytes(Paths.get(recordPath)); |
| | | //OutputStream outputStream = response.getOutputStream(); |
| | | //outputStream.write(imageBytes); |
| | | return AjaxResult.success(recordBytes); |
| | | } catch (Exception ex) { |
| | | log.error("本地录像停止异常" + ex.getMessage()); |