| | |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.constant.sdkPriority; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.camera.mapper.ArdCamerasMapper; |
| | |
| | | return; |
| | | } |
| | | Integer userId = GlobalVariable.loginMap.get(cameraId); |
| | | String path = ""; |
| | | //强制I帧结构体对象 |
| | | HCNetSDK.NET_DVR_I_FRAME netDvrIFrame = new HCNetSDK.NET_DVR_I_FRAME(); //新建结构体对象 |
| | | netDvrIFrame.read(); |
| | |
| | | netDvrIFrame.byStreamType = 0; |
| | | netDvrIFrame.dwSize = netDvrIFrame.size(); |
| | | netDvrIFrame.write(); |
| | | |
| | | if(!hCNetSDK.NET_DVR_RemoteControl(userId,3402,netDvrIFrame.getPointer(),netDvrIFrame.dwSize)){ |
| | | log.error("强制I帧 错误码为: " + hCNetSDK.NET_DVR_GetLastError()); |
| | | } |
| | |
| | | return; |
| | | } |
| | | log.info("取流成功"); |
| | | File file = new File("D:/recordTemp/" + cameraId + ".mp4"); |
| | | if (!file.exists()) { |
| | | File fileParent = file.getParentFile(); |
| | | if (!fileParent.exists()) { |
| | | fileParent.mkdirs(); |
| | | } |
| | | file.createNewFile(); |
| | | } |
| | | path = file.getCanonicalPath(); |
| | | |
| | | String path= FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | recordInfo info = new recordInfo(); |
| | | info.setLRealHandle(lRealHandle); |
| | | info.setRecordPath(path); |