Skip to content

rounce/nginx-hls-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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