<!-- review: finished -->

<a id="external-vod"></a>

# VOD

The module allows repackaging MP4 files for streaming via HLS, HDS, MSS, and DASH.

<a id="installation-30"></a>

## Installation

To [install](https://en.angie.software//angie/docs/installation/index.md#install-packages) the module, use one of the following packages:

- Angie: `angie-module-vod`
- Angie PRO: `angie-pro-module-vod`

<a id="operating-modes"></a>

## Operating Modes

- Local: serves locally available files (local disk or NFS mounted).
- Remote: serves files available via HTTP using range requests.
- Mapped: serves files according to a specification encoded in JSON format (JSON can be obtained from a remote server or read from a local file).

<a id="supported-codecs"></a>

## Supported Codecs

- Video Codecs: H264, H265 (DASH/HLS), AV1 (DASH/HLS), VP8 (DASH), VP9 (DASH).
- Audio Codecs: AAC, MP3 (HLS/HDS/MSS), AC-3 (DASH/HLS), E-AC-3 (DASH/HLS), VORBIS (DASH), OPUS (DASH), FLAC (HLS), DTS (HLS).

<a id="loading-the-module-30"></a>

## Loading the Module

Load the module in the `main{}` context:

```nginx
load_module modules/ngx_http_vod_module.so;
```

<a id="configuration-example-104"></a>

## Configuration Example

```nginx
location ~ ^/cenchls/p/\d+/(sp/\d+/)?serveFlavor/entryId/([^/]+)/(.*) {
    vod hls;
    vod_hls_encryption_method sample-aes-cenc;
    vod_hls_encryption_key_format "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
    vod_hls_encryption_key_format_versions "1";

    vod_drm_enabled on;
    vod_drm_request_uri "/udrm/system/ovp/$vod_suburi";

    vod_last_modified_types *;
    add_header Access-Control-Allow-Headers '*';
    add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
    add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
    add_header Access-Control-Allow-Origin '*';
    expires 100d;
}
```

<a id="additional-information-31"></a>

## Additional Information

Detailed documentation and source code are available at:
[https://github.com/kaltura/nginx-vod-module](https://github.com/kaltura/nginx-vod-module).
