| 
					
				 | 
			
			
				@@ -12,14 +12,10 @@ import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.stereotype.Component; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.util.ObjectUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import springfox.documentation.spring.web.json.Json; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import javax.annotation.PostConstruct; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.io.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.ArrayList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.regex.Matcher; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.regex.Pattern; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -33,8 +29,11 @@ public class CameraUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private static String historyUrl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private static String ffmpegPath; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private static String mappingUrl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private static String surl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private CaneraConfig caneraConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private ServerConfig serverConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 历史回放 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -45,36 +44,11 @@ public class CameraUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @throws IOException 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public static String historyPlay(String channel, Date startTm, Date endTm) throws IOException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (StringUtils.isBlank(channel) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                || ObjectUtils.isEmpty(startTm) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                || ObjectUtils.isEmpty(endTm)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 调用视频服务返回参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String param = "channel=" + channel + "&startTime=" + startTime + "&endTime=" + endTime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String s = HttpUtils.sendGet(historyUrl + "/api/record/flv/list", param); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 视频拼接 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (!StringUtils.isBlank(s)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<Map<String, Object>> maps = JSON.parseArray(s, Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            // 视频服务映射路径 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String NewfilePath = BaseConfig.getProfile() + "/" + channel + "/" + startTime + "/" + endTime + ".flv"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<String> fromVideoFileList = new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (Map<String, Object> map : maps) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                Object path = map.get("Path"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (!ObjectUtils.isEmpty(path)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    fromVideoFileList.add(mappingUrl + path); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            convetor(fromVideoFileList, NewfilePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            return systemUrl + "/profile" + "/" + channel + "/" + startTime + "/" + endTime + ".flv"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // http://47.106.159.135/record/flv/34020000001320000002/20230304_183122_183222-d98df13f-ba77-11ed-aeb9-00163e06a5f3.flv 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public static String historyPlay(List<String> fromVideoFileList, String ph) throws IOException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 视频服务映射路径 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String NewfilePath = BaseConfig.getProfile() + ph; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        convetor(fromVideoFileList, NewfilePath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return surl + "/profile" + ph; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public static String getPlayFlv(String cameraCode, String channel) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -96,16 +70,21 @@ public class CameraUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return HttpUtils.sendGet(url + "/gb28181/api/records", param); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public static List<String> historyPlayList(String channel, Date startTm, Date endTm) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public static String historyPlayList(String channel, Date startTm, Date endTm) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (StringUtils.isBlank(channel) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 || ObjectUtils.isEmpty(startTm) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 || ObjectUtils.isEmpty(endTm)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<String> ls = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 调用视频服务返回参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String ph = "/flv/" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                + "/" + channel + "/" + startTime + "/" + endTime + "/" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                + UUID.randomUUID().toString() + ".flv"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String param = "channel=" + channel + "&startTime=" + startTime + "&endTime=" + endTime; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String s = HttpUtils.sendGet(historyUrl + "/api/record/flv/list", param); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 视频拼接 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -143,7 +122,14 @@ public class CameraUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return ls; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!ObjectUtils.isEmpty(ls)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return historyPlay(ls, ph); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } catch (IOException e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @PostConstruct 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -152,6 +138,7 @@ public class CameraUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         mappingUrl = caneraConfig.getMappingUrl(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         historyUrl = caneraConfig.getHistoryUrl(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ffmpegPath = caneraConfig.getFfmpegPath(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        surl = serverConfig.getUrl(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 |