Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srs.librtmp cannot connect to FMS/RED5 #418

Closed
backylee opened this issue Jun 4, 2015 · 11 comments
Closed

srs.librtmp cannot connect to FMS/RED5 #418

backylee opened this issue Jun 4, 2015 · 11 comments
Assignees
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Milestone

Comments

@backylee
Copy link

backylee commented Jun 4, 2015

srs.librtmp is a modified version of librtmp. Testing the integration of srs.librtmp with both srs and nginx-rtmp is successful. However, testing the integration with FMS and RED5 has failed. Wenjie's BLE uses librtmp and has no issues with integrating with FMS. Maintaining compatibility with librtmp is of great significance for srs.librtmp, especially considering that FMS and RED5 are leading players in the field.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jun 4, 2015

Just state the problem directly, and I will assess whether it needs to be corrected.

TRANS_BY_GPT3

@winlinvip winlinvip added the Bug It might be a bug. label Jun 4, 2015
@winlinvip winlinvip added this to the srs 3.0 release milestone Jun 4, 2015
@illuspas
Copy link

illuspas commented Nov 24, 2015

The problem with integrating RED5 (1.0.6-release) is that the RTMP Body structure of '_result('NetConnection.Connect.Success')' is String, Number, NULL, Object. The current SrsConnectAppResPacket::decode function handles the NULL case incorrectly. I have made the following changes to fix it.

char marker = stream->read_1bytes();
if (marker == RTMP_AMF0_Null) {
    return ret;
}

TRANS_BY_GPT3

@illuspas
Copy link

illuspas commented Nov 24, 2015

FMS for some reason, it seems that after sending this SrsSetWindowAckSizePacket, no data can be read anymore.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Nov 24, 2015

The RTMP protocol should not be Null, but this can be compatible.

TRANS_BY_GPT3

@illuspas
Copy link

illuspas commented Nov 24, 2015

It seems that the problem with fms has been found.
Using a simple handshake requires c2 to be equal to s1.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Nov 24, 2015

@illuspas It seems to be an equivalent, huh? Have you tried it? Can we bypass it by changing it to a complex handshake? Or would it be possible to bypass it by making c2 equal to s1?

TRANS_BY_GPT3

@illuspas
Copy link

illuspas commented Nov 24, 2015

I didn't try a complicated handshake. I directly copied the memory in SrsHandshakeBytes::create_c2() and it worked. Previously, the handshake was successful, but when I continued to send another packet of data, the fms forcibly closed the socket. Checking the status with netstat showed it changed to FIN_WAIT_2.
The test was done on FMS 4.5 windows.

c2 = new char[1536];
memcpy(c2, s0s1s2+1, 1536);

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Nov 24, 2015

Okay, let me confirm again.

TRANS_BY_GPT3

@winlinvip winlinvip modified the milestones: srs 2.0 release, srs 3.0 release Nov 24, 2015
@winlinvip
Copy link
Member

winlinvip commented Dec 22, 2015

@illuspas When performing a simple handshake, c2 becomes equal to s1.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 22, 2015

@illuspas Regarding the issue of the structure returned by RED5, which is RTMP Body structure is String, Number, NULL, Object, you should first read one and check if it is NULL before ignoring it. You cannot directly return it.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Aug 26, 2021
@winlinvip
Copy link
Member

srs-librtmp is removed in SRS4.

@winlinvip winlinvip changed the title srs.librtmp无法对接FMS/RED5 srs.librtmp cannot connect to FMS/RED5 Jul 27, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

3 participants