Microsoft DirectX 8.0

Media Types

Microsoft® DirectShow® uses the AM_MEDIA_TYPE structure to describe media samples. This structure includes GUID members 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.

This article contains the following sections.

Major Types

The following table describes the major media types.

GUIDDescription
MEDIATYPE_AnalogAudioAnalog audio.
MEDIATYPE_AnalogVideoAnalog video.
MEDIATYPE_AudioAudio.
MEDIATYPE_AUXLine21DataLine 21 data. Used by closed captions.
MEDIATYPE_FileFile. Used by closed captions.
MEDIATYPE_InterleavedInterleaved. Used by Digital Video (DV).
MEDIATYPE_LMRTObsolete. Do not use.
MEDIATYPE_MidiMIDI format.
MEDIATYPE_MPEG2_PESMPEG-2. Used by DVD.
MEDIATYPE_ScriptCommandData is a script command, used by closed captions.
MEDIATYPE_StreamByte stream with no time stamps.
MEDIATYPE_TextText.
MEDIATYPE_TimecodeTimecode data.
MEDIATYPE_URL_STREAMObsolete. Do not use.
MEDIATYPE_VideoVideo.

Audio Subtypes

The following table describes the audio media subtypes.

GUIDDescription
MEDIASUBTYPE_PCMAudioPCM audio
MEDIASUBTYPE_PCMAudioObsoleteObsolete. Do not use.
MEDIASUBTYPE_MPEG1PacketMPEG1 Audio packet
MEDIASUBTYPE_MPEG1PayloadMPEG1 Audio Payload

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:

Thus, for PCM audio the subtype GUID would be:

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

Older filters may 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 can be used to create an AM_MEDIA_TYPE structure from a WAVEFORMATEX Structure.

Line 21 Subtypes

The following table describes the line 21 closed captioning media subtypes.

GUIDDescription
MEDIASUBTYPE_Line21_BytePair Line 21 data as byte pairs
MEDIASUBTYPE_Line21_GOPPacket Line 21 data in DVD GOP Packet
MEDIASUBTYPE_Line21_VBIRawData Line 21 data in raw VBI format

MPEG-2 Subtypes

The following table describes the MPEG-2 media subtypes.

GUIDDescription
MEDIASUBTYPE_DVD_SUBPICTURE Subpicture data
MEDIASUBTYPE_DOLBY_AC3 Dolby data
MEDIASUBTYPE_MPEG2_AUDIO MPEG-2 audio data
MEDIASUBTYPE_DVD_LPCM_AUDIO DVD audio data
MEDIASUBTYPE_MPEG2_TRANSPORT MPEG-2 transport stream
MEDIASUBTYPE_MPEG2_PROGRAM MPEG-2 program stream

Stream Subtypes

The following table describes the stream media subtypes.

GUIDDescription
MEDIASUBTYPE_AIFFData from AIFF file
MEDIASUBTYPE_AsfAdvanced Streaming Format (ASF)
MEDIASUBTYPE_AviData from AVI file
MEDIASUBTYPE_AUData from AU file
MEDIASUBTYPE_DssAudioDss Audio
MEDIASUBTYPE_DssVideoDss Video
MEDIASUBTYPE_MPEG1AudioMPEG audio
MEDIASUBTYPE_MPEG1SystemMPEG system
MEDIASUBTYPE_MPEG1SystemStreamObsolete. Do not use.
MEDIASUBTYPE_MPEG1VideoMPEG video
MEDIASUBTYPE_MPEG1VideoCDMPEG video CD
MEDIASUBTYPE_WAVEData from WAV file

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

Video Subtypes

The following table describes the video media subtypes.

GUIDDescription
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. Do not use the alpha bits with this media type. (Compare MEDIASUBTYPE_ARGB32.)
MEDIASUBTYPE_ARGB32 ARGB, 32 bits per pixel. Uncompressed RGB samples with valid alpha bits.
MEDIASUBTYPE_Overlay Video delivered using hardware overlay.
MEDIASUBTYPE_QTMovie Apple® QuickTime® compression.
MEDIASUBTYPE_QTRpza QuickTime RPZA compressed data.
MEDIASUBTYPE_QTSmc QuickTime SMC compressed data.
MEDIASUBTYPE_QTRle QuickTime RLE compressed data.
MEDIASUBTYPE_QTJpeg QuickTime 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_VideoPortVideo port data, used with DVD.
MEDIASUBTYPE_VPVideoVideo port video data.
MEDIASUBTYPE_VPVBIVideo port vertical blanking interval (VBI) data.

Analog Video Subtypes

The following analog video formats were introduced in Microsoft® ActiveMovie® 1.0 but are now obsolete. Instead, the IAMAnalogVideoDecoder and IAMTVTuner interfaces use the AnalogVideoStandard enumeration.
GUIDDescription
MEDIASUBTYPE_AnalogVideo_NTSC_M(M) NSTC
MEDIASUBTYPE_AnalogVideo_PAL_B(B) PAL
MEDIASUBTYPE_AnalogVideo_PAL_D(D) PAL
MEDIASUBTYPE_AnalogVideo_PAL_G(G) PAL
MEDIASUBTYPE_AnalogVideo_PAL_H(H) PAL
MEDIASUBTYPE_AnalogVideo_PAL_I(I) PAL
MEDIASUBTYPE_AnalogVideo_PAL_M(M) PAL
MEDIASUBTYPE_AnalogVideo_PAL_N(N) PAL
MEDIASUBTYPE_AnalogVideo_SECAM_B(B) SECAM
MEDIASUBTYPE_AnalogVideo_SECAM_D(D) SECAM
MEDIASUBTYPE_AnalogVideo_SECAM_G(G) SECAM
MEDIASUBTYPE_AnalogVideo_SECAM_H(H) SECAM
MEDIASUBTYPE_AnalogVideo_SECAM_K(K) SECAM
MEDIASUBTYPE_AnalogVideo_SECAM_K1(K1) SECAM
MEDIASUBTYPE_AnalogVideo_SECAM_L(L) SECAM