支持录像回放使用固定流地址以及自动点播录像回放

This commit is contained in:
648540858
2023-07-25 11:14:43 +08:00
parent 51634b1b96
commit 59d8f2f915
7 changed files with 95 additions and 26 deletions

View File

@@ -29,7 +29,6 @@ public interface IPlayService {
void playBack(String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback);
void playBack(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback);
void zlmServerOffline(String mediaServerId);
void download(String deviceId, String channelId, String startTime, String endTime, int downloadSpeed, ErrorCallback<Object> callback);
@@ -44,4 +43,6 @@ public interface IPlayService {
void resumeRtp(String streamId) throws ServiceException, InvalidArgumentException, ParseException, SipException;
void getSnap(String deviceId, String channelId, String fileName, ErrorCallback errorCallback);
}

View File

@@ -539,7 +539,19 @@ public class PlayServiceImpl implements IPlayService {
return;
}
MediaServerItem newMediaServerItem = getNewMediaServerItem(device);
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, null, null, device.isSsrcCheck(), true, 0, false, device.getStreamModeForParam());
String stream = null;
if (newMediaServerItem.isRtpEnable()) {
String startTimeStr = startTime.replace("-", "")
.replace(":", "")
.replace(" ", "");
System.out.println(startTimeStr);
String endTimeTimeStr = endTime.replace("-", "")
.replace(":", "")
.replace(" ", "");
System.out.println(endTimeTimeStr);
stream = deviceId + "_" + channelId + "_" + startTimeStr + "_" + endTimeTimeStr;
}
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false, device.getStreamModeForParam());
playBack(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, callback);
}