Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Question, AVI Header
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
jpsdr
Posted: Sep 2 2010, 02:33 PM


Advanced Member


Group: Members
Posts: 335
Member No.: 20490
Joined: 23-December 06



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.
 
     Top
dloneranger
Posted: Sep 2 2010, 03:24 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



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.

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
jpsdr
Posted: Sep 3 2010, 07:21 AM


Advanced Member


Group: Members
Posts: 335
Member No.: 20490
Joined: 23-December 06



Thanks.

Rapidshare is blocked for me now (at work), so, i'll get this in few hours when back home.
 
     Top
dloneranger
Posted: Sep 3 2010, 07:46 AM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



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

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
3 replies since Sep 2 2010, 02:33 PM Track this topic | Email this topic | Print this topic

<< Back to Advanced Video Processing