anatomy of mp4 files:
frameReader
atom: 0x70797466, ftyp, BE atomSize: 32, Listed
Found BE ftyp atom
Major Brand: isom
Minor Version: 131072
atom: 0x65657266, free, BE atomSize: 8, Listed
Found BE free atom
atom: 0x7461646D, mdat, BE atomSize: 3956947, Listed
Found BE mdat atom
atom: 0x766F6F6D, moov, BE atomSize: 26244, Listed
Found BE moov atom
atom: 0x6468766D, mvhd, BE atomSize: 108, Listed
Found BE mvhd atom
atom: 0x6B617274, trak, BE atomSize: 19468, Listed
Found BE trak atom
atom: 0x64686B74, tkhd, BE atomSize: 92, Listed
Found BE tkhd atom
atom: 0x73746465, edts, BE atomSize: 36, Listed
Found BE edts atom
atom: 0x6169646D, mdia, BE atomSize: 19332, Listed
Found BE mdia atom
atom: 0x6468646D, mdhd, BE atomSize: 32, Listed
Found BE mdhd atom
Version 0 Layout (32-bit times)
timescale: 15360, duration: 265984
atom: 0x726C6468, hdlr, BE atomSize: 71, Listed
Found BE hdlr atom
Handler Type: vide
atom: 0x666E696D, minf, BE atomSize: 19221, Listed
Found BE minf atom
atom: 0x64686D76, vmhd, BE atomSize: 20, Listed
Found BE vmhd atom
atom: 0x666E6964, dinf, BE atomSize: 36, Listed
Found BE dinf atom
atom: 0x6C627473, stbl, BE atomSize: 19157, Listed
Found BE stbl atom
atom: 0x64737473, stsd, BE atomSize: 169, Listed
Found BE stsd atom
atom: 0x73747473, stts, BE atomSize: 24, Listed
Found BE stts atom
Entry Count: 1
Sample Count: 1039
Sample tSpan: 0,0166666666666667
atom: 0x73737473, stss, BE atomSize: 172, Listed
Found BE stss atom
atom: 0x73747463, ctts, BE atomSize: 4560, Listed
Found BE ctts atom
atom: 0x63737473, stsc, BE atomSize: 7048, Listed
Found BE stsc atom
atom: 0x7A737473, stsz, BE atomSize: 4176, Listed
Found BE stsz atom
atom: 0x6F637473, stco, BE atomSize: 3000, Listed
Found BE stco atom
atom: 0x6B617274, trak, BE atomSize: 6562, Listed
Found BE trak atom
atom: 0x64686B74, tkhd, BE atomSize: 92, Listed
Found BE tkhd atom
atom: 0x73746465, edts, BE atomSize: 36, Listed
Found BE edts atom
atom: 0x6169646D, mdia, BE atomSize: 6426, Listed
Found BE mdia atom
atom: 0x6468646D, mdhd, BE atomSize: 32, Listed
Found BE mdhd atom
Version 0 Layout (32-bit times)
timescale: 44100, duration: 765952
atom: 0x726C6468, hdlr, BE atomSize: 71, Listed
Found BE hdlr atom
Handler Type: soun
atom: 0x666E696D, minf, BE atomSize: 6315, Listed
Found BE minf atom
skip soun
atom: 0x61746475, udta, BE atomSize: 98, Listed
Found BE udta atom
EOF
Press any key to continue . . .
sorry, lost tabullation
frameReader
atom: 0x70797466, ftyp, BE atomSize: 24, Listed
Found BE ftyp atom
Major Brand: isom
Minor Version: 16777216
atom: 0x766F6F6D, moov, BE atomSize: 33713, Listed
Found BE moov atom
atom: 0x6468766D, mvhd, BE atomSize: 108, Listed
Found BE mvhd atom
atom: 0x73646F69, iods, BE atomSize: 21, Listed
Found BE iods atom
atom: 0x6B617274, trak, BE atomSize: 14674, Listed
Found BE trak atom
atom: 0x64686B74, tkhd, BE atomSize: 92, Listed
Found BE tkhd atom
atom: 0x6169646D, mdia, BE atomSize: 14574, Listed
Found BE mdia atom
atom: 0x6468646D, mdhd, BE atomSize: 32, Listed
Found BE mdhd atom
Version 0 Layout (32-bit times)
timescale: 9000000, duration: 300122400
atom: 0x726C6468, hdlr, BE atomSize: 51, Listed
Found BE hdlr atom
Handler Type: vide
atom: 0x666E696D, minf, BE atomSize: 14483, Listed
Found BE minf atom
atom: 0x64686D76, vmhd, BE atomSize: 20, Listed
Found BE vmhd atom
atom: 0x666E6964, dinf, BE atomSize: 36, Listed
Found BE dinf atom
atom: 0x6C627473, stbl, BE atomSize: 14419, Listed
Found BE stbl atom
atom: 0x64737473, stsd, BE atomSize: 190, Listed
Found BE stsd atom
atom: 0x73747473, stts, BE atomSize: 32, Listed
Found BE stts atom
Entry Count: 2
Sample Count: 1
Sample tSpan: 0,0136
Sample Count: 1000
Sample tSpan: 0,0333333333333333
atom: 0x73747463, ctts, BE atomSize: 2784, Listed
Found BE ctts atom
atom: 0x676C7363, cslg, BE atomSize: 32, Listed
Found BE cslg atom
atom: 0x73737473, stss, BE atomSize: 104, Listed
Found BE stss atom
atom: 0x63737473, stsc, BE atomSize: 3004, Listed
Found BE stsc atom
atom: 0x7A737473, stsz, BE atomSize: 4024, Listed
Found BE stsz atom
atom: 0x6F637473, stco, BE atomSize: 3228, Listed
Found BE stco atom
atom: 0x70746473, sdtp, BE atomSize: 1013, Listed
Found BE sdtp atom
atom: 0x6B617274, trak, BE atomSize: 18902, Listed
Found BE trak atom
atom: 0x64686B74, tkhd, BE atomSize: 92, Listed
Found BE tkhd atom
atom: 0x6169646D, mdia, BE atomSize: 18802, Listed
Found BE mdia atom
atom: 0x6468646D, mdhd, BE atomSize: 32, Listed
Found BE mdhd atom
Version 0 Layout (32-bit times)
timescale: 480000, duration: 16015360
atom: 0x726C6468, hdlr, BE atomSize: 51, Listed
Found BE hdlr atom
Handler Type: soun
atom: 0x666E696D, minf, BE atomSize: 18711, Listed
Found BE minf atom
skip soun
atom: 0x7461646D, mdat, BE atomSize: 7752249, Listed
Found BE mdat atom
atom: 0x65657266, free, BE atomSize: 58, Listed
Found BE free atom
EOF
Press any key to continue . . .
Video Track (Handler Type: vide):
mdhd gives you the timescale of 9000000 and duration of 300122400.
The stts atom has 2 entries, so this track uses a variable frame rate (not constant).Why It Happens: Variable Frame Rate (VFR)
A variable frame rate (VFR) means that the time between frames (sampleDelta) is not constant throughout the video. This can happen, for example, when some frames are âgroupedâ together with larger sampleDelta, or in cases like video with variable bitrate (VBR) encoding.The first frame interval might be larger (e.g., 0.0469 sec), and after that, the frame rate stabilizes with consistent 0.0333 sec intervals. This is normal behavior for certain types of video (such as those encoded with VBR).
A trak atom can contain:
tkhd: Track Header â defines metadata like track ID, duration, etc.mdia: Media â this atom holds information like the media type (audio/video/subtitle), the handler type, and other related metadata.
Inside mdia, you can have:
mdhd: Media Header â holds time scale and duration for the track.
hdlr: Handler Reference â specifies the type of media (vide, soun, sbtl).
minf: Media Information â contains the actual media data, including the sample table (stbl).Inside stbl, you have things like stts (time-to-sample), stsd (sample description), stsc (sample-to-chunk), etc.
Track Types
Video Track:
Identified by the hdlr atom with Handler Type: vide.
Contains frames encoded as video data.
Typically, the video track is the primary media in most MP4 files.Audio Tracks:
Identified by hdlr atom with Handler Type: soun.
Contains audio data.
MP4 files may have multiple audio tracks (e.g., different languages, surround sound, etc.).Subtitle Tracks:
Identified by hdlr atom with Handler Type: sbtl or similar.
Contains subtitle data (e.g., for captions, subtitles for different languages).
You can have multiple subtitle tracks in the MP4 file.

















