H 264 Player For Windows

broken image


  1. H 264 Media Player For Windows 10
  2. H.264 For Windows Media Player
  3. H.264 H.265 Video Player For Windows Os
  4. Quicktime Download
-->

The Media Foundation H.264 video decoder is a Media Foundation Transform that supports decoding of Baseline, Main, and High profiles, up to level 5.1.

The H.264 video decoder exposes the following interfaces.

H.264 is a popular standard for high definition digital video, and for good reason. A codec based on the H.264 standard compresses video to roughly half the space of MPEG-2 (the DVD standard) to deliver the same high-quality video. This means you can enjoy HD video without sacrificing speed or performance.

  • ICodecAPI (supported in Windows 8)

To create an instance of the decoder, do one of the following:

For
  • Call the MFTEnum or MFTEnumEx function.
  • Call CoCreateInstance. The CLSID for the decoder is CLSID_CMSH264DecoderMFT, declared in wmcodecdsp.h.

Input Types

The input type must contain at least the following two attributes:

AttributeDescription
MF_MT_MAJOR_TYPEMFMediaType_Video
MF_MT_SUBTYPEMFVideoFormat_H264 or MFVideoFormat_H264_ES

If the input type contains only these two attributes, the decoder will offer a default output type, which acts as a placeholder. When the decoder receives enough input samples to produce an output frame, it signals a format change by returning MF_E_TRANSFORM_STREAM_CHANGE from IMFTransform::ProcessOutput. See the ProcessOutput documentation for details about handling format changes.

To avoid an initial format change, provide as much information in the input type as possible, including:

AttributeDescription
MF_MT_FRAME_RATEFrame rate.
MF_MT_FRAME_SIZEFrame dimensions.
MF_MT_INTERLACE_MODEInterlace mode.
[!Note]
In H.264 video, the interlace structure can change dynamically, so the recommended value of this attribute is MFVideoInterlace_MixedInterlaceOrProgressive. Interlace information in the video elementary stream takes precedence over the media type. For more information, see Video Interlacing.

MF_MT_PIXEL_ASPECT_RATIOPixel aspect ratio.

The input type must be set before the output type. Until the input type is set, the encoder's IMFTransform::SetOutputType method returns MF_E_TRANSFORM_TYPE_NOT_SET.

Output Types

The decoder supports the following output subtypes:

  • MFVideoFormat_I420
  • MFVideoFormat_IYUV
  • MFVideoFormat_NV12
  • MFVideoFormat_YUY2
  • MFVideoFormat_YV12

For more information about these subtypes, see Video Subtype GUIDs.

Transform Attributes

The H.264 decoder implements the IMFTransform::GetAttributes method. Applications can use this method to get or set the following attributes.

AttributeDescription
CODECAPI_AVDecVideoAcceleration_H264Enables or disables hardware acceleration.
CODECAPI_AVDecVideoThumbnailGenerationModeEnables or disables thumbnail generation mode.
MF_SA_D3D_AWAREIndicates that the decoder supports DirectX Video Acceleration (DXVA). Treat as read-only.

In Windows 8, the H.264 decoder also supports the following attributes.

AttributeDescription
CODECAPI_AVLowLatencyModeEnables or disables low-latency decoding mode.
CODECAPI_AVDecNumWorkerThreadsSets the number of worker threads used by the decoder.
CODECAPI_AVDecVideoMaxCodedWidthSets the maximum picture width that the decoder will accept as an input type.
CODECAPI_AVDecVideoMaxCodedHeightSets the maximum picture height that the decoder will accept as an input type.
MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNTSpecifies the maximum number of output samples.
MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDERSpecifies whether a decoder exposes IYUV/I420 output types (suitable for transcoding) before other formats.

In Windows 8, the H.264 decoder supports the ICodecAPI interface. This interface provides an alternativate API for setting the following codec properties.

Format Constraints

The decoder supports the following formats:

Profiles/LevelsBaseline, Main, and High profiles, up to level 5.1. (See ITU-T H.264 specification for details.)
Chroma Formats4:2:0 chroma or monochrome
Minimum Resolution48 × 48 pixels
Maximum Resolution4096 × 2304 pixels
The maximum guaranteed resolution for DXVA acceleration is 1920 × 1088 pixels; at higher resolutions, decoding is done with DXVA, if it is supported by the underlying hardware, otherwise, decoding is done with software.
[!Note]
In Windows 7, the maximum supported resolution is 1920 × 1088 pixels for both software and DXVA decoding.

