shogo4405 / HaishinKit.swift

Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.
BSD 3-Clause "New" or "Revised" License
2.77k stars 614 forks source link

Connecting to the rtmpConnection.connect domain results in connect.Closed. #330

Closed JeonghunPark closed 6 years ago

JeonghunPark commented 6 years ago

rtmp publish - wowza Saver(IP) - edge Server(domain) - rtmp play

rtmp publish : ip connect rtmp play : ip connect(wowza) : connect.Success rtmp play : domain connect(edge server) : connect.Closed

At https://www.wowza.com/testplayers, it runs when connected to an edge server. HaishinKit can not connect when domain is connected

I want to know if there is a way.

ps. Thank you for making HaishinKit.

shogo4405 commented 6 years ago

How about without edge Server? rtmp publish - wowza Saver(IP) - rtmp play. It is same?

And I want see RTMP Publisher sidelog.

Best regards.

JeonghunPark commented 6 years ago

Only the edge server can not be connected. rtmp publish - wowza Saver (IP) - rtmp is played. But after a while the video stops.

[Info] [com.haishinkit.HaishinKit] [81] inSourceFormat > nil
[Info] [com.haishinkit.HaishinKit] [35] fps > (fps: 29.970000029969999, duration: __C.CMTime(value: 1001, timescale: 30000, flags: __C.CMTimeFlags(rawValue: 1), epoch: 0))
[Info] [com.haishinkit.HaishinKit] [81] inSourceFormat > Optional(__C.AudioStreamBasicDescription(mSampleRate: 44100.0, mFormatID: 1819304813, mFormatFlags: 41, mBytesPerPacket: 4, mFramesPerPacket: 1, mBytesPerFrame: 4, mChannelsPerFrame: 2, mBitsPerChannel: 32, mReserved: 0))
shogo4405 commented 6 years ago

Sorry. I want see verbose level log.

import Logboard
import HaishinKit

let logger = Logboard.with(HaishinKit.identifier)
logger.level = .verbose.

Please again!

JeonghunPark commented 6 years ago

NetConnection.Connect.Closed log


