From 4ad711f61a1a760a0f8f7f8475b75ec93e31d8ae Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Thu, 13 Jun 2024 16:21:34 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E8=B0=83=E8=AF=95?=
=?UTF-8?q?=E6=97=A5=E5=BF=97=E6=97=A5=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../request/impl/NotifyRequestForCatalogProcessor.java | 8 ++++----
.../impl/NotifyRequestForMobilePositionProcessor.java | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
index 6185cda4..155d5f73 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
@@ -315,8 +315,8 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
}
}
- @Scheduled(fixedRate = 10000) //每1秒执行一次
- public void execute(){
- logger.info("[待处理Notify-目录订阅消息数量]: {}", taskQueue.size());
- }
+// @Scheduled(fixedRate = 10000) //每1秒执行一次
+// public void execute(){
+// logger.info("[待处理Notify-目录订阅消息数量]: {}", taskQueue.size());
+// }
}
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java
index c8111778..75a3b0d2 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java
@@ -188,8 +188,8 @@ public class NotifyRequestForMobilePositionProcessor extends SIPRequestProcessor
}
taskQueue.clear();
}
- @Scheduled(fixedRate = 10000)
- public void execute(){
- logger.info("[待处理Notify-移动位置订阅消息数量]: {}", taskQueue.size());
- }
+// @Scheduled(fixedRate = 10000)
+// public void execute(){
+// logger.debug("[待处理Notify-移动位置订阅消息数量]: {}", taskQueue.size());
+// }
}
From f3ea07bdcd722d667e16b7a880f41a30b9374732 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Fri, 14 Jun 2024 17:03:55 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BD=AC=E7=A0=81?=
=?UTF-8?q?=E5=90=8E=E7=9A=84=E6=B5=81=E7=9A=84=E8=BE=93=E5=87=BA=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/genersoft/iot/vmp/common/StreamInfo.java | 11 +++++++++++
.../iot/vmp/service/impl/MediaServiceImpl.java | 12 ++++++++----
.../iot/vmp/vmanager/bean/StreamContent.java | 14 ++++++++++++++
src/main/resources/application.yml | 2 +-
4 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
index 979f54a5..2d940347 100644
--- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
+++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
@@ -83,6 +83,9 @@ public class StreamInfo implements Serializable, Cloneable{
@Schema(description = "是否暂停(录像回放使用)")
private boolean pause;
+ @Schema(description = "转码后的视频流")
+ private StreamInfo transcodeStream;
+
public void setFlv(StreamURL flv) {
this.flv = flv;
}
@@ -521,6 +524,14 @@ public class StreamInfo implements Serializable, Cloneable{
this.transactionInfo = transactionInfo;
}
+ public StreamInfo getTranscodeStream() {
+ return transcodeStream;
+ }
+
+ public void setTranscodeStream(StreamInfo transcodeStream) {
+ this.transcodeStream = transcodeStream;
+ }
+
@Override
public StreamInfo clone() {
StreamInfo instance = null;
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
index ead5052e..d68261bd 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
@@ -95,10 +95,6 @@ public class MediaServiceImpl implements IMediaService {
if (addr == null) {
addr = mediaInfo.getStreamIp();
}
- if (!"broadcast".equalsIgnoreCase(app) && !ObjectUtils.isEmpty(mediaInfo.getTranscodeSuffix()) && !"null".equalsIgnoreCase(mediaInfo.getTranscodeSuffix())) {
- stream = stream + "_" + mediaInfo.getTranscodeSuffix();
-// streamInfoResult.setStream(stream);
- }
streamInfoResult.setIp(addr);
streamInfoResult.setMediaServerId(mediaInfo.getId());
@@ -112,6 +108,14 @@ public class MediaServiceImpl implements IMediaService {
streamInfoResult.setRtc(addr, mediaInfo.getHttpPort(),mediaInfo.getHttpSSlPort(), app, stream, callIdParam, isPlay);
streamInfoResult.setTracks(tracks);
+
+ if (!"broadcast".equalsIgnoreCase(app) && !ObjectUtils.isEmpty(mediaInfo.getTranscodeSuffix()) && !"null".equalsIgnoreCase(mediaInfo.getTranscodeSuffix())) {
+ String newStream = stream + "_" + mediaInfo.getTranscodeSuffix();
+ mediaInfo.setTranscodeSuffix(null);
+ StreamInfo transcodeStreamInfo = getStreamInfoByAppAndStream(mediaInfo, app, newStream, tracks, addr, callId, isPlay);
+ streamInfoResult.setTranscodeStream(transcodeStreamInfo);
+ }
+
return streamInfoResult;
}
}
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java
index 4974209a..f9857385 100755
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java
@@ -97,6 +97,9 @@ public class StreamContent {
@Schema(description = "文件下载地址(录像下载使用)")
private DownloadFileInfo downLoadFilePath;
+ @Schema(description = "转码后的视频流")
+ private StreamContent transcodeStream;
+
private double progress;
public StreamContent(StreamInfo streamInfo) {
@@ -178,6 +181,17 @@ public class StreamContent {
if (streamInfo.getDownLoadFilePath() != null) {
this.downLoadFilePath = streamInfo.getDownLoadFilePath();
}
+ if (streamInfo.getTranscodeStream() != null) {
+ this.transcodeStream = new StreamContent(streamInfo.getTranscodeStream());
+ }
+ }
+
+ public StreamContent getTranscodeStream() {
+ return transcodeStream;
+ }
+
+ public void setTranscodeStream(StreamContent transcodeStream) {
+ this.transcodeStream = transcodeStream;
}
public String getApp() {
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 3f478442..ddb05dee 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -2,4 +2,4 @@ spring:
application:
name: wvp
profiles:
- active: local
\ No newline at end of file
+ active: local271
\ No newline at end of file
From 107caf11710ee07e511da47312f748339e003fb2 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Fri, 14 Jun 2024 17:24:57 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=89=8D=E7=AB=AF?=
=?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=BD=AC=E7=A0=81=E5=90=8E=E7=9A=84=E6=B5=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/web/gb28181/ApiStreamController.java | 3 +++
web_src/src/components/dialog/devicePlayer.vue | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
index 63d9f310..4f42efd1 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
@@ -120,6 +120,9 @@ public class ApiStreamController {
if (errorCode == InviteErrorCode.SUCCESS.getCode()) {
if (data != null) {
StreamInfo streamInfo = (StreamInfo)data;
+ if (streamInfo.getTranscodeStream() != null) {
+ streamInfo = streamInfo.getTranscodeStream();
+ }
JSONObject resultJjson = new JSONObject();
resultJjson.put("StreamID", streamInfo.getStream());
resultJjson.put("DeviceID", serial);
diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue
index f6bd2b23..64c61f56 100755
--- a/web_src/src/components/dialog/devicePlayer.vue
+++ b/web_src/src/components/dialog/devicePlayer.vue
@@ -473,10 +473,14 @@ export default {
},
getUrlByStreamInfo() {
console.log(this.streamInfo)
+ let streamInfo = this.streamInfo
+ if (this.streamInfo.transcodeStream) {
+ streamInfo = this.streamInfo.transcodeStream;
+ }
if (location.protocol === "https:") {
- this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]]
+ this.videoUrl = streamInfo[this.player[this.activePlayer][1]]
} else {
- this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]]
+ this.videoUrl = streamInfo[this.player[this.activePlayer][0]]
}
return this.videoUrl;
From f5abf8df4c05439a288a88dedad0f7065901ca21 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Wed, 19 Jun 2024 16:00:26 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dao/CloudRecordServiceMapper.java | 2 +-
.../vmp/web/gb28181/ApiStreamController.java | 32 ++++++++++++++-----
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java
index b446148a..f641071a 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java
@@ -53,7 +53,7 @@ public interface CloudRecordServiceMapper {
" and id in " +
" #{item}" +
" " +
- " order by start_time DESC" +
+ " order by start_time ASC" +
" ")
List getList(@Param("query") String query, @Param("app") String app, @Param("stream") String stream,
@Param("startTimeStamp")Long startTimeStamp, @Param("endTimeStamp")Long endTimeStamp,
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
index 4f42efd1..1d1919a6 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
@@ -120,22 +120,38 @@ public class ApiStreamController {
if (errorCode == InviteErrorCode.SUCCESS.getCode()) {
if (data != null) {
StreamInfo streamInfo = (StreamInfo)data;
- if (streamInfo.getTranscodeStream() != null) {
- streamInfo = streamInfo.getTranscodeStream();
- }
JSONObject resultJjson = new JSONObject();
resultJjson.put("StreamID", streamInfo.getStream());
resultJjson.put("DeviceID", serial);
resultJjson.put("ChannelID", code);
resultJjson.put("ChannelName", deviceChannel.getName());
resultJjson.put("ChannelCustomName", "");
- resultJjson.put("FLV", streamInfo.getFlv().getUrl());
- if(streamInfo.getHttps_flv() != null) {
- resultJjson.put("HTTPS_FLV", streamInfo.getHttps_flv().getUrl());
+ if (streamInfo.getTranscodeStream() != null) {
+ resultJjson.put("FLV", streamInfo.getTranscodeStream().getFlv().getUrl());
+ }else {
+ resultJjson.put("FLV", streamInfo.getFlv().getUrl());
+
}
- resultJjson.put("WS_FLV", streamInfo.getWs_flv().getUrl());
+ if(streamInfo.getHttps_flv() != null) {
+ if (streamInfo.getTranscodeStream() != null) {
+ resultJjson.put("HTTPS_FLV", streamInfo.getTranscodeStream().getHttps_flv().getUrl());
+ }else {
+ resultJjson.put("HTTPS_FLV", streamInfo.getHttps_flv().getUrl());
+ }
+ }
+
+ if (streamInfo.getTranscodeStream() != null) {
+ resultJjson.put("WS_FLV", streamInfo.getTranscodeStream().getWs_flv().getUrl());
+ }else {
+ resultJjson.put("WS_FLV", streamInfo.getWs_flv().getUrl());
+ }
+
if(streamInfo.getWss_flv() != null) {
- resultJjson.put("WSS_FLV", streamInfo.getWss_flv().getUrl());
+ if (streamInfo.getTranscodeStream() != null) {
+ resultJjson.put("WSS_FLV", streamInfo.getTranscodeStream().getWss_flv().getUrl());
+ }else {
+ resultJjson.put("WSS_FLV", streamInfo.getWss_flv().getUrl());
+ }
}
resultJjson.put("RTMP", streamInfo.getRtmp().getUrl());
if (streamInfo.getRtmps() != null) {
From 6e4268a670a796a884261ab77d70b59dc95cb909 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Thu, 20 Jun 2024 18:12:35 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A8=E6=B5=81?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=86=99=E5=85=A5redis?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../vmp/media/zlm/ZLMHttpHookListener.java | 21 ++++++++++++-------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
index 63239b78..73f20bf4 100755
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -375,8 +375,20 @@ public class ZLMHttpHookListener {
streamAuthorityInfo.setOriginTypeStr(param.getOriginTypeStr());
}
redisCatchStorage.updateStreamAuthorityInfo(param.getApp(), param.getStream(), streamAuthorityInfo);
+
+ Map params = MediaServerUtils.urlParamToMap(param.getParams());
+ param.setParamMap(params);
+ StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaInfo,
+ param.getApp(), param.getStream(), tracks, params.get("callId"));
+ param.setStreamInfo(new StreamContent(streamInfoByAppAndStream));
+
+ param.setSeverId(userSetting.getServerId());
+ streamPushService.updatePush(param);
+ // 冗余数据,自己系统中自用
+ redisCatchStorage.addPushListItem(param.getApp(), param.getStream(), param);
}
}
+ // TODO 修改为第一个为准 后续不再处理
if ("rtsp".equals(param.getSchema())) {
logger.info("流变化:注册->{}, app->{}, stream->{}", param.isRegist(), param.getApp(), param.getStream());
if (param.isRegist()) {
@@ -464,14 +476,7 @@ public class ZLMHttpHookListener {
param.setStreamInfo(new StreamContent(streamInfoByAppAndStream));
redisCatchStorage.addStream(mediaInfo, type, param.getApp(), param.getStream(), param);
- if (param.getOriginType() == OriginType.RTSP_PUSH.ordinal()
- || param.getOriginType() == OriginType.RTMP_PUSH.ordinal()
- || param.getOriginType() == OriginType.RTC_PUSH.ordinal()) {
- param.setSeverId(userSetting.getServerId());
- streamPushService.updatePush(param);
- // 冗余数据,自己系统中自用
- redisCatchStorage.addPushListItem(param.getApp(), param.getStream(), param);
- }
+
} else {
// 兼容流注销时类型从redis记录获取
OnStreamChangedHookParam onStreamChangedHookParam = redisCatchStorage.getStreamInfo(
From 099c65ff40eefd1ad58626c7376c95fb3cf28395 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Thu, 20 Jun 2024 19:30:25 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=82=B9=E6=92=AD?=
=?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E4=B8=BA?=
=?UTF-8?q?10=E7=A7=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java b/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
index 96253d6e..7a025de0 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
@@ -21,7 +21,7 @@ public class UserSetting {
private Boolean seniorSdp = Boolean.FALSE;
- private Integer playTimeout = 18000;
+ private Integer playTimeout = 10000;
private int platformPlayTimeout = 20000;
From 050882d6a614f87d33d90bc5b344c774d9f6e71d Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Thu, 20 Jun 2024 22:35:48 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A8=E6=B5=81?=
=?UTF-8?q?=E6=97=B6=E5=AD=98=E5=85=A5=E6=8E=A8=E6=B5=81=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../vmp/media/zlm/ZLMHttpHookListener.java | 22 +++++++++++--------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
index 73f20bf4..a676fb92 100755
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -376,17 +376,21 @@ public class ZLMHttpHookListener {
}
redisCatchStorage.updateStreamAuthorityInfo(param.getApp(), param.getStream(), streamAuthorityInfo);
- Map params = MediaServerUtils.urlParamToMap(param.getParams());
- param.setParamMap(params);
- StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaInfo,
- param.getApp(), param.getStream(), tracks, params.get("callId"));
- param.setStreamInfo(new StreamContent(streamInfoByAppAndStream));
+ if (!"broadcast".equals(param.getApp()) && !"talk".equals(param.getApp())) {
+ Map params = MediaServerUtils.urlParamToMap(param.getParams());
+ param.setParamMap(params);
+ StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaInfo,
+ param.getApp(), param.getStream(), tracks, params.get("callId"));
+ param.setStreamInfo(new StreamContent(streamInfoByAppAndStream));
- param.setSeverId(userSetting.getServerId());
- streamPushService.updatePush(param);
- // 冗余数据,自己系统中自用
- redisCatchStorage.addPushListItem(param.getApp(), param.getStream(), param);
+ param.setSeverId(userSetting.getServerId());
+ streamPushService.updatePush(param);
+ // 冗余数据,自己系统中自用
+ redisCatchStorage.addPushListItem(param.getApp(), param.getStream(), param);
+ }
}
+ }else {
+ redisCatchStorage.removePushListItem(param.getApp(), param.getStream(), param.getMediaServerId());
}
// TODO 修改为第一个为准 后续不再处理
if ("rtsp".equals(param.getSchema())) {