DXVAThe decoder supports DXVA version 2, but not DXVA version 1. DXVA decoding is supported only for Main-compatible Baseline, Main, and High profile bitstreams. (Main-compatible Baseline bitstreams are defined as profile_idc=66 and constrained_set1_flag=1.)

Input data must conform to Annex B of ISO/IEC 14496-10. The data must include the start codes. The decoder skips bytes until it finds a valid sequence parameter set (SPS) and picture parameter set (PPS) in the byte stream.

The decoder does not support Film Grain Technology.

Note

A previous version of the documentation incorrectly stated that the decoder is supported on Windows Server 2008 R2.

If Platform Update Supplement for Windows Vista is installed, the H.264 video decoder is available on Windows Vista, but is accessible on Windows Vista only by using the Source Reader.

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported
DLL
Msmpeg2vdec.dll

See also

-->

The Microsoft Media Foundation H.264 video encoder is a Media Foundation transform that supports the following H.264 profiles:

  • Baseline Profile
  • Main Profile
  • High profile (requires Windows 8)

The H.264 video encoder exposes the following interfaces:

H 264 Player For Windows
  • Call the MFTEnum or MFTEnumEx function.
  • Call CoCreateInstance. The CLSID for the decoder is CLSID_CMSH264DecoderMFT, declared in wmcodecdsp.h.

Input Types

The input type must contain at least the following two attributes:

AttributeDescription
MF_MT_MAJOR_TYPEMFMediaType_Video
MF_MT_SUBTYPEMFVideoFormat_H264 or MFVideoFormat_H264_ES

If the input type contains only these two attributes, the decoder will offer a default output type, which acts as a placeholder. When the decoder receives enough input samples to produce an output frame, it signals a format change by returning MF_E_TRANSFORM_STREAM_CHANGE from IMFTransform::ProcessOutput. See the ProcessOutput documentation for details about handling format changes.

To avoid an initial format change, provide as much information in the input type as possible, including:

AttributeDescription
MF_MT_FRAME_RATEFrame rate.
MF_MT_FRAME_SIZEFrame dimensions.
MF_MT_INTERLACE_MODEInterlace mode.
[!Note]
In H.264 video, the interlace structure can change dynamically, so the recommended value of this attribute is MFVideoInterlace_MixedInterlaceOrProgressive. Interlace information in the video elementary stream takes precedence over the media type. For more information, see Video Interlacing.

MF_MT_PIXEL_ASPECT_RATIOPixel aspect ratio.

The input type must be set before the output type. Until the input type is set, the encoder's IMFTransform::SetOutputType method returns MF_E_TRANSFORM_TYPE_NOT_SET.

Output Types

The decoder supports the following output subtypes:

  • MFVideoFormat_I420
  • MFVideoFormat_IYUV
  • MFVideoFormat_NV12
  • MFVideoFormat_YUY2
  • MFVideoFormat_YV12

For more information about these subtypes, see Video Subtype GUIDs.

Transform Attributes

The H.264 decoder implements the IMFTransform::GetAttributes method. Applications can use this method to get or set the following attributes.

AttributeDescription
CODECAPI_AVDecVideoAcceleration_H264Enables or disables hardware acceleration.
CODECAPI_AVDecVideoThumbnailGenerationModeEnables or disables thumbnail generation mode.
MF_SA_D3D_AWAREIndicates that the decoder supports DirectX Video Acceleration (DXVA). Treat as read-only.

In Windows 8, the H.264 decoder also supports the following attributes.

AttributeDescription
CODECAPI_AVLowLatencyModeEnables or disables low-latency decoding mode.
CODECAPI_AVDecNumWorkerThreadsSets the number of worker threads used by the decoder.
CODECAPI_AVDecVideoMaxCodedWidthSets the maximum picture width that the decoder will accept as an input type.
CODECAPI_AVDecVideoMaxCodedHeightSets the maximum picture height that the decoder will accept as an input type.
MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNTSpecifies the maximum number of output samples.
MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDERSpecifies whether a decoder exposes IYUV/I420 output types (suitable for transcoding) before other formats.

