DV Video in the AVI Format

DV Video in the AVI Format

DV stream data is received from the digital camcorder as a single, multiplexed stream of audio and video data. When stored inside an AVI file, this multiplexed stream can be stored as a single stream, or the stream can be demultiplexed into separate audio and video streams. When a multiplexed stream is stored within an AVI file, it s known as a Type 1 AVI file. When the stream is stored as a demultiplexed stream, it s known as a Type 2 AVI file. Although the two types are functionally identical, in that each contains the same DV stream data, Type 1 AVI files have a restriction: they will not work with Video for Windows applications, which expect demultiplexed streams of audio and video data. Therefore, Type 1 AVI files are not backward-compatible with VFW applications. However, using the DV Muxer filter, Type 1 AVI files can be created in DirectShow and demultiplexed into separate streams with the DV Splitter filter. Figure 14-7 shows the structure of a Type 1 AVI file.

figure 14-7 a type 1 avi file, which has only one stream containing multiplexed audio and video streams

Figure 14-7. A Type 1 AVI file, which has only one stream containing multiplexed audio and video streams

A Type 1 AVI file is identified by a unique fccType in its stream header chunk, iavs, that is, interleaved audio-video stream. There are three possible values in the fccHandler field of the stream header chunk: dvsd, which indicates that the file contains an SD-DVCR stream (as discussed in Chapter 6) from a digital camcorder; dvhd, which indicates a HD-DVCR high-definition digital stream; and dvsl, which indicates an SDL-DVCR high-compression digital stream. In any case, the stream header chunk is followed by a DVINFO stream format chunk (without any FOURCC chunk header or length). The DVINFO chunk has the following structure:

typedef struct tag_DVINFO { DWORD dwDVAAuxSrc; DWORD dwDVAAuxCtl; DWORD dwDVAAuxSrc1; DWORD dwDVAAuxCtl1; DWORD dwDVVAuxSrc; DWORD dwDVVAuxCtl; DWORD dwDVReserved[2]; } DVINFO, *PDVINFO;

The dwDVAAuxSrc and dwDVAAuxCtl fields specify the Audio Auxiliary Data Source Pack and Audio Auxiliary Data Source Control for the first audio block of the frame, and dwDVAAuxSrc1 and dwDVAAuxCtl1 define the same for the second audio block. The dwDVVAuxSrc and dwDVAuxCtl fields specify the Video Auxiliary Data Source Pack and Video Auxiliary Data Source Control. (If you need to learn what these fields do, check out The Pack Header Table and Contents of Packs from the Specification of Consumer-Use Digital VCRs (the Blue Book ). These fields are the arcana of DV, and it s unlikely you ll ever use these fields yourself.) The last field, dwDVReserved, must be set to zero. All the stream data chunks in the movi list are identified with the FOURCC code ##dc, where ## is the stream number.

In a Type 2 AVI file, the structure of the file is very much as we ve already covered, with one or more audio streams and a video stream combined into a single AVI file, but with the various stream data maintained in separate chunks in the stream data list. The stream header for the audio stream has an fccType of auds but doesn t need any fccHandler value, so that field is set to four blanks. Both Type 1 and Type 2 AVI files can have index chunks.



Programming Microsoft DirectShow for Digital Video and Television
Programming Microsoft DirectShow for Digital Video and Television (Pro-Developer)
ISBN: 0735618216
EAN: 2147483647
Year: 2002
Pages: 108
Authors: Mark D. Pesce

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net