DAT

From DaphneWiki

Jump to: navigation, search

This section describes the format of the .dat files that DAPHNE creates.

Purpose of .dat files:

Mpeg video streams were not designed for frame-accurate seeking. DAPHNE can get around this limitation if it knows where the beginning of each key frame inside the mpeg stream is. Since finding the beginning of each key frame is slow and expensive, DAPHNE will only calculate this information one time and save it inside a .dat file. If a .dat file is missing, DAPHNE will create it at run-time.

The format:

WARNING: .DAT files may not be compatible across architectures due to ((endian)) issues.

Offset Size in Bytes Description
0 1 Version of .DAT file. The current version is 2.
1 1 Whether this .DAT file is usable. 0 means it is incomplete and unusable, 1 means it is usable.
2 1 Whether the mpeg stream uses fields or frames. 0 means it uses frames (default), 1 means it uses fields.
3 1 Unused. Created by compiler struct alignment. May not be present depending on compiler.
4 4 Size of the mpeg stream in bytes. Notice that since this is a 32-bit value, this .DAT file format cannot support mpeg files bigger than 4 gigs. If a need for mpeg files greater than 4 gigs arises, a new .DAT version will need to be created.
8+(N*4) 4 N represents the total # of frames in the mpeg (0 being the first frame). This value indicates the position within the mpeg file that a key frame begins. If this value is 0xFFFFFFFF it means that this frame is not a key frame.
Personal tools