In Windows 8, the H.264 decoder supports the ICodecAPI interface. This interface provides an alternativate API for setting the following codec properties.

Format Constraints

The decoder supports the following formats:

Profiles/LevelsBaseline, Main, and High profiles, up to level 5.1. (See ITU-T H.264 specification for details.)
Chroma Formats4:2:0 chroma or monochrome
Minimum Resolution48 × 48 pixels
Maximum Resolution4096 × 2304 pixels
The maximum guaranteed resolution for DXVA acceleration is 1920 × 1088 pixels; at higher resolutions, decoding is done with DXVA, if it is supported by the underlying hardware, otherwise, decoding is done with software.
[!Note]
In Windows 7, the maximum supported resolution is 1920 × 1088 pixels for both software and DXVA decoding.

DXVAThe decoder supports DXVA version 2, but not DXVA version 1. DXVA decoding is supported only for Main-compatible Baseline, Main, and High profile bitstreams. (Main-compatible Baseline bitstreams are defined as profile_idc=66 and constrained_set1_flag=1.)

Input data must conform to Annex B of ISO/IEC 14496-10. The data must include the start codes. The decoder skips bytes until it finds a valid sequence parameter set (SPS) and picture parameter set (PPS) in the byte stream.

The decoder does not support Film Grain Technology.

Note

A previous version of the documentation incorrectly stated that the decoder is supported on Windows Server 2008 R2.

If Platform Update Supplement for Windows Vista is installed, the H.264 video decoder is available on Windows Vista, but is accessible on Windows Vista only by using the Source Reader.

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported
DLL
Msmpeg2vdec.dll

See also

-->

The Microsoft Media Foundation H.264 video encoder is a Media Foundation transform that supports the following H.264 profiles:

  • Baseline Profile
  • Main Profile
  • High profile (requires Windows 8)

The H.264 video encoder exposes the following interfaces:

Input Types

The input media type must have one of the following subtypes:

  • MFVideoFormat_I420
  • MFVideoFormat_IYUV
  • MFVideoFormat_NV12
  • MFVideoFormat_YUY2
  • MFVideoFormat_YV12

For more information about these subtypes, see Video Subtype GUIDs.

The output type must be set before the input type. Until the output type is set, the encoder's IMFTransform::SetInputType method returns MF_E_TRANSFORM_TYPE_NOT_SET.

Output Types

The encoder supports a single output subtype:

  • MFVideoFormat_H264

Set the following attributes on the output media type.

H 264 Media Player For Windows 10

AttributeDescription
MF_MT_MAJOR_TYPEMajor type. Must be MFMediaType_Video.
MF_MT_SUBTYPEVideo subtype. Must be MFVideoFormat_H264.
MF_MT_AVG_BITRATEAverage encoded bit rate, in bits per second. Must be greater than zero.
MF_MT_FRAME_RATEFrame rate.
MF_MT_FRAME_SIZEFrame size.
MF_MT_INTERLACE_MODEInterlace mode.
MF_MT_MPEG2_PROFILEH.264 encoding profile.
The supported values are:
  • eAVEncH264VProfile_Base (default)
  • eAVEncH264VProfile_Main
  • eAVEncH264VProfile_High (requires Windows 8)
MF_MT_MPEG2_LEVELOptional. Specifies the H.264 encoding level.
The default value is –1, indicating that the encoder will select the encoding level.
It is recommended not to set the level in the media type, and allow the encoder to select the level. The encoder can derive the proper level for a given video stream, taking into account the format constraints and the characteristics of the video. For more information about profile and level constraints, refer to Annex A of ITU-T H.264.
MF_MT_PIXEL_ASPECT_RATIOOptional. Specifies the pixel aspect ratio. The default value is 1:1.

After the output type is set, the video encoder updates the type by adding the MF_MT_MPEG_SEQUENCE_HEADER attribute. This attribute contains the sequence header.

H.264 For Windows Media Player

Codec Properties

The H.264 encoder implements the ICodecAPI interface for setting encoding parameters. It supports the following properties.

For the codec requirements for HCK encoder certification, see the Certified Hardware Encoder section below.

