|
|
|
|
@ -3,11 +3,16 @@ package com.zhehekeji.web.lib.hik;
|
|
|
|
|
import com.sun.jna.NativeLong;
|
|
|
|
|
import com.sun.jna.ptr.IntByReference;
|
|
|
|
|
import com.zhehekeji.common.util.PathUtil;
|
|
|
|
|
import com.zhehekeji.common.util.SpringContextUtil;
|
|
|
|
|
import com.zhehekeji.core.util.Assert;
|
|
|
|
|
import com.zhehekeji.web.Application;
|
|
|
|
|
import com.zhehekeji.web.config.ConfigProperties;
|
|
|
|
|
import com.zhehekeji.web.lib.CameraConnMap;
|
|
|
|
|
import com.zhehekeji.web.lib.CameraControlModule;
|
|
|
|
|
import com.zhehekeji.web.lib.joyware.NetSDKLib;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
@ -259,6 +264,9 @@ public class HikCameraControlModuleImpl implements CameraControlModule {
|
|
|
|
|
public void downloadMp4(Integer cameraId, String path, LocalDateTime start, LocalDateTime end) {
|
|
|
|
|
/*start = start.minusMinutes(1);
|
|
|
|
|
end = end.minusMinutes(1);*/
|
|
|
|
|
ConfigProperties configProperties = SpringContextUtil.getBean(ConfigProperties.class);
|
|
|
|
|
start = start.minusNanos(configProperties.getCameraConfig().getDelayStartDownloadMp4() *10000);
|
|
|
|
|
start = start.plusNanos(configProperties.getCameraConfig().getDelayEndDownloadMp4() *10000);
|
|
|
|
|
PathUtil.checkDirc(path);
|
|
|
|
|
HCNetSDK.NET_DVR_TIME startTime = new HCNetSDK.NET_DVR_TIME();
|
|
|
|
|
startTime.setTime(start.getYear(), start.getMonthValue(), start.getDayOfMonth(), start.getHour(), start.getMinute(), start.getSecond());
|
|
|
|
|
|