| | |
| | | package com.iplatform.recvideo.util; |
| | | |
| | | import com.iplatform.recvideo.Constants; |
| | | import com.iplatform.recvideo.ImageInfo; |
| | | import com.iplatform.recvideo.VideoFolderInfo; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | |
| | | |
| | | protected static final transient Logger logger = LoggerFactory.getLogger(VideoFileUtils.class); |
| | | |
| | | /** |
| | | * 拼接视频批量(存储)文件夹路径,如: /opt/ai/video/20220921,其中'20220921'为批量号 |
| | | * @param videoDataFolder |
| | | * @param batchId |
| | | * @return |
| | | */ |
| | | public static final String combineBatchPath(String videoDataFolder, String batchId){ |
| | | String batchFolderPath = null; |
| | | if(videoDataFolder.endsWith(StringUtils.FOLDER_SEPARATOR)){ |
| | | batchFolderPath = videoDataFolder + batchId; |
| | | } else { |
| | | batchFolderPath = videoDataFolder + StringUtils.FOLDER_SEPARATOR + batchId; |
| | | } |
| | | return batchFolderPath; |
| | | } |
| | | |
| | | public static final List<VideoFolderInfo> getBatchVideoFolderInfo(String videoDataFolder, String batchId){ |
| | | String batchFolderPath = videoDataFolder + File.separator + batchId; |
| | | // String batchFolderPath = videoDataFolder + File.separator + batchId; |
| | | String batchFolderPath = combineBatchPath(videoDataFolder, batchId); |
| | | // if(videoDataFolder.endsWith(StringUtils.FOLDER_SEPARATOR)){ |
| | | // batchFolderPath = videoDataFolder + batchId; |
| | | // } else { |
| | | // batchFolderPath = videoDataFolder + StringUtils.FOLDER_SEPARATOR + batchId; |
| | | // } |
| | | File batchFolder = new File(batchFolderPath); |
| | | if(!batchFolder.exists()){ |
| | | logger.error("视频文件夹不存在,无法获取图片集合信息。batchFolderPath = " + batchFolderPath); |