The following properties are supported in Windows 7.

H.264 H.265 Video Player For Windows Os

PropertyDescription
CODECAPI_AVEncCommonRateControlModeSets the rate control mode. See Remarks. The default mode is unconstrained variable bit rate (VBR).
CODECAPI_AVEncCommonQualitySets the quality level. This property applies when the rate control mode is quality-based VBR (eAVEncCommonRateControlMode_Quality). The valid range is 1–100. The default value is 70.
To set this parameter, set the property before calling IMFTransform::SetOutputType.
To set this parameter in Windows 7, set the property before calling IMFTransform::SetOutputType. The encoder ignores changes after the output type is set.
In Windows 8, this property can be set at any time during encoding. Changes are applied starting at the next input frame.
Internally, the encoder converts this property to an AVEncVideoEncodeQP value.

The following properties require Windows 8.

PropertyDescription
CODECAPI_AVEncAdaptiveModeSets the adaptive encoding mode. The H.264 encoder supports the following modes in Windows 8:
  • eAVEncAdaptiveMode_None. No adaptive encoding. (Default.)
  • eAVEncAdaptiveMode_FrameRate. Adaptively change the frame rate.

CODECAPI_AVEncCommonBufferSizeSets the buffer size, in bytes, for constant bit rate (CBR) encoding.
The valid range is [1 ... 2³²–1].
Requires Windows 8.
CODECAPI_AVEncCommonMaxBitRateFor constrained VBR encoding, specifies the rate at which the 'leaky bucket' is drained, in bits per second. This property applies when the rate control mode is eAVEncCommonRateControlMode_PeakConstrainedVBR.
The valid range is [1 ... 2³²–1].
CODECAPI_AVEncCommonMeanBitRateSets the average bit rate for the encoded bit stream, in bits per second. This property is ignored if the rate control mode is eAVEncCommonRateControlMode_Quality.
The valid range is [1 ... 2³²–1].
In CBR and unconstrained VBR modes, the average bit rate determines the final size of the file. In CBR mode, the average bit rate is also the rate at which compressed bits are drained from the 'leaky bucket.' (For more information, see The Leaky Bucket Buffer Model.)
In Windows 7, the average bit rate is specified by the MF_MT_AVG_BITRATE attribute on the media type.
In Windows 8, you can set the average bit rate using either the MF_MT_AVG_BITRATE attribute or the CODECAPI_AVEncCommonMeanBitRate property. If both are set, CODECAPI_AVEncCommonMeanBitRate overrides. In Windows 8, you can set the average bit rate during encoding. If the bit rate changes, the encoder uses adaptive encoding.
CODECAPI_AVEncCommonQualityVsSpeedSets the quality/speed tradeoff. Valid range:
  • 0–33: Low complexity
  • 34–66: Medium complexity (default)
  • 67–100: High complexity

This value affects how the encoder performs various encoding operations, such as motion compensation. At higher complexity levels, the encoder runs more slowly but produces better quality at the same bit rate.
CODECAPI_AVEncH264CABACEnableEnables or disables CABAC (context-adaptive binary arithmetic coding) for H.264 entropy coding. The default value is VARIANT_FALSE.
CABAC is not used for Baseline profile.
CODECAPI_AVEncH264SPSIDSets the value of seq_parameter_set_id in the SPS NAL unit of the H.264 bitstream.
CODECAPI_AVEncMPVDefaultBPictureCountSets the maximum number of consecutive B frames in the output bitstream. Valid values are:
  • 0: Do not use B frames (default).
  • 1: Use one B frame.
  • 2: Use two B frames.
