<!-- review: finished -->

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

# RTMP

The RTMP module provides live streaming capabilities in HLS and MPEG-DASH formats for those who want to use a simplified solution based on the HTTP protocol. The stream is published in MPEG-TS format over HTTP.

<a id="installation-24"></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-rtmp`;
- Angie PRO: `angie-pro-module-rtmp`.

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

## Loading the Module

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

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

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

## Configuration Example

```nginx
http {
    server {
        listen 443 ssl;
        server_name example.com;

        ssl_certificate /var/ssl/example.com.pem;
        ssl_certificate_key /var/ssl/example.com.private;

        location /keys {
            root /tmp;
        }
    }

    server {
        listen 80;
        server_name example.com;

        location /hls {
            root /tmp;
        }
    }
}

rtmp {
    server {
        listen 1935;

        hls on;
        hls_path /tmp/hls;
        hls_keys on;
        hls_key_path /tmp/keys;
        hls_key_url https://example.com/keys/;
        hls_fragments_per_key 2;
    }
}
```

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

## Additional Information

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