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 About Avi Viewed In Hex Editor.
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
rjisinspired
Posted: Mar 4 2011, 01:44 AM


Advanced Member


Group: Members
Posts: 1256
Member No.: 20008
Joined: 12-October 06



I'm trying to learn where data is in a header for an AVI file. Well, basically trying to learn everything about an AVI file structure.

http://www.fastgraph.com/help/avi_header_format.html

According to that page, the header location that begins describe video information/attributes begins at offset 32 but in my hex editor I'm seeing possibly the header tag before that number offset. I am new at all of this.

Is there a site which breaks down, line by line, where certain data is in a header file? I am getting into programming.

I just downloaded a document by Alex Noe. Seems detailed. Boy there is a lot to this stuff, isn't there?
 
       Top
fccHandler
Posted: Mar 4 2011, 03:33 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



Tip: If you use VirtualDub's hex editor it automatically highlights many fields of interest in the AVI headers.

--------------------
May the FOURCC be with you...
 
     Top
rjisinspired
Posted: Mar 4 2011, 03:42 AM


Advanced Member


Group: Members
Posts: 1256
Member No.: 20008
Joined: 12-October 06



Well I'll be. Thanks fcchandler. I forgot all about the hex editor built into Vdub.

Update: Even shows the RIFF tree. I downloaded a separate program over an hour ago for that and I didn't have too.
 
       Top
dloneranger
Posted: Mar 4 2011, 06:31 AM


Moderator


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



Here's an old pdf that describes the structure and fields of avi files
Can't remember where I got it from (ages ago)

http://dl.dropbox.com/u/17024916/MyUploade...o%20-%20avi.pdf
112K

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
phaeron
Posted: Mar 5 2011, 09:50 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



There are exactly three constant locations in an AVI file: the RIFF tag is at offset 0, the size of the RIFF block is at offset 4, and the AVI tag is at offset 8. That's it. Everything else can move within the file and can only be found by traversing the chunk structure.

The rules you need for parsing a RIFF file:

  • Every chunk has a header consisting of a four character code (FOURCC) and a size in bytes, followed by the data for that chunk.
  • The chunk size does not include the header: an empty chunk has a size field of 0.
  • Chunks are padded to word boundaries: if the size is odd, there is an extra byte of padding after the data.
  • RIFF and LIST chunks contain other chunks. Their data payload starts with an extra FOURCC (4 bytes), followed by chunks. The size of the RIFF or LIST chunk includes the initial FOURCC and the sizes and headers of all contained chunks. This means that RIFF and LIST chunks should always be at least four bytes in size.
  • You can and will find AVI files that violate some of these rules.

 
    Top
rjisinspired
Posted: Mar 6 2011, 08:11 PM


Advanced Member


Group: Members
Posts: 1256
Member No.: 20008
Joined: 12-October 06



Thanks guys.

I'm starting to see what is what and where the data is in the file. I am working on a small little program to extract AVI information. Sort of like a mediainfo or gspot app, nothing fancy though, just to get started.

I noticed in the hex editor that some values don't show on the right hand side; meaning that where the left window shows a hex number, the corresponding right side doesn't show any characters, only a dot. It feels like something is missing. Is this normal?


 
       Top
dloneranger
Posted: Mar 6 2011, 09:34 PM


Moderator


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



That just means that the particular byte doesn't have an actual letter for it

In ascii, not all values from 0-255 have a corresponding letter
eg
7 is bell
8 is backspace
10 is linefeed
13 is carriage return

These codes come from history, back when printers where clunky old things (more like typewriters), where sending character 7 would ring a bell on the printer, and 8,10,13 would move the print head (8,13), or the paper upwards(10)

You can still see the hex value on the left hand side of the editor though


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
ale5000
Posted: Mar 6 2011, 09:39 PM


Advanced Member


Group: Members
Posts: 1114
Member No.: 22180
Joined: 30-September 07



Look at the ASCII table: http://www.asciitable.com/

--------------------
New VirtualDub forum
VirtualDub AIO (All-in-One installer for VirtualDub and plugins)
Codec Toolbox RS (A tool to read/change merit of codecs and many other things)
Input plugins for VirtualDub / ACM codecs / VFW codecs
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
7 replies since Mar 4 2011, 01:44 AM Track this topic | Email this topic | Print this topic

<< Back to Off-Topic