|
@@ -1222,26 +1222,28 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
if (StringUtils.isNotEmpty(data)) {
|
|
if (StringUtils.isNotEmpty(data)) {
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
JSONArray streamArray = jsonObject.getJSONArray("Streams");
|
|
JSONArray streamArray = jsonObject.getJSONArray("Streams");
|
|
- for (int i = 0; i < streamArray.size(); i++) {
|
|
|
|
- JSONObject subObj = streamArray.getJSONObject(i);
|
|
|
|
- String subValue = subObj.getString("Subscribers");
|
|
|
|
- String pathValue = subObj.getString("Path");
|
|
|
|
- //从缓存取出预拉的流的集合
|
|
|
|
- List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
- log.info("subValue------------------>" + subValue);
|
|
|
|
- log.info("pathValue------------------>" + pathValue);
|
|
|
|
- log.info("heartbeat------------------>" + heartbeat);
|
|
|
|
- if (subValue.equals("0") && pathValue.contains("h264_720")) {
|
|
|
|
- if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
- if (!heartbeat.contains(pathValue)) {
|
|
|
|
- log.info("执行stopStream---111--------------->");
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(streamArray)) {
|
|
|
|
+ for (int i = 0; i < streamArray.size(); i++) {
|
|
|
|
+ JSONObject subObj = streamArray.getJSONObject(i);
|
|
|
|
+ String subValue = subObj.getString("Subscribers");
|
|
|
|
+ String pathValue = subObj.getString("Path");
|
|
|
|
+ //从缓存取出预拉的流的集合
|
|
|
|
+ List<String> heartbeat = redisCache.getCacheObject("heartbeat");
|
|
|
|
+ log.info("subValue------------------>" + subValue);
|
|
|
|
+ log.info("pathValue------------------>" + pathValue);
|
|
|
|
+ log.info("heartbeat------------------>" + heartbeat);
|
|
|
|
+ if (subValue.equals("0") && pathValue.contains("h264_720")) {
|
|
|
|
+ if (!ObjectUtils.isEmpty(heartbeat)) {
|
|
|
|
+ if (!heartbeat.contains(pathValue)) {
|
|
|
|
+ log.info("执行stopStream---111--------------->");
|
|
|
|
+ String[] parts = pathValue.split("/");
|
|
|
|
+ stopStream(parts[0], parts[1]);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.info("执行stopStream--------2222---------->");
|
|
String[] parts = pathValue.split("/");
|
|
String[] parts = pathValue.split("/");
|
|
stopStream(parts[0], parts[1]);
|
|
stopStream(parts[0], parts[1]);
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- log.info("执行stopStream--------2222---------->");
|
|
|
|
- String[] parts = pathValue.split("/");
|
|
|
|
- stopStream(parts[0], parts[1]);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|