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

Support Edge or forward to the Douyu platform.

yangchar opened this issue · comments

Douyu push stream address:
rtmp://send1.douyu.com/live/3455056rTfTqkuKRwsSecret=1c010114d48d8cd7dec686bdb705ec30&wsTime=5a3d1733&wsSeek=off

Error code location:
30696 amf0 read undefined marker failed. ret=2003

TRANS_BY_GPT3

commented

The librtmp inside SRS has issues when integrating with other platforms. Currently, it can only be integrated with SRS and nginx-rtmp.

TRANS_BY_GPT3

Please provide detailed logs or packet captures. It seems that there is some information in the AMF0 object returned by the Douyu server that cannot be parsed.

TRANS_BY_GPT3

image

SRS edge config:

vhost __defaultVhost__ {
    mode            remote;
    origin          send3a.douyu.com;
}

The server needs to place the requested parameters in the stream.

image

The above image is SRS2, and the below image is SRS3. Pushing in edge mode to Wangsu is successful.

image

TRANS_BY_GPT3

SRS is configured as Edge, for example:

listen              1935;
max_connections     1000;
pid                 objs/edge.pid;
daemon              off;
srs_log_tank        console;
vhost __defaultVhost__ {
    mode            remote;
    origin          send3a.douyu.com;
}

Alternatively, it can be configured as Forwarder as well:

listen              1935;
max_connections     1000;
pid                 ./objs/srs.master.pid;
daemon              off;
srs_log_tank        console;
vhost __defaultVhost__ {
    forward         send3a.douyu.com;
}

Use FFMPEG to push the stream to SRS, replace the token with your token:

token="wsSecret=xxxxxxxxx&wsTime=xxxxx&wsSeek=off&wm=0&tw=0" &&
ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy -f flv -y \
    "rtmp://127.0.0.1/live/5426598rVrGUlcxm?$token"

Watch in Douyu room:

image

TRANS_BY_GPT3

@yangchar please re-export srslibrtmp and test if it works. If there are any issues, reopen this issue.

TRANS_BY_GPT3

commented

The client playback is having issues after making this change.
image

TRANS_BY_GPT3