zlm 配置
This commit is contained in:
parent
b61056e8b8
commit
9914186862
@ -170,18 +170,18 @@ public class DeviceProxyService {
|
|||||||
|
|
||||||
log.info("结束 zlm rtp 推流, app {}, stream {}, ssrc {}", app, callId, ssrc);
|
log.info("结束 zlm rtp 推流, app {}, stream {}, ssrc {}", app, callId, ssrc);
|
||||||
zlmMediaService.stopSendRtp(stopSendRtp);
|
zlmMediaService.stopSendRtp(stopSendRtp);
|
||||||
}, 3, TimeUnit.SECONDS);
|
}, 5, TimeUnit.SECONDS);
|
||||||
|
|
||||||
// 如果 流 在 3秒内 重新注册, 则 取消停止RTP推流
|
// 如果 流 在 5秒内 重新注册, 则 取消停止RTP推流
|
||||||
zlmStreamChangeHookService.getRegistHandler(app).put(callId,()->{
|
zlmStreamChangeHookService.getRegistHandler(app).put(callId,()->{
|
||||||
schedule.cancel(true);
|
schedule.cancel(true);
|
||||||
zlmStreamRegistHookEvent(app, callId, ssrc);
|
zlmStreamRegistHookEvent(app, callId, ssrc);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 如果 注销 后 3.5 秒内 没有再注册, 就彻底取消相关事件的订阅
|
// 如果 注销 后 5.5 秒内 没有再注册, 就彻底取消相关事件的订阅
|
||||||
scheduledExecutorService.schedule(()->{
|
scheduledExecutorService.schedule(()->{
|
||||||
zlmStreamChangeHookService.getRegistHandler(app).remove(callId);
|
zlmStreamChangeHookService.getRegistHandler(app).remove(callId);
|
||||||
},3500, TimeUnit.MILLISECONDS);
|
},5500, TimeUnit.MILLISECONDS);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public class ZlmInitService {
|
|||||||
hook.setOnStreamChanged(zlmHookConfig.getHook() + "/on_stream_changed");
|
hook.setOnStreamChanged(zlmHookConfig.getHook() + "/on_stream_changed");
|
||||||
hook.setOnStreamNoneReader(zlmHookConfig.getHook() + "/on_stream_none_reader");
|
hook.setOnStreamNoneReader(zlmHookConfig.getHook() + "/on_stream_none_reader");
|
||||||
hook.setOnPublish(zlmHookConfig.getHook() + "/on_publish");
|
hook.setOnPublish(zlmHookConfig.getHook() + "/on_publish");
|
||||||
config.getRtmp().setHandshakeSecond(10);
|
config.getRtmp().setHandshakeSecond(15);
|
||||||
config.getRtmp().setKeepAliveSecond(10);
|
config.getRtmp().setKeepAliveSecond(10);
|
||||||
zlmMediaService.setServerConfig(config);
|
zlmMediaService.setServerConfig(config);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user