Поделиться через


Windows Media Video 9 Encoder

The Windows Media Video 9 encoder encodes video streams. The encoder supports the following four categories of encoded output.

  • Windows Media Video 9 Simple Profile
  • Windows Media Video 9 Main Profile
  • Windows Media Video 9 Advanced Profile
  • Windows Media Video 9.1 Image

Class Identifier

The class identifier (CLSID) for the Windows Media Video encoder is represented by the constant CLSID_CWMV9EncMediaObject. You can create an instance of the video encoder by calling CoCreateInstance.

Interfaces

A video encoder object exposes the IMediaObject interface so that the object can be used as a DirectX Media Object (DMO), and it exposes the IMFTransform interface so that the object can be used as a Media Foundation Transform (MFT).

A video encoder behaves as a DMO or an MFT depending on which interfaces you obtain and which version of Windows is running. The following table shows the conditions under which a video encoder behaves as a DMO or an MFT.

Operating system Encoder behavior
Windows XP A Windows Media video encoder always behaves as a DMO.
Windows Vista and Windows 7 By default, a Windows Media video encoder behaves as a DMO. If you obtain an IMFTransform interface on a video encoder, it behaves as an MFT.

 

Input Formats

The Windows Media Video encoder supports the following input media subtypes when it is acting as a DMO.

  • MEDIASUBTYPE_IYUV
  • MEDIASUBTYPE_I420
  • MEDIASUBTYPE_YV12
  • MEDIASUBTYPE_NV11
  • MEDIASUBTYPE_NV12
  • MEDIASUBTYPE_YUY2
  • MEDIASUBTYPE_UYVY
  • MEDIASUBTYPE_YVYU
  • MEDIASUBTYPE_RGB32
  • MEDIASUBTYPE_RGB24
  • MEDIASUBTYPE_RGB565
  • MEDIASUBTYPE_RGB555
  • MEDIASUBTYPE_RGB8
  • MEDIASUBTYPE_PHOTOMOTION

The Windows Media Video encoder supports the following input media subtypes when it is acting as an MFT.

  • MFVideoFormat_IYUV
  • MFVideoFormat_I420
  • MFVideoFormat_YV12
  • MFVideoFormat_NV11
  • MFVideoFormat_NV12
  • MFVideoFormat_YUY2
  • MFVideoFormat_UYVY
  • MFVideoFormat_YVYU
  • MFVideoFormat_RGB32
  • MFVideoFormat_RGB24
  • MFVideoFormat_RGB565
  • MFVideoFormat_RGB555
  • MFVideoFormat_RGB8
  • MEDIASUBTYPE_PHOTOMOTION

Output Formats

The following table shows the four-character codes (FOURCCs) that correspond to the categories of encoded output.

Category FOURCC
Windows Media Video 9 Simple Profile "WMV3"
Windows Media Video 9 Main Profile "WMV3"
Windows Media Video 9 Advanced Profile "WVC1"
Windows Media Video 9.1 Image "WMVP" for 9.1, "WVP2" for 9.1 version 2

 

To distinguish between Simple Profile and Main Profile, set the MFPKEY_DECODERCOMPLEXITYREQUESTED property.

Properties

The Windows Media Video 9 encoder supports the following properties.

Property Description
MFPKEY_ASFOVERHEADPERFRAME

Specifies the overhead, in bytes per packet, required for the container used to store the compressed content.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_AVGFRAMERATE

Specifies the average frame rate of video content, in frames per second.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read-only.
MFPKEY_BAVG

Specifies the buffer window, in milliseconds, of a constrained variable-bit-rate (VBR) stream at its average bit rate (specified by MFPKEY_RAVG).

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read/write.
MFPKEY_BDELTAQP

Specifies the delta increase between the picture quantizer of the anchor frame and the picture quantizer of the B-frame.

Windows XP and later. Main Profile, Advanced Profile. Write-only.
MFPKEY_BMAX

Specifies the buffer window, in milliseconds, of a constrained variable-bit-rate (VBR) stream at its peak bit rate (specified by MFPKEY_RMAX).

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read/write.
MFPKEY_BUFFERFULLNESSINFIRSTBYTE

Specifies whether the encoded video bit stream contains a buffer fullness value with every key frame.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read-only.
MFPKEY_CLOSEDENTRYPOINT

Specifies the encoding pattern to use at the beginning of a group of pictures.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_CODEDFRAMES

Specifies the number of video frames encoded by the codec.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read-only.
MFPKEY_CODEDNONZEROFRAMES

Specifies the number of video frames encoded by the codec that actually contain data.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read-only.
MFPKEY_COMPLEXITY

This property is superseded by MFPKEY_COMPLEXITYEX.

MFPKEY_COMPLEXITYEX

Specifies the complexity of the encoder algorithm.

Windows Vista and later. Simple Profile, Main Profile. Advanced Profile. Write-only.
MFPKEY_COMPRESSIONOPTIMIZATIONTYPE

Specifies the type of optimization to use for the Windows Media Video 9 Advanced Profile codec.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write.
MFPKEY_CRISP

Specifies a numeric representation of the tradeoff between motion smoothness and image quality in codec output.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_DATARATE

Not used.

MFPKEY_DECODERCOMPLEXITYPROFILE

Specifies the device conformance template to which the encoded content conforms.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read-only.
MFPKEY_DECODERCOMPLEXITYREQUESTED

Specifies the device conformance template that you want to use for video encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_DELTAMVRANGEINDEX

