How to use MP4Box to optimize seek performance in MP4 files

MP4Box can be used to optimize seek performance in MP4 files. It rewrites the internal stbl structures so that samples are stored and indexed more efficiently, allowing faster seek performance within longer files. This directly reduces server CPU processing time.

External Requirements

You can find the latest builds of GPAC here: MP4Box.
Note: OS X users will find MP4Box under

Running MP4Box

MP4Box supports a variety of command line options. Some important options include the following:

-v Indicates "verbose" mode, displaying more output within the console.
-inter Specifies the duration, in seconds, of the interleaved media data chunks.
-out Displays the output file name and path.
mp4box -v -inter 1000 [input-file] -out [output-file]
Alternatively, you can use the -tight option to perform sample-based interleaving of the media tracks. This results in a larger file size, but also reduces the number of disk seeks on the server side.

-tight Requires no value.
mp4box -v -tight [input-file] -out [output-file]

If you're having problems or want to discuss this article, post in our forum.