## Media Types

Microsoft® DirectShow™ uses the AM_MEDIA_TYPE structure to describe media samples. This structure includes GUID fields for major type, subtype, and format type, as well as fields specifying other sample features, such as whether the samples are compressed. This article summarizes the major type and subtype options registered by DirectShow. These media types are defined in Uuids.h.

- Media Types with No Subtype
- Audio Media Types
- Line21 Media Types
- MPEG2 Media Types
- Stream Media Types
- Video Media Types
- Analog Video Media Types

Media Types with No Subtype

The following table describes the media types with no subtype.

MEDIATYPEs with no MEDIASUBTYPEs |
MEDIATYPE_AnalogAudio | Analog audio connection
MEDIATYPE_File | Media type is a file, used closed captions.
MEDIATYPE_Interleaved | Data is interleaved, used by Digital Video (DV).
MEDIATYPE_Midi | Data is MIDI format.
MEDIATYPE_ScriptCommand | Data is a script command, used by closed captions.
MEDIATYPE_Text | Data is text.
MEDIATYPE_Timecode | Data is timecode data.

Audio Media Types

The wFormatTag field in the WAVEFORMATEX structure specifies the audio format type. The format type is generally FORMAT_WaveFormatEx. Media samples are generally whole number of samples as specified in the wBitsPerSample field in the WAVEFORMATEX structure. This is not necessarily true for MPEG audio samples that can come from packetized streams and are therefore not necessarily packaged on sample / frame boundaries. For MPEG audio the time stamp in a media sample is the time stamp for the first frame whose first byte is contained in the media sample.

Media subtypes are defined for each wFormatTag as follows:

- The Data1 subfield of the Media Subtype is the same as the wFormatTag value.
- The Data 2 field is 0.
- The Data 3 field is 0x0010.
- The Data 4 field is 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71.

Thus, for PCM audio the subtype GUID would be:

    {00000001-0000-0010-8000-00AA00389B71}

Older filters may still use GUID_NULL as the subtype so this should be checked for. However, registration of a filter with the explicit subtype greatly improves the speed of graph loading, especially when the given filter is not required. The CreateAudioMediaType function supplied in the DirectShow SDK can be used to create an AM_MEDIA_TYPE structure from a WAVEFORMATEX Structure.

The following table describes the audio media subtypes.

MEDIATYPE_Audio | Data is audio
MEDIASUBTYPE_PCMAudio | PCM audio
MEDIASUBTYPE_MPEG1Packet | MPEG1 Audio packet
MEDIASUBTYPE_MPEG1Payload | MPEG1 Audio Payload

Line21 Media Types

The following table describes the Line21 closed captioning media subtypes.

MEDIATYPE_AUXLine21Data | Data is Line21 type, used by closed captions
MEDIASUBTYPE_Line21_BytePair | Line21 data as byte pairs
MEDIASUBTYPE_Line21_GOPPacket | Line21 data in DVD GOP Packet
MEDIASUBTYPE_Line21_VBIRawData | Line21 data in raw VBI format

MPEG2 Media Types

The following table describes the MPEG2 media subtypes.

MEDIATYPE_MPEG2_PES | Data is MPEG2 format, used by DVD
MEDIASUBTYPE_DVD_SUBPICTURE | Subpicture data
MEDIASUBTYPE_DOLBY_AC3 | Dolby data
MEDIASUBTYPE_MPEG2_AUDIO | MPEG2 audio data
MEDIASUBTYPE_DVD_LPCM_AUDIO | DVD audio data

Stream Media Types

Time stamps are byte positions * 10000000 (notionally 1 byte per second) rather than real times.

The following table describes the stream media subtypes.

MEDIATYPE_Stream | Data is a non-timestamped byte stream
MEDIASUBTYPE_Avi | Data from AVI file
MEDIASUBTYPE_WAVE | Data from WAV file
MEDIASUBTYPE_AU | Data from AU file
MEDIASUBTYPE_AIFF | Data from AIFF file
MEDIASUBTYPE_MPEG1Video | MPEG video
MEDIASUBTYPE_MPEG1System | MPEG system
MEDIASUBTYPE_MPEG1VideoCD | MPEG video CD
MEDIASUBTYPE_MPEG1Audio | MPEG audio
MEDIASUBTYPE_DssVideo | Dss Video
MEDIASUBTYPE_DssAudio | Dss Audio

Video Media Types

The following table describes the video media subtypes.

