-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Migrate from NGINX-RTMP, support control module functionality. #459
Comments
Drop/Kickoff has already been supported in SRS2, including kicking streams and kicking clients. Kicking streams is achieved through kicking the client that pushes the stream.
|
Record, also known as DVR, allows users to control when to start and stop recording. The configuration of DVR is written in a configuration file, but only provides APIs to enable and disable it.
|
Redirect seems to be an alias, which may also include redirecting existing users to other vhosts without disconnecting the client. This feature seems to be less commonly used, as supporting new user Redirect should suffice.
|
https://github.com/arut/nginx-rtmp-module/wiki/Directives#record
|
Let's summarize this issue again. The actual application scenario for the DVR API is as follows: Generally, DVRs are configured to record all streams of a specific vhost. However, in some cases, such as for broadcasters and monitoring purposes, all streams may need to be recorded, but only certain streams during specific time periods based on user requests. NGINX provides an interface to control the DVR, which requires configuring the NGINX settings first.
Configure the DVR in manual mode so that the streams are not recorded. Then, after calling the API, it will be possible to start and stop recording certain streams.
There are two issues with the NGINX solution:
On the other hand, SRS's approach is to modify the configuration and then reload, following the same model as implementing other functionalities. For example, the initial DVR configuration is as follows:
This is applied to streams that do not have any recordings, meaning they are not recording any streams. When there is a need to record a specific stream, the configuration is modified as follows:
Add the streams that need to be recorded to the "apply" section, then reload for the changes to take effect. Other parameters can also be modified. This approach avoids introducing new logic, prevents conflicts between the API and configuration, and the changes will still be effective after restarting. Essentially, it just adds a filtering condition to DVR without introducing new issues. How does SRS support DVR API? In fact, there is no DVR API, but two APIs:
In other words, the DVR API of NGINX is implemented in this structure.
|
#319 has already supported the RAW API, and with further enhancement of the DVR functionality, it will be able to support the control module of the DVR. Moreover, it can be made even more powerful. After server restart, the previous API calls will be remembered, meaning the server will keep track of which streams were recorded until they are cancelled.
|
DVR adds a new configuration:
At the same time, when reloading, dvr and dvr_apply should be reloaded separately so that modifying the DVR of one stream does not affect another stream.
|
The calling format of the RAW API is as follows: Example reference: http://ossrs.net:1985/console/ng_index.html#/summaries?host=ossrs.net&port=19851
|
Note: Starting from version 4.0, the reload dvr_apply is no longer supported as it may cause issues. Please refer to https://github.com/ossrs/srs/pull/2282/files#r698879205 for more information. This solution is not perfect, and in the future, it will be resolved using the HTTP API. Please refer to #2181 for more information.
|
Can 'dvr_apply' support wildcards, for example, 'record/'?
|
The ControlModule provided by NGINX-RTMP is used to allow users to control system behavior, such as record, drop/kickoff, and redirect.
https://github.com/arut/nginx-rtmp-module/wiki/Control-module
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: