AVI文件格式-文件头

AVIMAINHEADER Structure

This is preliminary documentation and subject to change.

 

The AVIMAINHEADER structure 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:

ValueDescription
AVIF_COPYRIGHTEDIndicates the AVI file contains copyrighted data and software. When this flag is used, software should not permit the data to be duplicated.
AVIF_HASINDEXIndicates the AVI file has an index.
AVIF_ISINTERLEAVEDIndicates the AVI file is interleaved.
AVIF_MUSTUSEINDEXIndicates that application should 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 could be used to create a list of frames for editing.
AVIF_WASCAPTUREFILEIndicates the AVI file is a specially allocated file used for capturing real-time video. Applications should 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 should 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 should be moved forward enough frames to allow approximately 0.75 seconds of audio data to be preloaded. The dwInitialRecords member should be set to the number of frames the audio is skewed. Also set the same value for the dwInitialFrames member of the AVISTREAMHEADER structure 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 should 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 should 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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值