| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > Advanced Video Processing > Question |
| Posted by: jpsdr Sep 2 2010, 02:33 PM |
| Hello. For experiment purpose, i want to change the frame rate on avi. If i've understood properly, frame rate in avi is made with a fraction like N/D. I want to make a program wich will just write these 2 values, so, for that, i'd like to know : - Are they 16 or 32 bits data ? - What are their offset/position on the file ? Thanks. |
| Posted by: dloneranger Sep 2 2010, 03:24 PM |
| This might be of use to you http://www.rapidshare.com/files/416655883/Video_-_avi.pdf You can't say exactly where they are as the headers etc are in linked blocks So you work out the block positions with next block= address of this block+this blocks length They're stored as DWORDS (In a typical avi with no junk data - dwMicroSecPerFrame is at 0x20, dwScale is at 0x80, dwRate is at 0x84) There's a few things to change (info from the pdf) 2.1.1 MainAVIHeader (avih) DWORD dwMicroSecPerFrame; // frame display rate (or 0) dwMicroSecPerFrame Contains the duration of one video frame in microseconds. This value can be ignored (see stream header), but shall be written correctly by any AVI writer. --------- 2.1.3 The stream header list element: strh DWORD dwScale; DWORD dwRate; /* dwRate / dwScale == samples/second */ dwRate / dwScale = samples / second (audio) or frames / second (video). dwScale and dwRate should be mutually prime. Tests have shown that for example 10,000,000/400,000 instead of 25/1 results in files that don’t work on some Hardware MPEG4 players. |
| Posted by: jpsdr Sep 3 2010, 07:21 AM |
| Thanks. Rapidshare is blocked for me now (at work), so, i'll get this in few hours when back home. |
| Posted by: dloneranger Sep 3 2010, 07:46 AM |
| Virtualdub's hex editor is really useful in checking avi files Turn on 'avi field assist' and different structures get hilighted as they're clicked on + field name displays in the status bar The 'riff chunk tree' is useful for finding sections in the hex file - double click the section and the corresponding section in the hex dump is hilighted |