AVI file format-File Header

Source: Internet
Author: User
Avimainheader Structure

This is preliminary documentation and subject to change.

 

TheAvimainheaderStructure defines global information in an AVI file.

Syntax

typedef struct _avimainheader {    FOURCC fcc;    DWORD  cb;    DWORD  dwMicroSecPerFrame;    DWORD  dwMaxBytesPerSec;    DWORD  dwPaddingGranularity;    DWORD  dwFlags;    DWORD  dwTotalFrames;    DWORD  dwInitialFrames;    DWORD  dwStreams;    DWORD  dwSuggestedBufferSize;    DWORD  dwWidth;    DWORD  dwHeight;    DWORD  dwReserved[4];} AVIMAINHEADER;

Members

FCC

Specifies a fourcc code. The value must be 'avih '.

CB

Specifies the size of the structure, not including the initial 8 bytes.

Dwmicrosecperframe

Specifies the number of microseconds between frames. This value indicates the overall timing for the file.

Dwmaxbytespersec

Specifies the Approximate Maximum data rate of the file. this value indicates the number of bytes per second the system must handle to present an AVI sequence as specified by the other parameters contained in the main header and stream header chunks.

Dwpaddinggranularity

Specifies the alignment for data, in bytes. pad the data to multiples of this value.

Dwflags

Contains a bitwise combination of zero or more of the following flags:

Value Description
Avif_copyrighted Indicates the AVI file contains copyrighted data and software. When this flag is used, software shocould not permit the data to be duplicated.
Avif_hasindex Indicates the AVI file has an index.
Avif_isinterleaved Indicates the AVI file is interleaved.
Avif_mustuseindex Indicates that application shocould use the index, rather than the physical ordering of the chunks in the file, to determine the order of presentation of the data. for example, this flag cocould be used to create a list of frames for editing.
Avif_wascapturefile Indicates the AVI file is a specially allocated file used for capturing real-time video. Applications shocould warn the user before writing over a file with this flag set because the user probably defragmented this file.

Dwtotalframes

Specifies the total number of frames of data in the file.

Dwinitialframes

Specifies the initial frame for interleaved files. noninterleaved files shoshould specify zero. if you are creating interleaved files, specify the number of frames in the file prior to the initial frame of the AVI sequence in this member.

To give the audio driver enough audio to work with, the audio data in an interleaved file must be skewed from the video data. typically, the audio data shoshould be moved forward enough frames to allow approximately 0.75 seconds of audio data to be preloaded. theDwinitialrecordsMember shoshould be set to the number of frames the audio is skewed. also set the same value forDwinitialframesMember ofAvistreamheaderStructure in the audio stream Header

Dwstreams

Specifies the number of streams in the file. For example, a file with audio and video has two streams.

Dwsuggestedbuffersize

Specifies the suggested buffer size for reading the file. generally, this size shocould be large enough to contain the largest chunk in the file. if set to zero, or if it is too small, the playback software will have to reallocate memory during playback, which will reduce performance. for an interleaved file, the buffer size shocould be large enough to read an entire record, and not just a chunk.

Dwwidth

Specifies the width of the AVI file in pixels.

Dwheight

Specifies the height of the AVI file in pixels.

Dwreserved

Reserved. Set this array to zero.

Requirements

Header:Aviriff. h.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.