|
@@ -3,6 +3,8 @@ package com.iden.bms.service;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.iden.common.cache.RedisKeyConstant;
|
|
|
|
+import com.iden.common.cache.RedisUtil;
|
|
import com.iden.common.entity.*;
|
|
import com.iden.common.entity.*;
|
|
import com.iden.common.service.*;
|
|
import com.iden.common.service.*;
|
|
import com.iden.common.util.DateUtils;
|
|
import com.iden.common.util.DateUtils;
|
|
@@ -40,6 +42,8 @@ public class VideoService {
|
|
@Value("${ffmpeg.path:#{null}}")
|
|
@Value("${ffmpeg.path:#{null}}")
|
|
private String ffmpegPath;
|
|
private String ffmpegPath;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private RedisUtil redisUtil;
|
|
|
|
|
|
private static final Logger logger = LogManager.getLogger(VideoService.class);
|
|
private static final Logger logger = LogManager.getLogger(VideoService.class);
|
|
|
|
|
|
@@ -89,8 +93,10 @@ public class VideoService {
|
|
}
|
|
}
|
|
logger.info("FaceIdenService.handleCameraVideo ...originImageDir == " + originImageDir.getAbsolutePath());
|
|
logger.info("FaceIdenService.handleCameraVideo ...originImageDir == " + originImageDir.getAbsolutePath());
|
|
|
|
|
|
|
|
+ Long videoId = redisUtil.generate(RedisKeyConstant.VIDEO_KEY);
|
|
|
|
+
|
|
//先把分解图片放入临时目录,临时目录下的文件重命名后移到原始目录等待图像识别
|
|
//先把分解图片放入临时目录,临时目录下的文件重命名后移到原始目录等待图像识别
|
|
- Long duration = VideoTool.fetchAllPic(ffmpegPath, videoFile.getAbsolutePath(),finalDirTmp.getAbsolutePath(),originImageDir.getAbsolutePath(), shootEndTime);
|
|
|
|
|
|
+ Long duration = VideoTool.fetchAllPic(videoId,ffmpegPath, videoFile.getAbsolutePath(),finalDirTmp.getAbsolutePath(),originImageDir.getAbsolutePath(), shootEndTime);
|
|
|
|
|
|
File finalVideoDir = new File(videoFile.getParentFile().getAbsolutePath().replace("origin","final"));
|
|
File finalVideoDir = new File(videoFile.getParentFile().getAbsolutePath().replace("origin","final"));
|
|
if(!finalVideoDir.exists()){
|
|
if(!finalVideoDir.exists()){
|
|
@@ -104,6 +110,7 @@ public class VideoService {
|
|
|
|
|
|
//保存数据库
|
|
//保存数据库
|
|
IdenCameraVideo idenCameraVideo = new IdenCameraVideo();
|
|
IdenCameraVideo idenCameraVideo = new IdenCameraVideo();
|
|
|
|
+ idenCameraVideo.setId(videoId);
|
|
idenCameraVideo.setVideoUrl(fileUrl + "camera/video/" + cameraCode + "/" + videoFileName);
|
|
idenCameraVideo.setVideoUrl(fileUrl + "camera/video/" + cameraCode + "/" + videoFileName);
|
|
idenCameraVideo.setCameraId(idenCamera.getId());
|
|
idenCameraVideo.setCameraId(idenCamera.getId());
|
|
idenCameraVideo.setCommunityId(idenCamera.getCommunityId());
|
|
idenCameraVideo.setCommunityId(idenCamera.getCommunityId());
|