MEDIATYPE_Video | Data is video
MEDIASUBTYPE_YVU9 | Standard YVU9 format uncompressed data. A planar YUV format. A Y sample at every pixel, a U and V sample at every fourth pixel horizontally on each line; a Y sample on every vertical line, a U and V sample at every fourth vertical line. 9 bits per pixel.
MEDIASUBTYPE_Y411 | YUV 411 format data. Same as Y41P.
MEDIASUBTYPE_Y41P | Y41P format data. A packed YUV format. A Y sample at every pixel, a U and V sample at every fourth pixel horizontally on each line; every vertical line sampled. Byte ordering (lowest first) is U0, Y0, V0, Y1, U4, Y2, V4, Y3, Y4, Y5, Y6, Y7, where the suffix 0 is the leftmost pixel and increasing numbers are pixels increasing left to right. Each 12-byte block is 8 image pixels.
MEDIASUBTYPE_YUY2 | YUY2 format data. Same as UYVY but with different pixel ordering. Byte ordering (lowest first) is Y0, U0, Y1, V0, Y2, U2, Y3, V2, Y4, U4, Y5, V4, where the suffix 0 is the leftmost pixel and increasing numbers are pixels increasing left to right. Each 4-byte block is 2 image pixels.
MEDIASUBTYPE_YVYU | YVYU format data. A packed YUV format. Same as UYVY but with different pixel ordering. Byte ordering (lowest first) is Y0, V0, Y1, U0, Y2, V2, Y3, U2, Y4, V4, Y5, U4, where the suffix 0 is the leftmost pixel and increasing numbers are pixels increasing left to right. Each 4-byte block is 2 image pixels.
MEDIASUBTYPE_UYVY | UYVY format data. A packed YUV format. A Y sample at every pixel, a U and V sample at every second pixel horizontally on each line; every vertical line sampled. Probably the most popular of the various YUV 4:2:2 formats. Byte ordering (lowest first) is U0, Y0, V0, Y1, U2, Y2, V2, Y3, U4, Y4, V4, Y5, where the suffix 0 is the leftmost pixel and increasing numbers are pixels increasing left to right. Each 4-byte block is 2 image pixels.
MEDIASUBTYPE_Y211 | YUV 211 format data. A packed YUV format. A Y sample at every second pixel, a U and V sample at every fourth pixel horizontally on each line; every vertical line sampled. Byte ordering (lowest first) is Y0, U0, Y2, V0, Y4, U4, Y6, V4, Y8, U8, Y10, V8, where the suffix 0 is the leftmost pixel and increasing numbers are pixels increasing left to right. Each 4-byte block is 4 image pixels.
MEDIASUBTYPE_CLJR | Cirrus Logic Jr YUV 411 format with less than 8 bits per Y, U, and V sample. Cinepak can produce it and Cirrus 5440 can produce an overlay with it. A Y sample at every pixel, a U and V sample at every fourth pixel horizontally on each line; every vertical line sampled.
MEDIASUBTYPE_IF09 | Indeo produced YVU9 format with additional information about differences from the last frame. 9.5 bits per pixel but reported as 9.
MEDIASUBTYPE_CPLA | Cinepak UYVY format.
MEDIASUBTYPE_MJPG | Motion JPEG (MJPG) compressed video.
MEDIASUBTYPE_TVMJ | TrueVision MJPG format.
MEDIASUBTYPE_WAKE | MJPG format produced by some cards.
MEDIASUBTYPE_CFCC | MJPG format produced by some cards.
MEDIASUBTYPE_IJPG | Intergraph JPEG format.
MEDIASUBTYPE_Plum | Plum MJPG format.
MEDIASUBTYPE_RGB1 | RGB 1 bit per pixel. Palettized.
MEDIASUBTYPE_RGB4 | RGB 4 bits per pixel. Palettized.
MEDIASUBTYPE_RGB8 | RGB 8 bits per pixel. Palettized.
MEDIASUBTYPE_RGB565 | 565 format of RGB, 16 bits per pixel. Uncompressed RGB samples.
MEDIASUBTYPE_RGB555 | 555 format of RGB, 16 bits per pixel. Uncompressed RGB samples.
MEDIASUBTYPE_RGB24 | RGB 24 bits per pixel. Uncompressed RGB samples.
MEDIASUBTYPE_RGB32 | RGB 32 bits per pixel. Uncompressed RGB samples.
MEDIASUBTYPE_Overlay | Video delivered using hardware overlay.
MEDIASUBTYPE_QTMovie | QT Specific compressions.
MEDIASUBTYPE_QTRpza | QT RPZA compressed data.
MEDIASUBTYPE_QTSmc | QT SMC compressed data.
MEDIASUBTYPE_QTRle | QT RLE compressed data.
MEDIASUBTYPE_QTJpeg | QT JPEG compressed data.
MEDIASUBTYPE_dvsd | Standard DV format.
MEDIASUBTYPE_dvhd | High Definition DV format.
MEDIASUBTYPE_dvsl | Long Play DV format.
MEDIASUBTYPE_MPEG1Packet | MPEG1 Video Packet.
MEDIASUBTYPE_MPEG1Payload | MPEG1 Video Payload.
MEDIASUBTYPE_VideoPort | Data is video port data, used with DVD.

Analog Video Media Types

The following analog video formats were introduced in ActiveMovie™ 1.0 but are currently not used. Instead, the IAMAnalogVideoDecoder, IAMAnalogVideoEncoder and IAMTVTuner interfaces use an enumeration called AnalogVideoStandard defined in Axextend.idl.

The following table describes the analog video media subtypes.

MEDIATYPE_AnalogVideo — Data is various formats of analog video, including standard NTSC, PAL, and SECAM formats.
MEDIASUBTYPE_AnalogVideo_NTSC_M
MEDIASUBTYPE_AnalogVideo_PAL_B
MEDIASUBTYPE_AnalogVideo_PAL_D
MEDIASUBTYPE_AnalogVideo_PAL_G
MEDIASUBTYPE_AnalogVideo_PAL_H
MEDIASUBTYPE_AnalogVideo_PAL_I
MEDIASUBTYPE_AnalogVideo_PAL_M
MEDIASUBTYPE_AnalogVideo_PAL_N
MEDIASUBTYPE_AnalogVideo_SECAM_B
MEDIASUBTYPE_AnalogVideo_SECAM_D
MEDIASUBTYPE_AnalogVideo_SECAM_G
MEDIASUBTYPE_AnalogVideo_SECAM_H
MEDIASUBTYPE_AnalogVideo_SECAM_K
MEDIASUBTYPE_AnalogVideo_SECAM_K1
MEDIASUBTYPE_AnalogVideo_SECAM_L

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.