调整转码后的流的输出位置

2.7.2
648540858 2024-06-14 17:03:55 +08:00
parent 4ad711f61a
commit f3ea07bdcd
4 changed files with 34 additions and 5 deletions

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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() {

View File

@ -2,4 +2,4 @@ spring:
application:
name: wvp
profiles:
active: local
active: local271