vod_media_set_override_json

The `vod_media_set_override_json` directive allows overriding the media settings in the NGINX-based Video on Demand (VOD) module using JSON-formatted data.

Syntaxvod_media_set_override_json "JSON_STRING";
Defaultnone
Contexthttp, server, location
Arguments1

Description

The vod_media_set_override_json directive is utilized within the NGINX-based VOD module to enable dynamic media configuration. When specified, this directive allows users to provide a JSON string as an argument that defines various media parameters, such as bitrate settings, codecs, and custom streaming options. This is particularly useful when handling media files that require different configurations without needing to modify the server's static configurations directly.

This directive accepts a single argument which must be a valid JSON string. The format of this JSON varies, enabling fine control over parameters like adaptive bitrate streaming or setting specific characteristics of media files to be served. When processed, the JSON data is parsed, and the specified media options take precedence over any previously defined settings for the VOD requests matching the context (http, server, location). This functions well for scenarios in which media behavior varies by request or source, allowing for versatile and efficient media management.

It is important to ensure that the provided JSON is correctly formatted, as improper syntax can lead to configuration errors, causing media requests to fail or behave unexpectedly. Additionally, using this directive effectively may necessitate an understanding of the associated parameters that can be set via JSON to harness its full potential.

Config Example

server {
    listen 80;
    location /media {
        vod_media_set_override_json "{ \"bitrate\": \"1500kbps\", \"codec\": \"H264\" }";
        # Other configurations...
    }
}

Ensure the JSON format is valid; syntax errors will break the configuration.

When combining this directive with others, understand the precedence, as this will override prior settings only for matching requests.

Test changes carefully as this can lead to unexpected media behavior if the JSON does not align with expected values.

← Back to all directives