ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.

Home Page:https://ossrs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

APPLICATION: Hanvision Makito X cann't publish to SRS.

winlinvip opened this issue · comments

[2017-04-15 18:50:59.880][Trace][27099][107] RTMP client ip=xxx, fd=10
[2017-04-15 18:50:59.884][Trace][27099][107] srand initialized the random.
[2017-04-15 18:50:59.919][Trace][27099][109] RTMP client ip=xxx, fd=11
[2017-04-15 18:50:59.956][Trace][27099][111] RTMP client ip=xxx, fd=12
[2017-04-15 18:50:59.965][Trace][27099][107] simple handshake success.
[2017-04-15 18:50:59.971][Trace][27099][109] simple handshake success.
[2017-04-15 18:50:59.991][Trace][27099][111] simple handshake success.
[2017-04-15 18:50:59.993][Trace][27099][107] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 18:50:59.998][Trace][27099][109] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 18:51:00.031][Trace][27099][111] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 18:51:00.881][Trace][27099][111] ignore AMF0/AMF3 command message.

wechatimg2

Comparing to FFMPEG/FMLE, the haivision use another completely different protocol, although over RTMP, but the application level protocol is not the same at all.

haivision

FFMPEG:

C/S: Handshake
C: ConnectApp() tcUrl=xxx
S: Ack Size 2500,000
S: Set Peer Bandwidth 2500,000
S: Set Chunk Size 60,000
C: Set Chunk Size 60,000
S: ConnectApp() _result
S: onBWDone()

C: releaseStream+FCPublish(s0)
C: createStream()
S: releaseStream _result
C: _checkbw()
S: FCPublish() _result
S: createStream() _result
C: publish(s0)
S: onFCPublish()
S: onStatus()

Haivision:

C/S: Handshake
C: Set Chunk Size 4096+ ConnectApp() tcUrl=xxx
S: Ack Size 2500,000
S: ConnectApp() _result + Set Peer Bandwidth + Set Chunk Size 60,000

C: _checkbw()
S: _checkbw() _result
C: createStream()
S: createStream() _result
C: FCPublish()
S: FCPublish() _result
C: publish()
S: onFCPublish()
S: onStatus()
----OK------
C: Stream Begin
C: @setDataFrame()
C: AudioData
C: VideoData

Seems the haivision encoder start more than one connection to publish:

winlin:srs winlin$ grep "107" t.txt 
[2017-04-15 20:15:36.295][trace][29803][107] RTMP client ip=xxx
[2017-04-15 20:15:36.295][trace][29803][107] srand initialized the random.
[2017-04-15 20:15:36.412][trace][29803][107] simple handshake success.
[2017-04-15 20:15:36.440][trace][29803][107] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 20:15:36.528][trace][29803][107] Haivision encoder identified.
winlin:srs winlin$ 
winlin:srs winlin$ grep "109" t.txt 
[2017-04-15 20:15:36.336][trace][29803][109] RTMP client ip=xxx
[2017-04-15 20:15:36.418][trace][29803][109] simple handshake success.
[2017-04-15 20:15:36.446][trace][29803][109] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 20:15:36.549][trace][29803][109] Haivision encoder identified.
winlin:srs winlin$ 
winlin:srs winlin$ grep "111" t.txt 
[2017-04-15 20:15:36.375][trace][29803][111] RTMP client ip=xxx
[2017-04-15 20:15:36.426][trace][29803][111] simple handshake success.
[2017-04-15 20:15:36.455][trace][29803][111] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 20:15:36.578][trace][29803][111] Haivision encoder identified.
winlin:srs winlin$ 
winlin:srs winlin$ grep "113" t.txt 
[2017-04-15 20:15:36.415][trace][29803][113] RTMP client ip=xxx
[2017-04-15 20:15:36.449][trace][29803][113] simple handshake success.
[2017-04-15 20:15:36.477][trace][29803][113] connect app, tcUrl=rtmp://ossrs.net:11935/live, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=11935, app=live, args=null
[2017-04-15 20:15:36.604][trace][29803][113] Haivision encoder identified.
[2017-04-15 20:15:37.357][trace][29803][113] client identified, type=haivision-publish, stream_name=s0, duration=-1.00
[2017-04-15 20:15:37.378][trace][29803][113] source url=/live/s0, ip=xxx, cache=1, is_edge=0, source_id=-1[-1]
[2017-04-15 20:15:37.388][trace][29803][113] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0, rtcid=116
[2017-04-15 20:15:37.422][trace][29803][113] fmle ignore AMF0/AMF3 command message.
[2017-04-15 20:15:37.490][trace][29803][113] got metadata, width=1280, height=720
[2017-04-15 20:15:38.488][trace][29803][113] protocol in.buffer=0, in.ack=0, out.ack=2500000, in.chunk=4096, out.chunk=60000
[2017-04-15 20:15:38.488][trace][29803][113] 4B audio sh, codec(10, profile=LC, 2channels, 0kbps, 48000HZ), flv(16bits, 2channels, 44100HZ)
[2017-04-15 20:15:39.778][warn][29803][113][11] VIDEO: stream not monotonically increase, please open mix_correct.
[2017-04-15 20:15:39.778][trace][29803][113] 92B video sh,  codec(7, profile=High, level=3.1, 80x48, 0kbps, 0fps, 0s)

But only the last one will publish the content, the other three I don't know what they are.

Haivision:

C/S: Handshake
C: Set Chunk Size 4096+ ConnectApp() tcUrl=xxx
S: Ack Size 2500,000
S: ConnectApp() _result + Set Peer Bandwidth + Set Chunk Size 60,000

C: _checkbw()
S: _checkbw() _result
C: createStream()
S: createStream() _result
C: FCPublish()
S: FCPublish() _result
C: publish()
S: onFCPublish()
S: onStatus()
----OK------
C: Stream Begin
C: @setDataFrame()
C: AudioData
C: VideoData