Friday, July 6, 2012

Video on demand in NGINX RTMP

Today I've finished implementing Video-on-Demand feature. It already in master branch and tagged 'v0.2.0'. From now it's possible to stream FLV files through nginx-rtmp. Syntax is obvious

application {
play /var/flvs;
}

Where /var/flvs contains actual files to play. Subdirectories are supported as well.

One thing to mention is indexing FLVs. Indexed FLVs can be played with random seek and pause support. They contain list of all keyframes and offsets. Seeking is fast in this case. Unindexed FLVs have no such list. In theory it's still possible to seek such files. However it can be extremely slow because the whole file might be scanned to find the required position to play. This is not supported in nginx-rtmp which is intended to be a high-load solution.

FLVs recorded with the module are NOT indexed. You can use FLV metadata indexer (like Yamdi: http://yamdi.sourceforge.net/) to index it.

No comments:

Post a Comment