The LEAD MPEG-2 Encoder Filter is a DirectShow® filter for compressing video data using the MPEG-2 (ISO/IEC 13818-2) or MPEG-1 (ISO 11172-2) standard. The LEAD MPEG-2 Decoder is a DirectShow® filter for decompressing MPEG-2 video data.
MPEG-1 is the older standard and achieves higher compression than MPEG-2 (but at lower quality). MPEG-1 compression is used in VCD (video on CD).
MPEG-2 is the newer standard and has lower compression than MPEG-1 but the quality is much better than MPEG-1. MPEG-2 is a high quality video compression algorithm and is best suited for applications with higher bit rates or high-bandwidth usage. The most common applications include DVD-Videos, SVCD and digital TVs. The compressed video data can be stored inside MPEG, AVI, DICOM or Ogg files with the option of saving the file with or without the audio data.
The DICOM files can store MPEG-2 SD or HD video. See "Supplement 42: MPEG2 Transfer Syntax" and "Supplement 137: MPEG2 MP@HL Transfer Syntax" of the DICOM specification for more information on requirements of the MPEG-2 SD or HD video.
The compression options for the LEAD MPEG-2 Encoder can be set manually through the encoder property page. The compression options can also be set programmatically using the ILMMPEG2Encoder interface.
The maximum video size for MPEG2 video is 1920x1152 (when using the High profile).
Component | Description |
---|---|
Filter Interfaces | ILMMPEG2Encoder, ILMMCommon |
Interface ID | IID_ILMMPEG2Encoder |
Input Media Types | Type: |
MEDIATYPE_Video | |
Subtypes: | |
MEDIASUBTYPE_YV12 | |
MEDIASUBTYPE_YUY2 | |
MEDIASUBTYPE_UYVY | |
MEDIASUBTYPE_RGB32 | |
MEDIASUBTYPE_RGB24 | |
Output Media Types | Type: |
MEDIATYPE_Video | |
Subtype: | |
MEDIASUBTYPE_MPEG2_VIDEO | |
MEDIASUBTYPE_LMPG2 | |
Filter CLSID | CLSID_LMMPEG2Encoder |
Property Page CLSID | CLSID_LMMPEG2EncoderProperty |
Executable | LEncMpg23.dll (Win32) / LEncMpg23x.dll (x64), DSKernel2.dll |
Filter Category | CLSID_VideoCompressorCategory |
Header | ILEncMPEG2_3.h |
A MPEG-2 encoder capable of handling all resolutions, bit rates and frame rates up to HDTV would be too expensive for many simpler applications or hardware implementations. Therefore, the MPEG-2 standard was subdivided into levels and profiles. The MPEG-2 standard allows for four source formats, or Levels, to be coded; ranging from Limited Definition (todays VCR quality), to full HDTV, each with a range of bit rates. In addition to this flexibility in source formats, MPEG-2 allows for different Profiles. Each profile offers a collection of compression tools that together make up the coding system. A different profile means that a different set of compression tools is available. The four levels, including frame size and maximum bit rate, are defined in the following table:
Level | Maximum Frame size (PAL/NTSC) | Maximum Bitrate | Significance |
---|---|---|---|
Low | 352x288352x240 | 4 Mb/s | CIF, consumer tape equiv. |
Main | 720x576720x480 | 15 Mb/s | ITU-R 601, Studio TV |
High 1440 | 1440x11521440x1080 | 60 Mb/s | 4x 601, consumer HDTV |
High | 1920x11521920x1080 | 80 Mb/s | PROD. SMPTE |
Most of today's work is done at the Main Level, which is designated for standard video. Within this level, the Main profile is used for many applications. The MPEG-2 encoder will automatically adjust the level if the video being encoded is bigger than the maximum size for the current level.
To increase the compression performance, MPEG-2 uses Temporal Compression. Temporal compression is achieved by encoding only the difference between successive frames instead of the frames themselves. This means that frames cannot be considered in isolation. A given picture is constructed from the prediction from a previous picture, and may be used to predict the next picture. An MPEG-2 video stream is comprised of I Frames, B Frames and P Frames:
To increase the compression of MPEG-2, more B and P frames should be used. You do so by adjusting the "I Frame" and "P Frame" options on the Encoder property page:
For example if I frame is 12, and P Frame is 3, then video stream looks like the following:
I B B P B B P B B P B B I B B P B B P B B P B B ..
The distance between I frames must be a multiple of the distance between the P frames. The LEAD MPEG-2 Encoder will automatically adjust these values to preserve this relationship.
This filter is included as part of LEAD MPEG-2 Video Codec Module.
Win32, x64.