ngx_http_flv_module

Pseudo-streaming for Flash Video (FLV) files

compiled inBSD-2-Clausesource docs

Overview

ngx_http_flv_module provides pseudo-streaming server-side support for Flash Video (FLV) files. It lets a player seek into a file without downloading everything that comes before the chosen position.

Requests whose query string carries a start argument are handled specially: nginx sends the file contents from the requested byte offset and prepends the FLV header so the player receives a valid stream. Requests without start are served as ordinary static files.

It is an official nginx module. Upstream does not build it by default and enables it with the --with-http_flv_module configure parameter. A typical use is serving a directory of legacy .flv recordings to players that implement byte-offset seeking.

Key directives

flvTurns on module processing in the surrounding location; no parameters, location context only.
start argumentA start value in the query string selects the byte offset from which the file is sent.
FLV headerWhen start is present, the FLV header is prepended to the partial file so the result is a valid stream.
static file fallbackRequests without a start argument are served as regular static files from the location root.

Example

nginx.conf
location ~ \.flv$ { root /var/www/video; # /clip.flv?start=1048576 sends from that byte offset flv; }

Availability

Compiled into every n.wtf nginx binary. Install nginx-extras and the directives above work out of the box, no load_module line needed.