| | |
| | | */ |
| | | @Override |
| | | public void zlmServerOnline(ZLMServerConfig zlmServerConfig) { |
| | | logger.info("[ZLM] 正在连接 : {} -> {}:{}", |
| | | zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort()); |
| | | |
| | | MediaServerItem serverItem = mediaServerMapper.queryOne(zlmServerConfig.getGeneralMediaServerId()); |
| | | if (serverItem == null) { |
| | | logger.warn("[未注册的zlm] 拒接接入:{}来自{}:{}", zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(),zlmServerConfig.getHttpPort() ); |
| | | logger.warn("请检查ZLM的<general.mediaServerId>配置是否与WVP的<media.id>一致"); |
| | | return; |
| | | }else { |
| | | logger.info("[ZLM] 正在连接 : {} -> {}:{}", |
| | | zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort()); |
| | | } |
| | | serverItem.setHookAliveInterval(zlmServerConfig.getHookAliveInterval()); |
| | | if (serverItem.getHttpPort() == 0) { |
| | |
| | | param.put("api.secret",mediaServerItem.getSecret()); // -profile:v Baseline |
| | | param.put("ffmpeg.cmd","%s -fflags nobuffer -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",""); |
| | | param.put("hook.on_flow_report",String.format("%s/on_flow_report", hookPrex)); |
| | | param.put("hook.on_play",String.format("%s/on_play", hookPrex)); |
| | | param.put("hook.on_http_access",""); |
| | | param.put("hook.on_http_access",String.format("%s/on_http_access", hookPrex)); |
| | | param.put("hook.on_publish", String.format("%s/on_publish", hookPrex)); |
| | | param.put("hook.on_record_mp4",recordHookPrex != null? String.format("%s/on_record_mp4", recordHookPrex): ""); |
| | | param.put("hook.on_record_ts",""); |
| | | param.put("hook.on_rtsp_auth",""); |
| | | param.put("hook.on_rtsp_realm",""); |
| | | param.put("hook.on_record_ts",String.format("%s/on_record_ts", hookPrex)); |
| | | param.put("hook.on_rtsp_auth",String.format("%s/on_rtsp_auth", hookPrex)); |
| | | param.put("hook.on_rtsp_realm",String.format("%s/on_rtsp_realm", hookPrex)); |
| | | param.put("hook.on_server_started",String.format("%s/on_server_started", hookPrex)); |
| | | param.put("hook.on_shell_login",String.format("%s/on_shell_login", hookPrex)); |
| | | param.put("hook.on_stream_changed",String.format("%s/on_stream_changed", hookPrex)); |
| | |
| | | MediaServerItem mediaServerItem = getOne(mediaServerId); |
| | | if (mediaServerItem == null) { |
| | | // zlm连接重试 |
| | | |
| | | logger.warn("[更新ZLM 保活信息]失败,未找到流媒体信息"); |
| | | return; |
| | | } |