To set this parameter, set the property before calling IMFTransform::SetOutputType.
For Baseline profile, the number of B frames is always zero. The encoder will override nonzero values.
For other H.264 profiles, if this property is nonzero, the encoding pattern is IBBPBBP, where the maximum number of consecutive B frames is equal to CODECAPI_AVEncMPVDefaultBPictureCount.
CODECAPI_AVEncMPVGOPSizeSets the number of pictures from one GOP header to the next, including the leading anchor but not the following one.
The valid range is [0 ... 2³²–1]. If zero, the encoder selects the GOP size. The default value is zero.
CODECAPI_AVEncNumWorkerThreadsSets the number of worker threads used by a encoder.
The valid range is 0–16. If zero, the encoder selects the number of threads.
CODECAPI_AVEncVideoContentTypeIndicates the type of video content.
CODECAPI_AVEncVideoEncodeQPValid range: 16–51. The default value is 24.
This property applies when the rate control mode is eAVEncCommonRateControlMode_Quality.
This property configures the same encoding setting as AVEncCommonQuality. However, AVEncVideoEncodeQP enables the application to specify the value of QP directly. If both properties are set, AVEncVideoEncodeQP overrides.
The default value of 24 corresponds to the default value of 70 for the AVEncCommonQuality setting.
CODECAPI_AVEncVideoForceKeyFrameForces the encoder to code the next frame as a key frame.
CODECAPI_AVEncVideoMinQPValid range: 0–51. The default value is 0.
This property applies to all rate control modes. The encoder should not produce a QP value lower than what is specified by the CODECAPI_AVEncVideoMinQP property.
CODECAPI_AVLowLatencyModeEnables or disables low-latency mode. See 'Multithreading' in the Remarks section.

Remarks

The encoder supports the following rate control modes.

ModeConstantDescription
Constant bit rate (CBR)eAVEncCommonRateControlMode_CBRThe encoder tries to achieve a constant bit rate, using a 'leaky bucket' model. The target bit rate is given by the CODECAPI_AVEncCommonMeanBitRate property.
Requires Windows 8.
Constrained variable bit rate (VBR)eAVEncCommonRateControlMode_PeakConstrainedVBRThe encoder uses a 'leaky bucket' model with a peak bit rate. The drain rate for the leaky bucket is given by the CODECAPI_AVEncCommonMaxBitRate property.
Requires Windows 8.
Quality-based variable bit rate (VBR)eAVEncCommonRateControlMode_QualityThe encoder tries to achieve a constant quality level, given by the AVEncCommonQuality property.
Unconstrained VBReAVEncCommonRateControlMode_UnconstrainedVBRThe encoder tries to achieve the target bitrate given by the MF_MT_AVG_BITRATE attribute in the output media type. This is the default mode.

CBR and constrained VBR modes require Windows 8.

In Windows 8, the encoder sets the following attributes on the output samples:

Note

A previous version of the documentation incorrectly stated that the encoder is supported on Windows Server 2008 R2.

Multithreading

In Windows 8, the encoder supports two encoding modes:

  • Slice encoding. In this mode, slices are encoded in parallel. Each slice is encoded on a different thread. This mode has low latency, because a single picture is encoded in parallel. However, this approach does not scale as the number of cores increases, because the number of slices is bounded by the number of macroblock rows in the input picture.
  • Multi-frame encoding. In this mode, the encoder accepts multiple frames of input and encodes them in parallel. This mode scales better in a multicore environment, but introduces more latency.

The encoder defaults to slice encoding, to minimize latency. To enable multi-frame encoding, set the CODECAPI_AVLowLatencyMode property to VARIANT_FALSE.

To set the number of worker threads used by the encoder, set the CODECAPI_AVEncNumWorkerThreads property.

In Windows 7, the encoder always uses slice encoding.

Certified Hardware Encoder

If a certified hardware encoder is present, it will generally be used instead of the inbox system encoder for Media Foundation related scenarios. Certified encoders are required to support a certain set of ICodecAPI properties and can optionally support another set of properties. The certification process should guarantee that the required properties are properly supported and, if an optional property is supported, that it is also properly supported.

The following is the set of required and optional ICodecAPI properties for encoders to pass the HCK encoder certification.

The following Windows 8 and Windows 8.1 ICodecAPI properties are required:

The following Windows 8.1 ICodecAPI properties are optional, but are tested in HCK if supported.

  • CODECAPI_AVEncVideoTemporalLayerCount (Dynamic)

The following Windows 8 and Windows 8.1 ICodecAPI properties are optional, but are tested in HCK if supported.

  • CODECAPI_AVEncVideoTemporalLayerCount (Static)

The following ICodecAPI properties are optional. They are not tested in HCK.

Requirements

Quicktime Download

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported
DLL
Mfh264enc.dll

See also





broken image