Microsoft MPEG-2 Audio Encoder

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Microsoft MPEG-2 Audio Encoder filter encodes MPEG-1 audio layers I and II, including support for the MPEG-2 Low Sampling Frequency (LSF) extensions.

To encode and multiplex audio/video streams, use the Microsoft MPEG-2 Encoder filter, which encapsulates the functions of both this filter and the Microsoft MPEG-2 Video Encoder filter.

Note

This filter is not supported on IA-64-based platforms.

 

Filter Information

Filter Interfaces

IBaseFilter
ICodecAPI
IEncoderAPI
IMediaSeeking
IVideoEncoder

Input Pin Media Types

MEDIATYPE_Audio, MEDIASUBTYPE_PCM

Input Pin Interfaces

IMemInputPin
IPin
IQualityControl

Output Pin Media Types

MEDIATYPE_Audio, MEDIASUBTYPE_MPEG2_AUDIO
MEDIATYPE_Stream, MEDIASUBTYPE_MPEG2_AUDIO
MEDIATYPE_Stream, MEDIASUBTYPE_MPEG2_PROGRAM
MEDIATYPE_Stream, MEDIASUBTYPE_MPEG2_TRANSPORT

Output Pin Interfaces

IMediaSeeking
IPin
IQualityControl

Filter CLSID

CLSID_CMPEG2EncoderAudioDS (declared in wmcodecdsp.h)

Executable

msmpeg2enc.dll

Merit

MERIT_DO_NOT_USE

Filter Category

CLSID_LegacyAmFilterCategory

 

Remarks

The MPEG-2 Audio Encoder can produce the following kinds of output:

  • Audio elementary stream
  • Audio in an MPEG-2 program stream
  • Audio in an MPEG-2 transport stream

It supports MPEG-1 layers I and II and MPEG-2 low sampling frequency (LSF) extensions

Input samples must 16 bits per sample, with an audio sampling rate of 48, 44.1, 32, 22.05, or 16 KHz. The encoder cannot resample the audio stream; the encoded audio has the same sample rate as the input.

Input samples must be mono or stereo. The encoded audio has the number of channels as the input.

Limitations

The encoder does not support the following:

  • MPEG layer III audio bitstreams.
  • MPEG-2 multi-channel extension bitstreams.
  • MPEG-4 AAC bitstreams.
  • MPEG-2 non-backward compatible (NBC) bitstreams.
  • Generation of packetized elementary stream (PES) packets.
  • Dolby Digital encoding.

Codec Properties

The filter supports the following properties through ICodecAPI:

Note

An earlier version of the documentation incorrectly listed some additional properties that are not supported.

 

For backward compatibility, the filter supports the following property through the IEncoderAPI interface:

Property Description
ENCAPIPARAM_BITRATE Equivalent to AVEncCommonMeanBitRate.

 

It is recommended to set properties in the following order:

  1. AVEncCommonFormatConstraint
  2. AVEncMPALayer
  3. AVEncCommonMeanBitRate
  4. AVEncMPACodingMode

Set the remaining properties in any order.

Requirements

Requirement Value
Minimum supported client
Windows Vista Home Premium, Windows Vista Ultimate, Windows 7 Home Premium, Windows 7 Professional, Windows 7 Enterprise, Windows 7 Ultimate [desktop apps only]
Minimum supported server
None supported
Header
Wmcodecdsp.h

See also

DirectShow Filters

MPEG-2 Demultiplexer Media Types