RTMP#

The RTMP module turns Angie into a media streaming server. It accepts live streams that an encoder, such as ffmpeg, publishes over RTMP; viewers receive them over RTMP or as HLS and MPEG-DASH fragments that Angie serves over HTTP. The module can also record streams and play FLV and MP4 files on demand.

Installation#

To install the module, use one of the following packages:

  • Angie: angie-module-rtmp;

  • Angie PRO: angie-pro-module-rtmp.

Loading the Module#

Load the module in the main{} context:

load_module modules/ngx_rtmp_module.so;

Configuration Example#

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;
    }
}

Additional Information#

Version: v1.2.2

Detailed documentation and source code are available at: arut/nginx-rtmp-module