recorder

The 'recorder' directive in the NGINX RTMP module is used to configure a block for recording live streams.

Syntaxrecorder { ... };
Defaultnone
Context
Argumentsblock (1)

Description

The recorder directive sets up a configuration that allows the NGINX RTMP server to record streaming data. It is defined within an application block in the RTMP server configuration. The directive takes one argument that defines the block settings for the recording process. Inside this block, parameters related to recording such as file paths, fragment lengths, and settings for audio and video streams can be specified.

When configured, the recorder directive manages multiple streams and supports features like segmenting recordings into manageable chunks, defining the maximum number of samples to record, and controlling the directory access permissions for saved files. This results in a powerful mechanism for users to capture live broadcasts in real time, allowing them to record streams for later viewing or processing.

The directive can facilitate advanced configurations where users can set various parameters to control how and when streams are recorded, and it ensures that the recorded files are well-organized and stored securely. The completion of the recording process can also be tied back to the successful initiation of stream events to ensure everything works seamlessly during live broadcasts.

Config Example

rtmp {
    server {
        listen 1935;

        application live {
            live on;
            recorder {
                record all;
                record_path /path/to/recorded;
                record_max_size 200M;
            }
        }
    }
}

Ensure the correct permissions are set for the recording directory to avoid write errors.

Monitor server resource usage during extensive recording operations; high bandwidth can lead to performance issues.

Ensure that the storage path does not fill up; manage recorded files appropriately.

← Back to all directives