2017-11-01 16:59:01.424778+0900 broadcast[29560:2565374] [Layout] Detected missing constraints for <NSButton: 0x6180001404d0>.  It cannot be placed because there are not enough constraints to fully define the size and origin. Add the missing constraints, or set translatesAutoresizingMaskIntoConstraints=YES and constraints will be generated for you. If this view is laid out manually on macOS 10.12 and later, you may choose to not call [super layout] from your override. Set a breakpoint on DETECTED_MISSING_CONSTRAINTS to debug. This error will only be logged once.
[Trace] [com.haishinkit.HaishinKit] [84] doOutput(chunk:locked:) > RTMPChunk{size:0,type:zero,streamId:3,message:Optional(RTMPCommandMessage{type:amf0Command,length:291,streamId:0,timestamp:0,payload:279 bytes,objectEncoding:0,commandName:connect,transactionId:1,commandObject:Optional(["videoCodecs": Optional(128), "tcUrl": Optional("rtmp://live......hscdn.com/pop_cast10"), "flashVer": Optional("FMLE/3.0 (compatible; FMSc/1.0)"), "app": Optional("pop_cast10"), "videoFunction": Optional(1), "swfUrl": nil, "fpad": Optional(false), "capabilities": Optional(239), "audioCodecs": Optional(1024), "pageUrl": nil, "objectEncoding": Optional(0)]),arguments:[],serializer:AMF0Serializer{data:0 bytes,position:0,reference:HaishinKit.AMFReference}}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [492] listen > RTMPChunk{size:128,type:zero,streamId:2,message:Optional(RTMPWindowAcknowledgementSizeMessage{type:windowAck,length:4,streamId:0,timestamp:0,payload:4 bytes,size:2500000}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [84] doOutput(chunk:locked:) > RTMPChunk{size:0,type:zero,streamId:2,message:Optional(RTMPWindowAcknowledgementSizeMessage{type:windowAck,length:16,streamId:0,timestamp:0,payload:4 bytes,size:2500000}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [492] listen > RTMPChunk{size:128,type:zero,streamId:2,message:Optional(RTMPSetPeerBandwidthMessage{type:bandwidth,length:5,streamId:0,timestamp:0,payload:5 bytes,size:2500000,limit:dynamic}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [492] listen > RTMPChunk{size:128,type:zero,streamId:2,message:Optional(RTMPUserControlMessage{type:user,length:6,streamId:0,timestamp:0,payload:6 bytes,event:streamBegin,value:0}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [492] listen > RTMPChunk{size:128,type:zero,streamId:2,message:Optional(RTMPSetChunkSizeMessage{type:chunkSize,length:4,streamId:0,timestamp:0,payload:4 bytes,size:4096}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [492] listen > RTMPChunk{size:4096,type:zero,streamId:3,message:Optional(RTMPCommandMessage{type:amf0Command,length:288,streamId:0,timestamp:0,payload:288 bytes,objectEncoding:0,commandName:_result,transactionId:1,commandObject:Optional(["fmsVer": Optional("FMS/3,5,7,7009"), "capabilities": Optional(31.0), "mode": Optional(1.0)]),arguments:[Optional(["description": Optional("[ AccessManager.Reject ] : [ code=403 need auth; authmod=adobe ] : "), "data": Optional([]), "level": Optional("status"), "code": Optional("NetConnection.Connect.Success"), "objectEncoding": Optional(0.0)])],serializer:AMF0Serializer{data:0 bytes,position:0,reference:HaishinKit.AMFReference}}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [84] doOutput(chunk:locked:) > RTMPChunk{size:0,type:zero,streamId:2,message:Optional(RTMPSetChunkSizeMessage{type:chunkSize,length:16,streamId:0,timestamp:0,payload:4 bytes,size:8192}),fragmented:false,_data:12 bytes}
[Trace] [com.haishinkit.HaishinKit] [84] doOutput(chunk:locked:) > RTMPChunk{size:0,type:zero,streamId:3,message:Optional(RTMPCommandMessage{type:amf0Command,length:37,streamId:0,timestamp:0,payload:25 bytes,objectEncoding:0,commandName:createStream,transactionId:2,commandObject:nil,arguments:[],serializer:AMF0Serializer{data:0 bytes,position:0,reference:HaishinKit.AMFReference}}),fragmented:false,_data:12 bytes}
2017-11-01 16:59:20.970343+0900 broadcast[29560:2565513] NetConnection.Connect.Success

Main Thread Checker: UI API called on a background thread: -[NSControl stringValue]
PID: 29560, TID: 2565513, Thread name: (none), Queue name: com.haishinkit.HaishinKit.NetSocket.input, QoS: 0
shogo4405 commented 6 years ago

It seems that your Wowza server needs authentication.

But your client settings are no username and password. Format is here rtmp://username:password@hostname/.

Best regards.

[Trace] [com.haishinkit.HaishinKit] [492] listen > RTMPChunk{size:4096,type:zero,streamId:3,message:Optional(RTMPCommandMessage{type:amf0Command,length:288,streamId:0,timestamp:0,payload:288 bytes,objectEncoding:0,commandName:_result,transactionId:1,commandObject:Optional(["fmsVer": Optional("FMS/3,5,7,7009"), "capabilities": Optional(31.0), "mode": Optional(1.0)]),arguments:[Optional(["description": Optional("[ AccessManager.Reject ] : [ code=403 need auth; authmod=adobe ] : "), "data": Optional([]), "level": Optional("status"), "code": Optional("NetConnection.Connect.Success"), "objectEncoding": Optional(0.0)])],serializer:AMF0Serializer{data:0 bytes,position:0,reference:HaishinKit.AMFReference}}),fragmented:false,_data:12 bytes}
JeonghunPark commented 6 years ago

Thanks for the answer.

Even if there is no authentication information in the edge server, connection is possible.

Let's take a closer look at Edge Server and authentication.