View Full Version : What does [dwInitialFrames] means In AVI file format?
vicye
14th October 2003, 09:08
One AVI file has many chunks.
One of them is 'avih' chunk,which contains main header information.
In it, one field called [dwInitialFrmaes] seems to affect the placback
of one file.
I still don't know how the field affects the playback ,althougth
I have read the web page "RIFF Reference" on MSDN .
So far I set the value to be zero ,but I don't think it's the best policy for every avi file.
Could anyone make any examples to explain the affect of the field [dwInitialFrames] on the playback ?
Thanks .
gabest
15th October 2003, 19:58
Once (when I was making my avi splitter filter), I asked alexnoe about this, and he assured me that it has no importance. And really, there is no need to add or subtract anything from the timestamps you can calculate for the avi chunks, they are in sync just fine.
vicye
16th October 2003, 05:08
I'm sorry that I couldn't express my problem exactly in English.
I understand what you say, but my probelm is still not resolved yet.
I tries to express my problem in English as exactly as possible again.
I tried to put one audio stream and one video stream into one AVI file .Then I was intended to use serverl media players( windows media player 6.3 ,windows media player 9.0, divx player 2.1,and video Lan media player are included.)to play the avi file.
I wrote one program about making one avi file to do the above.AS I said before,I didn't know what the filed "dwInitialFrames" means.Therefore,I set the value of the field to be zero in my program.
In my program , the presentation order of one audio stream and one video stream was designed as follows:
a v a v a v a v ...............
the duration of one audio subchunk was equal to the duration of one viedo subchunk,which was (1000/video frame rate) ms.
Unfortunately,some of all avi fles maked by my program couldn't be presented correctly in the above media players.More exactly,the presentation time of audio stream in the avi files always delayed .
To solve the problem ,I was tried to find out the diffrences between the structure of the avi file my program maked and other well-known programs(ex. VirtualDub 1.52) maked.
I found that the presentation order of one audio stream and one video stream designed by other programs was as follows:
A v a v....v a v.....v a v.....v a....
Except the first audio subchunk "A", the duration of one audio subchunk was 1 sec ; the duration of one video subchunk is (1/frame rate) sec.In other words,if the frame rate of video stream was 15,there were 15 viedo subchunks between two audio subcunks.The duration of the first audio subchunk 'A' seems to depend on the field "dwInitialFrames",but so far I can't find out the relationship between them . This is why I ask the previous question about "dwInitialFrames".
Could you please answer my question if you understand my words and know the key to my question ?
Thanks. ^_^
alexnoe
16th October 2003, 14:15
What you have noticed is one of many severe bugs in DirectShow. It has NOTHING to do with the AVI format, it is only a bug. Just copy that convention and make your first chunk large as well. 0,5 seconds should suffice
gabest
16th October 2003, 17:36
I wouldn't be so sure about that, divx player and videolan aren't using dshow.
alexnoe
16th October 2003, 18:03
Mh....then maybe DShow is b0rked in that way that it ignores the value even though it shouldn't :D
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.