|
@@ -79,6 +79,21 @@ public class CameraUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public static String historyPlayListStr(String channel, Date startTm, Date endTm) {
|
|
|
+ List<String> list = historyPlayList(channel, startTm, endTm);
|
|
|
+ String ph = "/flv/" + DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date())
|
|
|
+ + "/" + channel + "/"
|
|
|
+ + UUID.randomUUID().toString() + ".flv";
|
|
|
+ try {
|
|
|
+ return historyPlay(list, ph);
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.error(e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static List<String> historyPlayList(String channel, Date startTm, Date endTm) {
|
|
|
if (StringUtils.isBlank(channel)
|
|
|
|| ObjectUtils.isEmpty(startTm)
|
|
@@ -91,9 +106,7 @@ public class CameraUtil {
|
|
|
// 调用视频服务返回参数
|
|
|
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm);
|
|
|
String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, endTm);
|
|
|
- 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);
|
|
|
// 视频拼接
|
|
@@ -141,15 +154,11 @@ public class CameraUtil {
|
|
|
ls.add(m.get(d));
|
|
|
});
|
|
|
return ls;
|
|
|
-// try {
|
|
|
-// return historyPlay(ls, ph);
|
|
|
-// } catch (IOException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
url = caneraConfig.getUrl();
|
|
@@ -303,14 +312,25 @@ public class CameraUtil {
|
|
|
|
|
|
public static void main(String[] args) throws IOException {
|
|
|
|
|
|
- List<String> fromVideoFileList = new ArrayList();
|
|
|
+// List<String> fromVideoFileList = new ArrayList();
|
|
|
String p = "C:\\Users\\Administrator.DESKTOP-0NUUTMM\\Desktop\\work\\106\\流媒体\\";
|
|
|
- String NewfilePath = p + "mergevideo.flv";
|
|
|
- fromVideoFileList.add(p + "20230303_174931_175031-d6d56396-b9a8-11ed-aeb9-00163e06a5f3.flv");
|
|
|
- fromVideoFileList.add(p + "20230303_175032_175132-fb32b9fe-b9a8-11ed-aeb9-00163e06a5f3.flv");
|
|
|
- fromVideoFileList.add(p + "20230303_175133_175233-1f97af04-b9a9-11ed-aeb9-00163e06a5f3.flv");
|
|
|
- fromVideoFileList.add(p + "20230303_175234_175334-43f4daf1-b9a9-11ed-aeb9-00163e06a5f3.flv");
|
|
|
- convetor(fromVideoFileList, NewfilePath);
|
|
|
+ String newfilePath = p + "mvideo.flv";
|
|
|
+// fromVideoFileList.add(p + "20230303_174931_175031-d6d56396-b9a8-11ed-aeb9-00163e06a5f3.flv");
|
|
|
+// fromVideoFileList.add(p + "20230303_175032_175132-fb32b9fe-b9a8-11ed-aeb9-00163e06a5f3.flv");
|
|
|
+// fromVideoFileList.add(p + "20230303_175133_175233-1f97af04-b9a9-11ed-aeb9-00163e06a5f3.flv");
|
|
|
+// fromVideoFileList.add(p + "20230303_175234_175334-43f4daf1-b9a9-11ed-aeb9-00163e06a5f3.flv");
|
|
|
+// convetor(fromVideoFileList, NewfilePath);
|
|
|
+ List<String> list = Arrays.asList("http://47.106.159.135/record/flv/34020000001320000002/20230304_185950_190050-d3f3d9c2-ba7b-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190051_190151-f859029a-ba7b-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190152_190252-1cb977bd-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190253_190353-4117245a-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190354_190454-6575b56e-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190455_190555-89d6e4b7-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190556_190657-ae3bc3a9-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190658_190758-d29cd834-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190759_190859-f6fdc454-ba7c-11ed-aeb9-00163e06a5f3.flv",
|
|
|
+ "http://47.106.159.135/record/flv/34020000001320000002/20230304_190900_191000-1b5ac0ee-ba7d-11ed-aeb9-00163e06a5f3.flv");
|
|
|
+ mergeFile(list, newfilePath);
|
|
|
|
|
|
}
|
|
|
}
|