Skip to content

rounce/nginx-hls-module

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

nginx-based hls module

Smooth Streaming Module fork

The module ingests the mp4 file, packages one into fragments, and delivers the fragments to iOS clients in real-time.

Build

cd to NGINX source directory & run this:

./configure --add-module=/path/to/nginx-hls-module
make
make install

Example nginx.conf

http {
    server {
        listen 80;
        rewrite ^(.*)\.mp4$ $1.m3u8 last;

        location ~ \.(m3u8|ts)$ {
            hls;
            hls_length 10; # length of fragment (seconds)
        }
    }
}

Directives

hls_length

syntax: hls_length <integer>

default: 8

context: http, server, location

Set the fragment length requested without the "length" argument.

hls_relative

syntax: hls_relative <on | off>

default: on

context: http, server, location

The directive specifies whether to keep the full URL of fragments.

hls_mp4_buffer_size

syntax: hls_mp4_buffer_size <size>

default: 512k

context: http, server, location

Sets the initial size of the buffer used for processing MP4 files.

hls_mp4_max_buffer_size

syntax: hls_mp4_max_buffer_size <size>

default: 10m

context: http, server, location

Size of moov atom may be quite large and can't exceed the hls_mp4_max_buffer_size size.

About

Smooth Streaming Module fork

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages