增加对zlm使用docker容器的支持
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.genersoft.iot.vmp.media.zlm;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.MediaServerConfig;
|
||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -18,14 +18,11 @@ public class ZLMHTTPProxyController {
|
||||
|
||||
// private final static Logger logger = LoggerFactory.getLogger(ZLMHTTPProxyController.class);
|
||||
|
||||
// @Autowired
|
||||
// private IVideoManagerStorager storager;
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Value("${media.port}")
|
||||
private int mediaHttpPort;
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8")
|
||||
@@ -34,10 +31,10 @@ public class ZLMHTTPProxyController {
|
||||
if (redisCatchStorage.getMediaInfo() == null) {
|
||||
return "未接入流媒体";
|
||||
}
|
||||
MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
|
||||
ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
|
||||
String requestURI = String.format("http://%s:%s%s?%s&%s",
|
||||
mediaInfo.getLocalIP(),
|
||||
mediaHttpPort,
|
||||
mediaConfig.getHttpPort(),
|
||||
request.getRequestURI().replace("/zlm",""),
|
||||
mediaInfo.getHookAdminParams(),
|
||||
request.getQueryString()
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.UUID;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.conf.MediaServerConfig;
|
||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||
@@ -53,23 +53,20 @@ public class ZLMHttpHookListener {
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Autowired
|
||||
private ZLMServerManger zlmServerManger;
|
||||
|
||||
@Autowired
|
||||
private ZLMMediaListManager zlmMediaListManager;
|
||||
|
||||
@Autowired
|
||||
private ZLMHttpHookSubscribe subscribe;
|
||||
|
||||
@Value("${media.autoApplyPlay}")
|
||||
@Value("${userSettings.autoApplyPlay}")
|
||||
private boolean autoApplyPlay;
|
||||
|
||||
@Value("${media.ip}")
|
||||
private String mediaIp;
|
||||
|
||||
@Value("${media.wanIp}")
|
||||
private String mediaWanIp;
|
||||
|
||||
@Value("${media.port}")
|
||||
private int mediaPort;
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
/**
|
||||
* 流量统计事件,播放器或推流器断开时并且耗用流量超过特定阈值时会触发此事件,阈值通过配置文件general.flowThreshold配置;此事件对回复不敏感。
|
||||
@@ -388,12 +385,8 @@ public class ZLMHttpHookListener {
|
||||
subscribe.response(json);
|
||||
}
|
||||
}
|
||||
|
||||
MediaServerConfig mediaServerConfig = JSON.toJavaObject(json, MediaServerConfig.class);
|
||||
mediaServerConfig.setWanIp(StringUtils.isEmpty(mediaWanIp)? mediaIp: mediaWanIp);
|
||||
mediaServerConfig.setLocalIP(mediaIp);
|
||||
redisCatchStorage.updateMediaInfo(mediaServerConfig);
|
||||
|
||||
ZLMServerConfig ZLMServerConfig = JSON.toJavaObject(json, ZLMServerConfig.class);
|
||||
zlmServerManger.updateServerCatch(ZLMServerConfig);
|
||||
// 重新发起代理
|
||||
|
||||
JSONObject ret = new JSONObject();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.genersoft.iot.vmp.media.zlm;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.genersoft.iot.vmp.conf.MediaServerConfig;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
@@ -126,7 +124,7 @@ public class ZLMMediaListManager {
|
||||
public void clearAllSessions() {
|
||||
logger.info("清空所有国标相关的session");
|
||||
JSONObject allSessionJSON = zlmresTfulUtils.getAllSession();
|
||||
MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
|
||||
ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
|
||||
HashSet<String> allLocalPorts = new HashSet();
|
||||
if (allSessionJSON.getInteger("code") == 0) {
|
||||
JSONArray data = allSessionJSON.getJSONArray("data");
|
||||
|
||||
@@ -2,10 +2,13 @@ package com.genersoft.iot.vmp.media.zlm;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||
import okhttp3.*;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -20,14 +23,8 @@ public class ZLMRESTfulUtils {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ZLMRESTfulUtils.class);
|
||||
|
||||
@Value("${media.ip}")
|
||||
private String mediaIp;
|
||||
|
||||
@Value("${media.port}")
|
||||
private int mediaPort;
|
||||
|
||||
@Value("${media.secret}")
|
||||
private String mediaSecret;
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
public interface RequestCallback{
|
||||
void run(JSONObject response);
|
||||
@@ -35,12 +32,12 @@ public class ZLMRESTfulUtils {
|
||||
|
||||
public JSONObject sendPost(String api, Map<String, Object> param, RequestCallback callback) {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
String url = String.format("http://%s:%s/index/api/%s", mediaIp, mediaPort, api);
|
||||
String url = String.format("http://%s:%s/index/api/%s", mediaConfig.getIp(), mediaConfig.getHttpPort(), api);
|
||||
JSONObject responseJSON = null;
|
||||
logger.debug(url);
|
||||
|
||||
FormBody.Builder builder = new FormBody.Builder();
|
||||
builder.add("secret",mediaSecret);
|
||||
builder.add("secret",mediaConfig.getSecret());
|
||||
if (param != null && param.keySet().size() > 0) {
|
||||
for (String key : param.keySet()){
|
||||
if (param.get(key) != null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.media.zlm;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
||||
import com.genersoft.iot.vmp.gb28181.session.SsrcUtil;
|
||||
import org.slf4j.Logger;
|
||||
@@ -18,8 +19,8 @@ public class ZLMRTPServerFactory {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger("ZLMRTPServerFactory");
|
||||
|
||||
@Value("${media.rtp.portRange}")
|
||||
private String portRange;
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
@Autowired
|
||||
private ZLMRESTfulUtils zlmresTfulUtils;
|
||||
@@ -103,7 +104,7 @@ public class ZLMRTPServerFactory {
|
||||
|
||||
private int getPortFromportRange() {
|
||||
if (currentPort == 0) {
|
||||
String[] portRangeStrArray = portRange.split(",");
|
||||
String[] portRangeStrArray = mediaConfig.getRtpPortRange().split(",");
|
||||
portRangeArray[0] = Integer.parseInt(portRangeStrArray[0]);
|
||||
portRangeArray[1] = Integer.parseInt(portRangeStrArray[1]);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ package com.genersoft.iot.vmp.media.zlm;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.genersoft.iot.vmp.conf.MediaServerConfig;
|
||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
//import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||
@@ -34,36 +35,20 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Value("${media.ip}")
|
||||
private String mediaIp;
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
@Value("${media.wanIp}")
|
||||
private String mediaWanIp;
|
||||
|
||||
@Value("${media.hookIp}")
|
||||
private String mediaHookIp;
|
||||
|
||||
@Value("${media.port}")
|
||||
private int mediaPort;
|
||||
|
||||
@Value("${media.secret}")
|
||||
private String mediaSecret;
|
||||
|
||||
@Value("${media.streamNoneReaderDelayMS}")
|
||||
private String streamNoneReaderDelayMS;
|
||||
|
||||
@Value("${sip.ip}")
|
||||
private String sipIP;
|
||||
@Autowired
|
||||
private SipConfig sipConfig;
|
||||
|
||||
@Value("${server.port}")
|
||||
private String serverPort;
|
||||
|
||||
@Value("${media.autoConfig}")
|
||||
private boolean autoConfig;
|
||||
|
||||
@Value("${server.ssl.enabled}")
|
||||
private boolean sslEnabled;
|
||||
|
||||
private boolean startGetMedia = false;
|
||||
|
||||
@Autowired
|
||||
private ZLMRESTfulUtils zlmresTfulUtils;
|
||||
|
||||
@@ -73,6 +58,9 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
@Autowired
|
||||
private ZLMHttpHookSubscribe hookSubscribe;
|
||||
|
||||
@Autowired
|
||||
private ZLMServerManger zlmServerManger;
|
||||
|
||||
@Autowired
|
||||
private IStreamProxyService streamProxyService;
|
||||
|
||||
@@ -80,26 +68,28 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
public void run(String... strings) throws Exception {
|
||||
// 订阅 zlm启动事件
|
||||
hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_started,null,(response)->{
|
||||
MediaServerConfig mediaServerConfig = JSONObject.toJavaObject(response, MediaServerConfig.class);
|
||||
zLmRunning(mediaServerConfig);
|
||||
ZLMServerConfig ZLMServerConfig = JSONObject.toJavaObject(response, ZLMServerConfig.class);
|
||||
zLmRunning(ZLMServerConfig);
|
||||
});
|
||||
|
||||
// 获取zlm信息
|
||||
logger.info("等待zlm接入...");
|
||||
MediaServerConfig mediaServerConfig = getMediaServerConfig();
|
||||
startGetMedia = true;
|
||||
ZLMServerConfig ZLMServerConfig = getMediaServerConfig();
|
||||
|
||||
if (mediaServerConfig != null) {
|
||||
zLmRunning(mediaServerConfig);
|
||||
if (ZLMServerConfig != null) {
|
||||
zLmRunning(ZLMServerConfig);
|
||||
}
|
||||
}
|
||||
|
||||
public MediaServerConfig getMediaServerConfig() {
|
||||
public ZLMServerConfig getMediaServerConfig() {
|
||||
if (!startGetMedia) return null;
|
||||
JSONObject responseJSON = zlmresTfulUtils.getMediaServerConfig();
|
||||
MediaServerConfig mediaServerConfig = null;
|
||||
ZLMServerConfig ZLMServerConfig = null;
|
||||
if (responseJSON != null) {
|
||||
JSONArray data = responseJSON.getJSONArray("data");
|
||||
if (data != null && data.size() > 0) {
|
||||
mediaServerConfig = JSON.parseObject(JSON.toJSONString(data.get(0)), MediaServerConfig.class);
|
||||
ZLMServerConfig = JSON.parseObject(JSON.toJSONString(data.get(0)), ZLMServerConfig.class);
|
||||
|
||||
}
|
||||
} else {
|
||||
@@ -109,20 +99,18 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mediaServerConfig = getMediaServerConfig();
|
||||
ZLMServerConfig = getMediaServerConfig();
|
||||
}
|
||||
return mediaServerConfig;
|
||||
return ZLMServerConfig;
|
||||
}
|
||||
|
||||
private void saveZLMConfig() {
|
||||
logger.info("设置zlm...");
|
||||
if (StringUtils.isEmpty(mediaHookIp)) {
|
||||
mediaHookIp = sipIP;
|
||||
}
|
||||
if (StringUtils.isEmpty(mediaConfig.getHookIp())) mediaConfig.setHookIp(sipConfig.getSipIp());
|
||||
String protocol = sslEnabled ? "https" : "http";
|
||||
String hookPrex = String.format("%s://%s:%s/index/hook", protocol, mediaHookIp, serverPort);
|
||||
String hookPrex = String.format("%s://%s:%s/index/hook", protocol, mediaConfig.getHookIp(), serverPort);
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("api.secret",mediaSecret); // -profile:v Baseline
|
||||
param.put("api.secret",mediaConfig.getSecret()); // -profile:v Baseline
|
||||
param.put("ffmpeg.cmd","%s -fflags nobuffer -rtsp_transport tcp -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s");
|
||||
param.put("hook.enable","1");
|
||||
param.put("hook.on_flow_report","");
|
||||
@@ -139,7 +127,7 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
param.put("hook.on_stream_none_reader",String.format("%s/on_stream_none_reader", hookPrex));
|
||||
param.put("hook.on_stream_not_found",String.format("%s/on_stream_not_found", hookPrex));
|
||||
param.put("hook.timeoutSec","20");
|
||||
param.put("general.streamNoneReaderDelayMS",streamNoneReaderDelayMS);
|
||||
param.put("general.streamNoneReaderDelayMS",mediaConfig.getStreamNoneReaderDelayMS());
|
||||
|
||||
JSONObject responseJSON = zlmresTfulUtils.setServerConfig(param);
|
||||
|
||||
@@ -153,17 +141,12 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
/**
|
||||
* zlm 连接成功或者zlm重启后
|
||||
*/
|
||||
private void zLmRunning(MediaServerConfig mediaServerConfig){
|
||||
logger.info( "[ id: " + mediaServerConfig.getGeneralMediaServerId() + "] zlm接入成功...");
|
||||
if (autoConfig) saveZLMConfig();
|
||||
MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
|
||||
if (mediaInfo != null && System.currentTimeMillis() - mediaInfo.getUpdateTime() < 50){
|
||||
logger.info("[ id: " + mediaServerConfig.getGeneralMediaServerId() + "]zlm刚刚更新,忽略这次更新");
|
||||
return;
|
||||
}
|
||||
mediaServerConfig.setLocalIP(mediaIp);
|
||||
mediaServerConfig.setWanIp(StringUtils.isEmpty(mediaWanIp)? mediaIp: mediaWanIp);
|
||||
redisCatchStorage.updateMediaInfo(mediaServerConfig);
|
||||
private void zLmRunning(ZLMServerConfig zlmServerConfig){
|
||||
logger.info( "[ id: " + zlmServerConfig.getGeneralMediaServerId() + "] zlm接入成功...");
|
||||
// 关闭循环获取zlm配置
|
||||
startGetMedia = false;
|
||||
if (mediaConfig.getAutoConfig()) saveZLMConfig();
|
||||
zlmServerManger.updateServerCatch(zlmServerConfig);
|
||||
|
||||
// 清空所有session
|
||||
// zlmMediaListManager.clearAllSessions();
|
||||
|
||||
@@ -0,0 +1,763 @@
|
||||
package com.genersoft.iot.vmp.media.zlm;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
public class ZLMServerConfig {
|
||||
|
||||
@JSONField(name = "api.apiDebug")
|
||||
private String apiDebug;
|
||||
|
||||
@JSONField(name = "api.secret")
|
||||
private String apiSecret;
|
||||
|
||||
@JSONField(name = "ffmpeg.bin")
|
||||
private String ffmpegBin;
|
||||
|
||||
@JSONField(name = "ffmpeg.cmd")
|
||||
private String ffmpegCmd;
|
||||
|
||||
@JSONField(name = "ffmpeg.log")
|
||||
private String ffmpegLog;
|
||||
|
||||
@JSONField(name = "general.enableVhost")
|
||||
private String generalEnableVhost;
|
||||
|
||||
@JSONField(name = "general.mediaServerId")
|
||||
private String generalMediaServerId;
|
||||
|
||||
@JSONField(name = "general.flowThreshold")
|
||||
private String generalFlowThreshold;
|
||||
|
||||
@JSONField(name = "general.maxStreamWaitMS")
|
||||
private String generalMaxStreamWaitMS;
|
||||
|
||||
@JSONField(name = "general.streamNoneReaderDelayMS")
|
||||
private String generalStreamNoneReaderDelayMS;
|
||||
|
||||
private String localIP;
|
||||
|
||||
private String wanIp;
|
||||
|
||||
private long updateTime;
|
||||
|
||||
@JSONField(name = "hls.fileBufSize")
|
||||
private String hlsFileBufSize;
|
||||
|
||||
@JSONField(name = "hls.filePath")
|
||||
private String hlsFilePath;
|
||||
|
||||
@JSONField(name = "hls.segDur")
|
||||
private String hlsSegDur;
|
||||
|
||||
@JSONField(name = "hls.segNum")
|
||||
private String hlsSegNum;
|
||||
|
||||
@JSONField(name = "hook.access_file_except_hls")
|
||||
private String hookAccessFileExceptHLS;
|
||||
|
||||
@JSONField(name = "hook.admin_params")
|
||||
private String hookAdminParams;
|
||||
|
||||
@JSONField(name = "hook.enable")
|
||||
private String hookEnable;
|
||||
|
||||
@JSONField(name = "hook.on_flow_report")
|
||||
private String hookOnFlowReport;
|
||||
|
||||
@JSONField(name = "hook.on_http_access")
|
||||
private String hookOnHttpAccess;
|
||||
|
||||
@JSONField(name = "hook.on_play")
|
||||
private String hookOnPlay;
|
||||
|
||||
@JSONField(name = "hook.on_publish")
|
||||
private String hookOnPublish;
|
||||
|
||||
@JSONField(name = "hook.on_record_mp4")
|
||||
private String hookOnRecordMp4;
|
||||
|
||||
@JSONField(name = "hook.on_rtsp_auth")
|
||||
private String hookOnRtspAuth;
|
||||
|
||||
@JSONField(name = "hook.on_rtsp_realm")
|
||||
private String hookOnRtspRealm;
|
||||
|
||||
@JSONField(name = "hook.on_shell_login")
|
||||
private String hookOnShellLogin;
|
||||
|
||||
@JSONField(name = "hook.on_stream_changed")
|
||||
private String hookOnStreamChanged;
|
||||
|
||||
@JSONField(name = "hook.on_stream_none_reader")
|
||||
private String hookOnStreamNoneReader;
|
||||
|
||||
@JSONField(name = "hook.on_stream_not_found")
|
||||
private String hookOnStreamNotFound;
|
||||
|
||||
@JSONField(name = "hook.timeoutSec")
|
||||
private String hookTimeoutSec;
|
||||
|
||||
@JSONField(name = "http.charSet")
|
||||
private String httpCharSet;
|
||||
|
||||
@JSONField(name = "http.keepAliveSecond")
|
||||
private String httpKeepAliveSecond;
|
||||
|
||||
@JSONField(name = "http.maxReqCount")
|
||||
private String httpMaxReqCount;
|
||||
|
||||
@JSONField(name = "http.maxReqSize")
|
||||
private String httpMaxReqSize;
|
||||
|
||||
@JSONField(name = "http.notFound")
|
||||
private String httpNotFound;
|
||||
|
||||
@JSONField(name = "http.port")
|
||||
private String httpPort;
|
||||
|
||||
@JSONField(name = "http.rootPath")
|
||||
private String httpRootPath;
|
||||
|
||||
@JSONField(name = "http.sendBufSize")
|
||||
private String httpSendBufSize;
|
||||
|
||||
@JSONField(name = "http.sslport")
|
||||
private String httpSSLport;
|
||||
|
||||
@JSONField(name = "multicast.addrMax")
|
||||
private String multicastAddrMax;
|
||||
|
||||
@JSONField(name = "multicast.addrMin")
|
||||
private String multicastAddrMin;
|
||||
|
||||
@JSONField(name = "multicast.udpTTL")
|
||||
private String multicastUdpTTL;
|
||||
|
||||
@JSONField(name = "record.appName")
|
||||
private String recordAppName;
|
||||
|
||||
@JSONField(name = "record.filePath")
|
||||
private String recordFilePath;
|
||||
|
||||
@JSONField(name = "record.fileSecond")
|
||||
private String recordFileSecond;
|
||||
|
||||
@JSONField(name = "record.sampleMS")
|
||||
private String recordFileSampleMS;
|
||||
|
||||
@JSONField(name = "rtmp.handshakeSecond")
|
||||
private String rtmpHandshakeSecond;
|
||||
|
||||
@JSONField(name = "rtmp.keepAliveSecond")
|
||||
private String rtmpKeepAliveSecond;
|
||||
|
||||
@JSONField(name = "rtmp.modifyStamp")
|
||||
private String rtmpModifyStamp;
|
||||
|
||||
@JSONField(name = "rtmp.port")
|
||||
private String rtmpPort;
|
||||
|
||||
@JSONField(name = "rtmp.sslport")
|
||||
private String rtmpSslPort;
|
||||
|
||||
@JSONField(name = "rtp.audioMtuSize")
|
||||
private String rtpAudioMtuSize;
|
||||
|
||||
@JSONField(name = "rtp.clearCount")
|
||||
private String rtpClearCount;
|
||||
|
||||
@JSONField(name = "rtp.cycleMS")
|
||||
private String rtpCycleMS;
|
||||
|
||||
@JSONField(name = "rtp.maxRtpCount")
|
||||
private String rtpMaxRtpCount;
|
||||
|
||||
@JSONField(name = "rtp.videoMtuSize")
|
||||
private String rtpVideoMtuSize;
|
||||
|
||||
@JSONField(name = "rtp_proxy.checkSource")
|
||||
private String rtpProxyCheckSource;
|
||||
|
||||
@JSONField(name = "rtp_proxy.dumpDir")
|
||||
private String rtpProxyDumpDir;
|
||||
|
||||
@JSONField(name = "rtp_proxy.port")
|
||||
private String rtpProxyPort;
|
||||
|
||||
@JSONField(name = "rtp_proxy.timeoutSec")
|
||||
private String rtpProxyTimeoutSec;
|
||||
|
||||
@JSONField(name = "rtsp.authBasic")
|
||||
private String rtspAuthBasic;
|
||||
|
||||
@JSONField(name = "rtsp.handshakeSecond")
|
||||
private String rtspHandshakeSecond;
|
||||
|
||||
@JSONField(name = "rtsp.keepAliveSecond")
|
||||
private String rtspKeepAliveSecond;
|
||||
|
||||
@JSONField(name = "rtsp.port")
|
||||
private String rtspPort;
|
||||
|
||||
@JSONField(name = "rtsp.sslport")
|
||||
private String rtspSSlport;
|
||||
|
||||
@JSONField(name = "shell.maxReqSize")
|
||||
private String shellMaxReqSize;
|
||||
|
||||
@JSONField(name = "shell.shell")
|
||||
private String shellPhell;
|
||||
|
||||
|
||||
public String getApiDebug() {
|
||||
return apiDebug;
|
||||
}
|
||||
|
||||
public void setApiDebug(String apiDebug) {
|
||||
this.apiDebug = apiDebug;
|
||||
}
|
||||
|
||||
public String getApiSecret() {
|
||||
return apiSecret;
|
||||
}
|
||||
|
||||
public void setApiSecret(String apiSecret) {
|
||||
this.apiSecret = apiSecret;
|
||||
}
|
||||
|
||||
public String getFfmpegBin() {
|
||||
return ffmpegBin;
|
||||
}
|
||||
|
||||
public void setFfmpegBin(String ffmpegBin) {
|
||||
this.ffmpegBin = ffmpegBin;
|
||||
}
|
||||
|
||||
public String getFfmpegCmd() {
|
||||
return ffmpegCmd;
|
||||
}
|
||||
|
||||
public void setFfmpegCmd(String ffmpegCmd) {
|
||||
this.ffmpegCmd = ffmpegCmd;
|
||||
}
|
||||
|
||||
public String getFfmpegLog() {
|
||||
return ffmpegLog;
|
||||
}
|
||||
|
||||
public void setFfmpegLog(String ffmpegLog) {
|
||||
this.ffmpegLog = ffmpegLog;
|
||||
}
|
||||
|
||||
public String getGeneralEnableVhost() {
|
||||
return generalEnableVhost;
|
||||
}
|
||||
|
||||
public void setGeneralEnableVhost(String generalEnableVhost) {
|
||||
this.generalEnableVhost = generalEnableVhost;
|
||||
}
|
||||
|
||||
public String getGeneralFlowThreshold() {
|
||||
return generalFlowThreshold;
|
||||
}
|
||||
|
||||
public void setGeneralFlowThreshold(String generalFlowThreshold) {
|
||||
this.generalFlowThreshold = generalFlowThreshold;
|
||||
}
|
||||
|
||||
public String getGeneralMaxStreamWaitMS() {
|
||||
return generalMaxStreamWaitMS;
|
||||
}
|
||||
|
||||
public void setGeneralMaxStreamWaitMS(String generalMaxStreamWaitMS) {
|
||||
this.generalMaxStreamWaitMS = generalMaxStreamWaitMS;
|
||||
}
|
||||
|
||||
public String getGeneralStreamNoneReaderDelayMS() {
|
||||
return generalStreamNoneReaderDelayMS;
|
||||
}
|
||||
|
||||
public void setGeneralStreamNoneReaderDelayMS(String generalStreamNoneReaderDelayMS) {
|
||||
this.generalStreamNoneReaderDelayMS = generalStreamNoneReaderDelayMS;
|
||||
}
|
||||
|
||||
public String getLocalIP() {
|
||||
return localIP;
|
||||
}
|
||||
|
||||
public void setLocalIP(String localIP) {
|
||||
this.localIP = localIP;
|
||||
}
|
||||
|
||||
public String getHlsFileBufSize() {
|
||||
return hlsFileBufSize;
|
||||
}
|
||||
|
||||
public void setHlsFileBufSize(String hlsFileBufSize) {
|
||||
this.hlsFileBufSize = hlsFileBufSize;
|
||||
}
|
||||
|
||||
public String getHlsFilePath() {
|
||||
return hlsFilePath;
|
||||
}
|
||||
|
||||
public void setHlsFilePath(String hlsFilePath) {
|
||||
this.hlsFilePath = hlsFilePath;
|
||||
}
|
||||
|
||||
public String getHlsSegDur() {
|
||||
return hlsSegDur;
|
||||
}
|
||||
|
||||
public void setHlsSegDur(String hlsSegDur) {
|
||||
this.hlsSegDur = hlsSegDur;
|
||||
}
|
||||
|
||||
public String getHlsSegNum() {
|
||||
return hlsSegNum;
|
||||
}
|
||||
|
||||
public void setHlsSegNum(String hlsSegNum) {
|
||||
this.hlsSegNum = hlsSegNum;
|
||||
}
|
||||
|
||||
public String getHookAccessFileExceptHLS() {
|
||||
return hookAccessFileExceptHLS;
|
||||
}
|
||||
|
||||
public void setHookAccessFileExceptHLS(String hookAccessFileExceptHLS) {
|
||||
this.hookAccessFileExceptHLS = hookAccessFileExceptHLS;
|
||||
}
|
||||
|
||||
public String getHookAdminParams() {
|
||||
return hookAdminParams;
|
||||
}
|
||||
|
||||
public void setHookAdminParams(String hookAdminParams) {
|
||||
this.hookAdminParams = hookAdminParams;
|
||||
}
|
||||
|
||||
public String getHookEnable() {
|
||||
return hookEnable;
|
||||
}
|
||||
|
||||
public void setHookEnable(String hookEnable) {
|
||||
this.hookEnable = hookEnable;
|
||||
}
|
||||
|
||||
public String getHookOnFlowReport() {
|
||||
return hookOnFlowReport;
|
||||
}
|
||||
|
||||
public void setHookOnFlowReport(String hookOnFlowReport) {
|
||||
this.hookOnFlowReport = hookOnFlowReport;
|
||||
}
|
||||
|
||||
public String getHookOnHttpAccess() {
|
||||
return hookOnHttpAccess;
|
||||
}
|
||||
|
||||
public void setHookOnHttpAccess(String hookOnHttpAccess) {
|
||||
this.hookOnHttpAccess = hookOnHttpAccess;
|
||||
}
|
||||
|
||||
public String getHookOnPlay() {
|
||||
return hookOnPlay;
|
||||
}
|
||||
|
||||
public void setHookOnPlay(String hookOnPlay) {
|
||||
this.hookOnPlay = hookOnPlay;
|
||||
}
|
||||
|
||||
public String getHookOnPublish() {
|
||||
return hookOnPublish;
|
||||
}
|
||||
|
||||
public void setHookOnPublish(String hookOnPublish) {
|
||||
this.hookOnPublish = hookOnPublish;
|
||||
}
|
||||
|
||||
public String getHookOnRecordMp4() {
|
||||
return hookOnRecordMp4;
|
||||
}
|
||||
|
||||
public void setHookOnRecordMp4(String hookOnRecordMp4) {
|
||||
this.hookOnRecordMp4 = hookOnRecordMp4;
|
||||
}
|
||||
|
||||
public String getHookOnRtspAuth() {
|
||||
return hookOnRtspAuth;
|
||||
}
|
||||
|
||||
public void setHookOnRtspAuth(String hookOnRtspAuth) {
|
||||
this.hookOnRtspAuth = hookOnRtspAuth;
|
||||
}
|
||||
|
||||
public String getHookOnRtspRealm() {
|
||||
return hookOnRtspRealm;
|
||||
}
|
||||
|
||||
public void setHookOnRtspRealm(String hookOnRtspRealm) {
|
||||
this.hookOnRtspRealm = hookOnRtspRealm;
|
||||
}
|
||||
|
||||
public String getHookOnShellLogin() {
|
||||
return hookOnShellLogin;
|
||||
}
|
||||
|
||||
public void setHookOnShellLogin(String hookOnShellLogin) {
|
||||
this.hookOnShellLogin = hookOnShellLogin;
|
||||
}
|
||||
|
||||
public String getHookOnStreamChanged() {
|
||||
return hookOnStreamChanged;
|
||||
}
|
||||
|
||||
public void setHookOnStreamChanged(String hookOnStreamChanged) {
|
||||
this.hookOnStreamChanged = hookOnStreamChanged;
|
||||
}
|
||||
|
||||
public String getHookOnStreamNoneReader() {
|
||||
return hookOnStreamNoneReader;
|
||||
}
|
||||
|
||||
public void setHookOnStreamNoneReader(String hookOnStreamNoneReader) {
|
||||
this.hookOnStreamNoneReader = hookOnStreamNoneReader;
|
||||
}
|
||||
|
||||
public String getHookOnStreamNotFound() {
|
||||
return hookOnStreamNotFound;
|
||||
}
|
||||
|
||||
public void setHookOnStreamNotFound(String hookOnStreamNotFound) {
|
||||
this.hookOnStreamNotFound = hookOnStreamNotFound;
|
||||
}
|
||||
|
||||
public String getHookTimeoutSec() {
|
||||
return hookTimeoutSec;
|
||||
}
|
||||
|
||||
public void setHookTimeoutSec(String hookTimeoutSec) {
|
||||
this.hookTimeoutSec = hookTimeoutSec;
|
||||
}
|
||||
|
||||
public String getHttpCharSet() {
|
||||
return httpCharSet;
|
||||
}
|
||||
|
||||
public void setHttpCharSet(String httpCharSet) {
|
||||
this.httpCharSet = httpCharSet;
|
||||
}
|
||||
|
||||
public String getHttpKeepAliveSecond() {
|
||||
return httpKeepAliveSecond;
|
||||
}
|
||||
|
||||
public void setHttpKeepAliveSecond(String httpKeepAliveSecond) {
|
||||
this.httpKeepAliveSecond = httpKeepAliveSecond;
|
||||
}
|
||||
|
||||
public String getHttpMaxReqCount() {
|
||||
return httpMaxReqCount;
|
||||
}
|
||||
|
||||
public void setHttpMaxReqCount(String httpMaxReqCount) {
|
||||
this.httpMaxReqCount = httpMaxReqCount;
|
||||
}
|
||||
|
||||
public String getHttpMaxReqSize() {
|
||||
return httpMaxReqSize;
|
||||
}
|
||||
|
||||
public void setHttpMaxReqSize(String httpMaxReqSize) {
|
||||
this.httpMaxReqSize = httpMaxReqSize;
|
||||
}
|
||||
|
||||
public String getHttpNotFound() {
|
||||
return httpNotFound;
|
||||
}
|
||||
|
||||
public void setHttpNotFound(String httpNotFound) {
|
||||
this.httpNotFound = httpNotFound;
|
||||
}
|
||||
|
||||
public String getHttpPort() {
|
||||
return httpPort;
|
||||
}
|
||||
|
||||
public void setHttpPort(String httpPort) {
|
||||
this.httpPort = httpPort;
|
||||
}
|
||||
|
||||
public String getHttpRootPath() {
|
||||
return httpRootPath;
|
||||
}
|
||||
|
||||
public void setHttpRootPath(String httpRootPath) {
|
||||
this.httpRootPath = httpRootPath;
|
||||
}
|
||||
|
||||
public String getHttpSendBufSize() {
|
||||
return httpSendBufSize;
|
||||
}
|
||||
|
||||
public void setHttpSendBufSize(String httpSendBufSize) {
|
||||
this.httpSendBufSize = httpSendBufSize;
|
||||
}
|
||||
|
||||
public String getHttpSSLport() {
|
||||
return httpSSLport;
|
||||
}
|
||||
|
||||
public void setHttpSSLport(String httpSSLport) {
|
||||
this.httpSSLport = httpSSLport;
|
||||
}
|
||||
|
||||
public String getMulticastAddrMax() {
|
||||
return multicastAddrMax;
|
||||
}
|
||||
|
||||
public void setMulticastAddrMax(String multicastAddrMax) {
|
||||
this.multicastAddrMax = multicastAddrMax;
|
||||
}
|
||||
|
||||
public String getMulticastAddrMin() {
|
||||
return multicastAddrMin;
|
||||
}
|
||||
|
||||
public void setMulticastAddrMin(String multicastAddrMin) {
|
||||
this.multicastAddrMin = multicastAddrMin;
|
||||
}
|
||||
|
||||
public String getMulticastUdpTTL() {
|
||||
return multicastUdpTTL;
|
||||
}
|
||||
|
||||
public void setMulticastUdpTTL(String multicastUdpTTL) {
|
||||
this.multicastUdpTTL = multicastUdpTTL;
|
||||
}
|
||||
|
||||
public String getRecordAppName() {
|
||||
return recordAppName;
|
||||
}
|
||||
|
||||
public void setRecordAppName(String recordAppName) {
|
||||
this.recordAppName = recordAppName;
|
||||
}
|
||||
|
||||
public String getRecordFilePath() {
|
||||
return recordFilePath;
|
||||
}
|
||||
|
||||
public void setRecordFilePath(String recordFilePath) {
|
||||
this.recordFilePath = recordFilePath;
|
||||
}
|
||||
|
||||
public String getRecordFileSecond() {
|
||||
return recordFileSecond;
|
||||
}
|
||||
|
||||
public void setRecordFileSecond(String recordFileSecond) {
|
||||
this.recordFileSecond = recordFileSecond;
|
||||
}
|
||||
|
||||
public String getRecordFileSampleMS() {
|
||||
return recordFileSampleMS;
|
||||
}
|
||||
|
||||
public void setRecordFileSampleMS(String recordFileSampleMS) {
|
||||
this.recordFileSampleMS = recordFileSampleMS;
|
||||
}
|
||||
|
||||
public String getRtmpHandshakeSecond() {
|
||||
return rtmpHandshakeSecond;
|
||||
}
|
||||
|
||||
public void setRtmpHandshakeSecond(String rtmpHandshakeSecond) {
|
||||
this.rtmpHandshakeSecond = rtmpHandshakeSecond;
|
||||
}
|
||||
|
||||
public String getRtmpKeepAliveSecond() {
|
||||
return rtmpKeepAliveSecond;
|
||||
}
|
||||
|
||||
public void setRtmpKeepAliveSecond(String rtmpKeepAliveSecond) {
|
||||
this.rtmpKeepAliveSecond = rtmpKeepAliveSecond;
|
||||
}
|
||||
|
||||
public String getRtmpModifyStamp() {
|
||||
return rtmpModifyStamp;
|
||||
}
|
||||
|
||||
public void setRtmpModifyStamp(String rtmpModifyStamp) {
|
||||
this.rtmpModifyStamp = rtmpModifyStamp;
|
||||
}
|
||||
|
||||
public String getRtmpPort() {
|
||||
return rtmpPort;
|
||||
}
|
||||
|
||||
public void setRtmpPort(String rtmpPort) {
|
||||
this.rtmpPort = rtmpPort;
|
||||
}
|
||||
|
||||
public String getRtpAudioMtuSize() {
|
||||
return rtpAudioMtuSize;
|
||||
}
|
||||
|
||||
public void setRtpAudioMtuSize(String rtpAudioMtuSize) {
|
||||
this.rtpAudioMtuSize = rtpAudioMtuSize;
|
||||
}
|
||||
|
||||
public String getRtpClearCount() {
|
||||
return rtpClearCount;
|
||||
}
|
||||
|
||||
public void setRtpClearCount(String rtpClearCount) {
|
||||
this.rtpClearCount = rtpClearCount;
|
||||
}
|
||||
|
||||
public String getRtpCycleMS() {
|
||||
return rtpCycleMS;
|
||||
}
|
||||
|
||||
public void setRtpCycleMS(String rtpCycleMS) {
|
||||
this.rtpCycleMS = rtpCycleMS;
|
||||
}
|
||||
|
||||
public String getRtpMaxRtpCount() {
|
||||
return rtpMaxRtpCount;
|
||||
}
|
||||
|
||||
public void setRtpMaxRtpCount(String rtpMaxRtpCount) {
|
||||
this.rtpMaxRtpCount = rtpMaxRtpCount;
|
||||
}
|
||||
|
||||
public String getRtpVideoMtuSize() {
|
||||
return rtpVideoMtuSize;
|
||||
}
|
||||
|
||||
public void setRtpVideoMtuSize(String rtpVideoMtuSize) {
|
||||
this.rtpVideoMtuSize = rtpVideoMtuSize;
|
||||
}
|
||||
|
||||
public String getRtpProxyCheckSource() {
|
||||
return rtpProxyCheckSource;
|
||||
}
|
||||
|
||||
public void setRtpProxyCheckSource(String rtpProxyCheckSource) {
|
||||
this.rtpProxyCheckSource = rtpProxyCheckSource;
|
||||
}
|
||||
|
||||
public String getRtpProxyDumpDir() {
|
||||
return rtpProxyDumpDir;
|
||||
}
|
||||
|
||||
public void setRtpProxyDumpDir(String rtpProxyDumpDir) {
|
||||
this.rtpProxyDumpDir = rtpProxyDumpDir;
|
||||
}
|
||||
|
||||
public String getRtpProxyPort() {
|
||||
return rtpProxyPort;
|
||||
}
|
||||
|
||||
public void setRtpProxyPort(String rtpProxyPort) {
|
||||
this.rtpProxyPort = rtpProxyPort;
|
||||
}
|
||||
|
||||
public String getRtpProxyTimeoutSec() {
|
||||
return rtpProxyTimeoutSec;
|
||||
}
|
||||
|
||||
public void setRtpProxyTimeoutSec(String rtpProxyTimeoutSec) {
|
||||
this.rtpProxyTimeoutSec = rtpProxyTimeoutSec;
|
||||
}
|
||||
|
||||
public String getRtspAuthBasic() {
|
||||
return rtspAuthBasic;
|
||||
}
|
||||
|
||||
public void setRtspAuthBasic(String rtspAuthBasic) {
|
||||
this.rtspAuthBasic = rtspAuthBasic;
|
||||
}
|
||||
|
||||
public String getRtspHandshakeSecond() {
|
||||
return rtspHandshakeSecond;
|
||||
}
|
||||
|
||||
public void setRtspHandshakeSecond(String rtspHandshakeSecond) {
|
||||
this.rtspHandshakeSecond = rtspHandshakeSecond;
|
||||
}
|
||||
|
||||
public String getRtspKeepAliveSecond() {
|
||||
return rtspKeepAliveSecond;
|
||||
}
|
||||
|
||||
public void setRtspKeepAliveSecond(String rtspKeepAliveSecond) {
|
||||
this.rtspKeepAliveSecond = rtspKeepAliveSecond;
|
||||
}
|
||||
|
||||
public String getRtspPort() {
|
||||
return rtspPort;
|
||||
}
|
||||
|
||||
public void setRtspPort(String rtspPort) {
|
||||
this.rtspPort = rtspPort;
|
||||
}
|
||||
|
||||
public String getRtspSSlport() {
|
||||
return rtspSSlport;
|
||||
}
|
||||
|
||||
public void setRtspSSlport(String rtspSSlport) {
|
||||
this.rtspSSlport = rtspSSlport;
|
||||
}
|
||||
|
||||
public String getShellMaxReqSize() {
|
||||
return shellMaxReqSize;
|
||||
}
|
||||
|
||||
public void setShellMaxReqSize(String shellMaxReqSize) {
|
||||
this.shellMaxReqSize = shellMaxReqSize;
|
||||
}
|
||||
|
||||
public String getShellPhell() {
|
||||
return shellPhell;
|
||||
}
|
||||
|
||||
public void setShellPhell(String shellPhell) {
|
||||
this.shellPhell = shellPhell;
|
||||
}
|
||||
|
||||
public String getWanIp() {
|
||||
return wanIp;
|
||||
}
|
||||
|
||||
public void setWanIp(String wanIp) {
|
||||
this.wanIp = wanIp;
|
||||
}
|
||||
|
||||
public long getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(long updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getGeneralMediaServerId() {
|
||||
return generalMediaServerId;
|
||||
}
|
||||
|
||||
public void setGeneralMediaServerId(String generalMediaServerId) {
|
||||
this.generalMediaServerId = generalMediaServerId;
|
||||
}
|
||||
|
||||
public String getRtmpSslPort() {
|
||||
return rtmpSslPort;
|
||||
}
|
||||
|
||||
public void setRtmpSslPort(String rtmpSslPort) {
|
||||
this.rtmpSslPort = rtmpSslPort;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.genersoft.iot.vmp.media.zlm;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Component
|
||||
public class ZLMServerManger {
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Autowired
|
||||
private MediaConfig mediaConfig;
|
||||
|
||||
public void updateServerCatch(ZLMServerConfig zlmServerConfig) {
|
||||
|
||||
zlmServerConfig.setLocalIP(mediaConfig.getIp());
|
||||
zlmServerConfig.setWanIp(StringUtils.isEmpty(mediaConfig.getWanIp())? mediaConfig.getIp(): mediaConfig.getWanIp());
|
||||
zlmServerConfig.setHttpPort(mediaConfig.getHttpPort());
|
||||
|
||||
if(!StringUtils.isEmpty(mediaConfig.getHttpSSlPort()))
|
||||
zlmServerConfig.setHttpSSLport(mediaConfig.getHttpSSlPort());
|
||||
|
||||
if(!StringUtils.isEmpty(mediaConfig.getRtspPort()))
|
||||
zlmServerConfig.setRtspPort(mediaConfig.getRtspPort());
|
||||
|
||||
if(!StringUtils.isEmpty(mediaConfig.getRtspSSLPort()))
|
||||
zlmServerConfig.setRtspSSlport(mediaConfig.getRtspSSLPort());
|
||||
|
||||
if(!StringUtils.isEmpty(mediaConfig.getRtmpPort()))
|
||||
zlmServerConfig.setRtmpPort(mediaConfig.getRtmpPort());
|
||||
|
||||
if(!StringUtils.isEmpty(mediaConfig.getRtmpSSlPort()))
|
||||
zlmServerConfig.setRtmpSslPort(mediaConfig.getRtmpSSlPort());
|
||||
|
||||
if(!StringUtils.isEmpty(mediaConfig.getRtpProxyPort()))
|
||||
zlmServerConfig.setRtpProxyPort(mediaConfig.getRtpProxyPort());
|
||||
|
||||
redisCatchStorage.updateMediaInfo(zlmServerConfig);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user