record_append

The `record_append` directive controls whether to append to an existing recorded stream file in the NGINX RTMP module.

Syntaxrecord_append on | off;
Defaultoff
Context
Arguments1

Description

The record_append directive in the NGINX RTMP module is used to specify if the new recording data should be appended to an existing file or if a new file should be created upon each recording session. When enabled, it allows for the continuity of recordings, merging new video and audio content with previously recorded material in a single output file. This is particularly useful for scenarios where multiple segments of video are published over time and should be combined into a single comprehensive file for easier storage and playback.

To utilize this directive, it must be set in the context of an application configuration block. The directive accepts a boolean value, typically set to on to activate or off to deactivate it. If the directive is set to on, each new recording session appends data rather than overwriting existing data. This behavior helps maintain the overall integrity of video files, especially in live streaming scenarios where content is generated in real-time.

When combined with the record directive, which specifies what to record (e.g., all for all streams), and record_path, which indicates the directory where the recordings are stored, the record_append directive plays a crucial role in file management for recorded streams. It is important to ensure that the file write permissions are correctly configured for the directory specified to avoid runtime errors, especially when multiple streams or sessions are being recorded concurrently.

Config Example

application myapp {
    live on;
    record all;
    record_path /tmp/av;
    record_append on;
}

Ensure the record path has appropriate write permissions for the NGINX process.

Be cautious of potential file size limits when appending; check the filesystem limitations.

When appending to a file, the initial part of the recording may not be accessible until the stream is concluded.

← Back to all directives