View Full Version : Determine interleave and preload from avi files
Movie Maniac®
12th July 2003, 17:33
Hi
I made an avi detector and want to add the possibility to determine and show the interleaving and preload parameters used within an avi file.
May anyone help me or tell me where to look?
I've read a lot of articles, and the whole john mcgowan's avi overview, but wasn't able to come up with any valid hint.
Please help me :(
P.S. I'm using VB.
unmei
14th July 2003, 18:57
i suspect the preload skew is in the 4th 32bit field in "AUDS" header section (the field before blockalign)
like this
"AUDS" (DW too after all)
[DW]
[DW]
[DW]
[preload skew DW]
[b]but don't trust this, check it (ie make a file with skew and look whats in this field)
i have only guessed this from looking at test files and it's a long time ago..
for the interleave i dont really have a suspect, but the 6th DW seems to be bytes/s for PCM and samplerate for Mp3, the 9th DW seems like "framesize" for PCM and bytes/(s*40) for MP3 - IMHO both could be related to the interleave, but i don't know wether the interleave would be given as time per frame or byte per frame
i hope my unscientific and probably wrong statements will animate a person who actually knows :D
Movie Maniac®
15th July 2003, 14:05
Well
after many tests and observations I came to the conclusion that preload values can be calculated this way:
in the "strh" of the audio file there are two fields:
dwRate 'seems to be the bitrate in bytes
dwSuggestedBufferSize 'dunno what this means
well, semms that
preload = dwSuggestedBufferSize/(dwRate*0.001)
Can anyone confirm this?
Thanks
Movie Maniac®
17th July 2003, 09:07
well
Avery Lee (the master!!!) explained me something:
the prevoius results are merely a coincidence.
The fact is that the field dwSuggestedBufferSize is generally used to store the size of the largest frame in the list "movi" chunk, and it often happens this frame to be the audio preload frame. But this is not a general rule. So to calculate the exact value of the preload, you should read the firts frame, and if it's an audio frame, read it's size and calculate the preload (dividing for nAvgBytesPerSec value). That's all for the preload.
The difficult thing is to calculate interleaving...
I'll let you know if I find any good solution, stay tuned (if you're interested)
Bye
:D
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.