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] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BD=AC=E7=A0=81=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E6=B5=81=E7=9A=84=E8=BE=93=E5=87=BA=E4=BD=8D=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