优化录像路径的设置

pull/1270/head
648540858 2024-01-10 11:14:49 +08:00
parent 1af6324a09
commit 0c10c77a56
3 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public class MediaConfig{
@Value("${media.record-day:7}")
private Integer recordDay;
@Value("${media.record-path}")
@Value("${media.record-path:}")
private String recordPath;
public String getId() {

View File

@ -731,6 +731,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
dynamicTask.startDelay(callIdHeader.getCallId(), () -> {
logger.info("[ app={}, stream={} ] 等待设备开始推流超时", gbStream.getApp(), gbStream.getStream());
try {
redisPushStreamResponseListener.removeEvent(gbStream.getApp(), gbStream.getStream());
mediaListManager.removedChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream());
responseAck(request, Response.REQUEST_TIMEOUT); // 超时
} catch (SipException e) {
@ -748,6 +749,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
// 添加在本机上线的通知
mediaListManager.addChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream(), (app, stream, serverId) -> {
dynamicTask.stop(callIdHeader.getCallId());
redisPushStreamResponseListener.removeEvent(gbStream.getApp(), gbStream.getStream());
if (serverId.equals(userSetting.getServerId())) {
SendRtpItem sendRtpItem = zlmServerFactory.createSendRtpItem(mediaServerItem, addressStr, finalPort, ssrc, requesterId,
app, stream, channelId, mediaTransmissionTCP, platform.isRtcp());

View File

@ -591,7 +591,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
param.put("rtp_proxy.port_range", mediaServerItem.getRtpPortRange().replace(",", "-"));
}
if (mediaServerItem.getRecordPath() != null) {
if (!ObjectUtils.isEmpty(mediaServerItem.getRecordPath())) {
File recordPathFile = new File(mediaServerItem.getRecordPath());
param.put("protocol.mp4_save_path", recordPathFile.getParentFile().getPath());
param.put("protocol.downloadRoot", recordPathFile.getParentFile().getPath());