LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can you write an avi file without using imaq

Just curious if anybody has tried to write an avi file without using imaq vi's? So far I have only found sketchy info on the file format and am looking for some help on the file structure etc. Any references or example avi files with explanations of format would be most helpfull. Thanks in advance -
0 Kudos
Message 1 of 2
(2,677 Views)
Absolutely.......

An AVI video file is actually structured in the same way as most Windows media files or RIFF files as they are generically known, thus the description below is applicable to for example WAV files etc.

Thus the file always begins with the four byte code RIFF and continues to use this generic four byte coding known as FOURCC, four-character code or FCC throughout.

There are then specific requirements for each different media content and the sections that must be included to define a valid file structure of the desired meadia type.

Each section or 'CHUNK' is defined by an FCC (RIFF being the first) with facility to include additional FCC's as required. The FCC is followed by a length descriptor and then the data (just for fun the odd CHUNK does not quite fit this very general overview). These chunks then align to even word boundries so padding zeros are often inserted at the end of a CHUNK to make it all nice and neat.

It is a requirement that software that does not recognise an additional custom CHUNK should ignore it, this is very easy as all you have to do is use the length descriptor to 'jump' over the CHUNK concerned.

The following is an example from the 'CLOCK.AVI' found on windows computers for a number of years...
RIFFjB AVI LISTŒ hdrlavih8

Here you can see the RIFF followed by a four byte length descriptor (4 Gigabytes), followed by various sub CHUNKS in this example the sub CHUNK is an AVI (note that it is actually 'AVI ' to conform to the FCC).

So the CHUNK structure looks a bit like this:-
RIFF ('AVI '
LIST ('hdrl'
'avih'(
)
LIST ('strl'
'strh'()
'strf'()
'strd'()
'strn'()
...
)
.
.
.
)

LIST ('movi'
{SubChunk | LIST ('rec '
SubChunk1
SubChunk2
.
.
.
)
.
.
.
}
.
.
.
)

['idx1']
)

For more information on all this you need to read the RIFF specification documentation on the MSDN website or on the MSDN Technet materials. Most of the stuff you will immediately locate will refer to the AVI file format as that is where most of the recent effort has been focused.
0 Kudos
Message 2 of 2
(2,669 Views)