Version 9 (modified by Arjen, 13 years ago) (diff)


H264 Streaming With Lighttpd


mod_h264_streaming is based on an already existing lighttpd module (mod_flv_streaming by Jan Kneschke). The basics are very similar and this module allows you to seek in MP4 files.


The module expects a URL which matches h264-streaming.extensions and that can handle a '?start=" part of the request.


The start position is given in seconds. So for example to request an MP4 file starting at forty-five and half a second from the beginning you would pass ?start=45.5

For testing purposes we recommend a tool like WGET. So:

wget -O test.mp4

saves a file (test.mp4) on your local disk that will have the first 45.5 seconds removed from the original (trailer2.mp4) file. You can use your favorite player to see if worked okay.


The information to pass into the ‘start’ parameter is extracted by the flash-player from the meta-data of the mp4-files. Note that you pass it the 'time' field and not the 'offset' field.

var url = "" + metadata.seekpoints[keyframe]["time"];


You have to make sure that this meta-data is present in the video stream. See Encoding for more information on how to encode videos.

Lighttpd config

server.modules = ( 
h264-streaming.extensions = ( ".mp4" )

Note that if you are using mod_secdownload to prevent hotlinking of your mp4 files that it is included before the mod_h264_streaming in the module list.