Specifies the method used to encode the motion vector information.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_DENOISEOPTION

Specifies whether the codec will use the noise filter when encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_DESIRED_VBRQUALITY

Specifies the desired quality level for quality based (1-pass) variable-bit-rate (VBR) encoding.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_DROPPEDFRAMES

Specifies the number of video frames dropped during encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read-only.
MFPKEY_ENDOFPASS

Specifies the end of an encoding pass.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_FORCEFRAMEHEIGHT

Specifies an intermediate frame height for encoded video.

Windows XP and later. Advanced Profile. Write-only.
MFPKEY_FORCEFRAMEWIDTH

Specifies an intermediate frame width for encoded video.

Windows XP and later. Advanced Profile. Write-only.
MFPKEY_FORCEMEDIANSETTING

Specifies whether the codec should use median filtering during encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_FOURCC

Specifies the FOURCC that identifies the encoder you want to use.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_FRAMECOUNT

Obsolete.

MFPKEY_FULLFRAMERATE

Specifies whether the encoder is allowed to drop frames.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_INTERLACEDCODINGENABLED

Specifies whether the codec output will be interlaced.

Windows XP and later. Advanced Profile. Write-only.
MFPKEY_KEYDIST

Specifies the maximum time, in milliseconds, between key frames in the codec output.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_LIVEENCODE

Not used.

MFPKEY_LOOKAHEAD

Specifies the number of frames after the current frame that the codec will evaluate before encoding the current frame.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_LOOPFILTER

Specifies whether the codec should use the in-loop deblocking filter during encoding.

Windows XP and later. Main Profile, Advanced Profile. Write-only.
MFPKEY_MACROBLOCKMODECOSTMETHOD

Specifies the cost method used by the codec to determine which macroblock mode to use.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_MOTIONMATCHMETHOD

Specifies the method to use for motion matching.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_MOTIONSEARCHLEVEL

Specifies the types of video information that are used in motion search operations.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_MOTIONSEARCHRANGE

Specifies the range used in motion searches.

Windows XP and later. Main Profile, Advanced Profile. Write-only.
MFPKEY_NOISEEDGEREMOVAL

Specifies whether the codec should attempt to detect noisy frame edges and remove them.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_NUMBFRAMES

Specifies the number of bidirectional predictive frames (B-frames).

Windows XP and later. Main Profile, Advanced Profile. Write-only.
MFPKEY_NUMTHREADS

Specifies the number of threads that the codec will use for encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_PASSESRECOMMENDED

Specifies the maximum number of passes supported by the codec.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read-only.
MFPKEY_PASSESUSED

Specifies the number of passes that the codec will use to encode the content.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read/write.
MFPKEY_PERCEPTUALOPTLEVEL

Specifies whether the codec should use conservative perceptual optimization when encoding.

Windows XP and later. Main Profile, Advanced Profile. Write-only.
MFPKEY_PRODUCEDUMMYFRAMES

Specifies whether the encoder produces dummy frame entries in the bit stream for duplicate frames.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_QPPERFRAME

Specifies QP.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_RANGEREDUX

Specifies the degree to which the codec should reduce the effective color range of the video.

Windows XP and later. Advanced Profile. Write-only.
MFPKEY_RAVG

Specifies the average bit rate, in bits per second, used for 2-pass variable-bit-rate (VBR) encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read/write.
MFPKEY_RDSUBPIXELSEARCH

Specifies whether the encoder uses RD-based sub-pixel MV search.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_REENCENDBUFFERSIZE

For segment re-encoding, specifies the buffer size.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_REENCDURATION

For segment re-encoding, specifies the duration of the segment to be re-encoded.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_REENCQPREF

For segment re-encoding, specifies the quantizer of the frame prior to the starting segment.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_REENCSTARTBUFFERSIZE

For segment re-encoding, specifies the starting buffer fullness.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_RMAX

Specifies the peak bit rate, in bits per second, used for constrained 2-pass variable-bit-rate (VBR).

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read/write.
MFPKEY_TOTALFRAMES

Specifies the number of video frames passed to the encoder during the encoding process.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read-only.
MFPKEY_VBRENABLED

Specifies whether the codec will use variable-bit-rate (VBR) encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile, Image. Read/write.
MFPKEY_VBRQUALITY

Specifies the actual quality level for quality based (1-pass) variable-bit-rate (VBR) encoding.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_VIDEOSCALING

Specifies whether the codec will use video scaling optimization.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Write-only.
MFPKEY_VIDEOWINDOW

Specifies the amount of content, in milliseconds, that can fit into the model buffer.

Windows XP and later. Advanced Profile. Write-only.
MFPKEY_VOLHEADERFORREENCODE

For segment re-encoding, specifies the codec private data of the file that is being re-encoded.

Windows Vista and later. Simple Profile, Main Profile, Advanced Profile, Image. Write-only.
MFPKEY_VTYPE

Specifies the type of logic that the codec will use to detect interlaced source video.

Windows XP and later. Advanced Profile. Write-only.
MFPKEY_ZEROBYTEFRAMES

Specifies the number of video frames that were skipped because they were duplicates of previous frames.

Windows XP and later. Simple Profile, Main Profile, Advanced Profile. Read-only

 

Requirements

Client

Windows XP, Windows Vista, or Windows 7

Header

Wmcodecdsp.h

DLL

Wmvencod.dll

See Also

Codec Objects

Codec Implementation

Media Subtype GUIDs

 

 

Send comments about this topic to Microsoft

Build date: 4/7/2010