| | |
| | | if (streamId == null) { |
| | | streamId = String.format("%08x", Long.parseLong(ssrc)).toUpperCase(); |
| | | } |
| | | int ssrcCheckParam = 0; |
| | | if (ssrcCheck && tcpMode > 1) { |
| | | if (ssrcCheck && tcpMode > 0) { |
| | | // 目前zlm不支持 tcp模式更新ssrc,暂时关闭ssrc校验 |
| | | logger.warn("[openRTPServer] TCP被动/TCP主动收流时,默认关闭ssrc检验"); |
| | | logger.warn("[openRTPServer] 平台对接时下级可能自定义ssrc,但是tcp模式zlm收流目前无法更新ssrc,可能收流超时,此时请使用udp收流或者关闭ssrc校验"); |
| | | } |
| | | int rtpServerPort; |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | rtpServerPort = zlmServerFactory.createRTPServer(mediaServerItem, streamId, (ssrcCheck && tcpMode == 0) ? Long.parseLong(ssrc) : 0, port, reUsePort, tcpMode); |
| | | rtpServerPort = zlmServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck ? Long.parseLong(ssrc) : 0, port, reUsePort, tcpMode); |
| | | } else { |
| | | rtpServerPort = mediaServerItem.getRtpProxyPort(); |
| | | } |
| | |
| | | @Override |
| | | public void closeRTPServer(String mediaServerId, String streamId) { |
| | | MediaServerItem mediaServerItem = this.getOne(mediaServerId); |
| | | closeRTPServer(mediaServerItem, streamId); |
| | | if (mediaServerItem.isRtpEnable()) { |
| | | closeRTPServer(mediaServerItem, streamId); |
| | | } |
| | | zlmresTfulUtils.closeStreams(mediaServerItem, "rtp", streamId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("api.secret",mediaServerItem.getSecret()); // -profile:v Baseline |
| | | if (mediaServerItem.getRtspPort() != 0) { |
| | | param.put("ffmpeg.snap", "%s -rtsp_transport tcp -i %s -y -f mjpeg -t 0.001 %s"); |
| | | param.put("ffmpeg.snap", "%s -rtsp_transport tcp -i %s -y -f mjpeg -frames:v 1 %s"); |
| | | } |
| | | param.put("hook.enable","1"); |
| | | param.put("hook.on_flow_report",""); |
| | |
| | | if (mediaServerItem.getRecordPath() != null) { |
| | | File recordPathFile = new File(mediaServerItem.getRecordPath()); |
| | | param.put("protocol.mp4_save_path", recordPathFile.getParentFile().getPath()); |
| | | param.put("protocol.downloadRoot", recordPathFile.getParentFile().getPath()); |
| | | param.put("record.appName", recordPathFile.getName()); |
| | | } |
| | | |