The Frame Directory
Variable-length encoding and interframe encoding make it difficult to seek to an arbitrary frame in a digital video file. Variable-length encoding means the number of bits in each image of a sequence is not constant. This makes it impossible for a device to algorithmically locate the compressed data for a specified frame in the file. Interframe encoding means the decompression of an image might require prior decompression of one or more nearby images. This implies that, even if you know where data for a specified frame begins, decompression of the specified frame can take a long time.
For algorithms and file definitions that support uniquely recognizable image start codes (such as the emerging MPEG standard), a device might deal with variable length data by estimating the proper seek position, and then scanning the file until it finds recognizable data. In general, however, having auxiliary data available that points directly to important places in the file is a more useful way of locating frames in a file.
The auxiliary data forms the frame directory. For example, a device might build a frame directory after the data is compressed. By analyzing the data in the file, the device could create a table listing the exact location of the beginning of every frame. Alternately, the frame table could at least include the location of the beginning of every key frame image. (Key frame images are those that do not require data from a previous frame to be decompressed.) Frame directories are device specific and each device might have a unique definition. Regardless of when the frame directory is generated and how it is associated with the motion video file, the frame directory enables relatively rapid access to a specified frame.
When real-time motion video data is captured, it might not have a frame directory. Such a frame directory might be added after the data is safely stored on disk. This method is reasonable, especially for a very large file, since generating a frame directory could significantly increase the processing time while storing real-time motion video to disk. Different devices might choose different approaches in building a frame directory.