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

OBS streaming to SRS, republishing failed

winlinvip opened this issue · comments

As mentioned in the title.

TRANS_BY_GPT3

You can use tcpdump to capture packets: sudo tcpdump -w nginx.pcap tcp port 19350
Then use Wireshark to analyze and decode it as RTMPT.

TRANS_BY_GPT3

nginx-rtmp has no problem stopping and starting again after starting. However, with SRS, after starting and stopping, it gets stuck at "connecting" and eventually times out. It is unable to establish a connection for continuous publishing.

TRANS_BY_GPT3

The package sent by OBS is:
FCUnpublish(7, winlin)
DeleteStream(8, 1)

And NginxRTMP only returns one:
OnStatus(NetStream.Unpublish.Success)

And SRS returns three (in the same way as FMS returns):
OnFCUnpublish(NetStream.Unpublish.Success)
_result(7)
OnStatus(NetStream.Unpublish.Success)
_result(8)

Actually, this connection has already been disconnected during stop, so it is a problem when dealing with new connections.

TRANS_BY_GPT3

It was found that in the second connection packet sent by OBS to SRS, there is an app in the tcURL. However, OBS only has an app in the first packet sent to nginx, and there is no app in the following packets. It seems that nginx did not disconnect the connection.

TRANS_BY_GPT3

The result is that it is a problem with the chunk_size. OBS should set the chunk_size before exceeding 128 bytes, otherwise it will cause parsing failure.

TRANS_BY_GPT3