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

SRT: When an error occurs while pushing to RTMP, the SRT streaming will not stop. #2897

Closed
winlinvip opened this issue Jan 30, 2022 · 3 comments
Assignees
Labels
Bug It might be a bug. SRT It's about SRT protocol. TransByAI Translated by AI/GPT.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented Jan 30, 2022

When SRT is streaming, it will be converted to RTMP and pushed to the backend. If the backend has authentication, it may cause the RTMP to fail. In this case, SRT will not disconnect but will keep retrying.

At this point, we have no idea what is happening. We only know that the SRT push is not failing, but the RTMP stream cannot be played. However, the SRT stream can be played.

At the same time, this is also a vulnerability, equivalent to ineffective authentication, because SRT can be played, it's just that RTMP cannot be played.

Therefore, when RTMP fails, SRT must also fail; or implement authentication and callback separately.

TRANS_BY_GPT3

@winlinvip winlinvip added the Bug It might be a bug. label Jan 30, 2022
@winlinvip winlinvip added this to the 4.0 milestone Jan 30, 2022
@zhouxiaojun2008
Copy link
Contributor

zhouxiaojun2008 commented Feb 13, 2022

The 'srt' data is received and pushed into a queue by the 'srt_server' thread. The 'srt2rtmp' coroutine retrieves data from the queue. The entire process involves one-way data flow.

When there is an error in the 'rtmp' interaction, only the 'rtmp' session can be closed. The error information cannot be passed to the 'srt_server' thread, and it is not possible to directly call the 'srt_server' interface to close the 'srt' session, which is not easy to handle.

There is a solution to consider implementing separate authentication using 'srt'. Of course, it is not possible to use 'st' to implement an HTTP client. Instead, the cpp-httplib library can be used. This library consists of only one '.h' file, and it may be feasible in terms of copyright.

TRANS_BY_GPT3

@winlinvip winlinvip added the SRT It's about SRT protocol. label Feb 13, 2022
@winlinvip
Copy link
Member Author

winlinvip commented Feb 13, 2022

Discussed and decided to use global variables with locks to store the error. After replacing the IO with ST driver, we can use it without locking.

TRANS_BY_GPT3

zhouxiaojun2008 added a commit to zhouxiaojun2008/srs that referenced this issue Feb 14, 2022
zhouxiaojun2008 added a commit to zhouxiaojun2008/srs that referenced this issue Feb 15, 2022
winlinvip pushed a commit that referenced this issue Feb 15, 2022
* SRT: using global variables  to pass errors (#2897)

* SRT: using global variables  to pass errors (#2897)
@winlinvip
Copy link
Member Author

Fixed in SRS 4.0

@winlinvip winlinvip changed the title SRT:推到RTMP出现错误时,不会停止SRT推流 SRT: When an error occurs while pushing to RTMP, the SRT streaming will not stop. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 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. SRT It's about SRT protocol. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

4 participants