Log in

View Full Version : Locate offset of frame in avi file


stormy1777
5th February 2003, 08:19
Tried looking for answer but no luck..

I have a frame and want to find it's location in an avi file. For example, file is 400MB and frame# is 2000 (total frames is 6000) this means it's about 1/3 into the file.. but I want to find out an exact offset.. preferably some utility or a way to read the index at the end of the avi file... even with a hex editor.. need to know the format... How does it start with , say 0xFFFFF or something, what it contains.. index of all frames or just key frames.. can I skip fixed amount of bytes based on the number of total frames (in example 6000)..

Thanks...

stormy1777
8th February 2003, 22:04
OK, figured it out.. there are two ways..

slow and easy: use VirtualDub's hex editor, open the AVI file and choose "RIFF chunk tree" (Ctrl+R). offset is displayed in decimal.

much faster and no gui (for some people harder): get AVIIndexGenerator.exe http://www.geocities.com/divx_repair/files/AVIIndexGenerator.zip

and this file
http://www.geocities.com/divx_repair/files/pseudopatch.txt
to decode the output.

here is some of that text file:

-----
AVIIndexGenerator [movie.avi] [index.txt]

Output
------
fr_nr fr_idx fr_type1 fr_type2 fr_addr fr_size
00000000 00136C2E 62773130 00000010 0000280C 00002ECE
00000000 00136C3E 63643030 00000010 000056E2 000005BE
00000001 00136C4E 62773130 00000010 00005CA8 000003E7
00000001 00136C5E 63643030 00000000 00006098 00000000
...

fr_nr = frame number
fr_idx = byte offset of frame in index
fr_type1 = 62643x3y -> video
63643x3y -> video
62773x3y -> audio
yx indicates the stream number
fr_type2 = 00 -> delta frame
10 -> key frame (all audio frames are 10)
fr_addr = byte offset of frame (absolute address)
fr_size = frame size in bytes


as you can see offset is in hex..

enjoy..