libmpeg2 - a free MPEG-2 video stream decoder
July 18, 2008: bugfix
release - This minor bugfix release corrects various installation
issues introduced in 0.5.0.
July 12, 2008: new
release - This release brings libmpeg2 up to date with recent contributions,
compilers and systems.
New optimizations have been provided for SSE2 and ARM instruction sets,
while a lot of warnings triggered by recent compiler changes have been
A new function has been added to guess the aspect ratio of streams where
it is not properly coded. Also it is now possible to retrieve the value
of the MPEG-2 repeat_first_field flag, and to be notified when the
sequence header of a stream changes (eg. aspect ratio on-the-fly changes).
September 19, 2006: bugfix
release - The build system now supports newer versions of the autotools
and can find them in weird places on FreeBSD and OS X systems. We also
support x86 accelerations on the AMD64 CPU, including on FreeBSD. The
AltiVec features are now better detected.
Peter Gubanov found a bug in the 4:4:4 chroma handling, Nicolas Joly
found a memory leak in the Xshm code on remote displays and Roberto
Huelga found alignment issues in the sample3 and sample5 examples.
Gildas Bazin contributed a patch for more tolerance for invalid sequence
There are also two new maintainers to help Michel in his task: Sam
Hocevar and Christophe Massiot, from the VideoLAN project.
January 21, 2004: minor
bugfix release - MMX color conversions were accidentally disabled in
December 23, 2003: new
mpeg2dec release! It now supports 4:2:2-profile decoding,
robustness has been enhanced to the point that we dont know how to
crash it anymore despite trying hard, it supports concatenated streams
with different sizes, the color conversion routines are now in a
reuseable helper library, we have sparc VIS optimizations for the MC,
and some start of a basic documentation directory too.
October 8, 2003: The next release is coming up nicely:
- Conformance: Support for the decoding of 4:2:2 streams
is checked in in a sub-branch, and is being polished before
being promoted to the top of trunk. We might not hold the
release for it though.
- Speed: On the sparc architecture, VIS-optimized
implementations of the color space conversion and motion
compensation code is checked in. This allows us to get rid of
the mlib dependency. Similar optimization of the IDCT code is
being worked on.
- Robustness: Using a new robustness test suite (not
checked in yet), we greatly improved the library's ability to
handle corrupted streams. In particular, the library can now
groke truncated and/or concatenated streams.
- Documentation: Code samples for all types of buffer
management are checked in.
- Re-usability: We are planning to move the color space
conversion code from the video output library to its own
library, and to help people associate a full 33-bit PTS to
libmpeg2 is a free library for decoding mpeg-2 and mpeg-1 video
streams. It is released under the terms of the
The main goals in libmpeg2 development are:
- Conformance - libmpeg2 is able to decode all mpeg streams
that conform to certain restrictions: "constrained parameters" for
mpeg-1, and "main profile" for mpeg-2. In practice, this is what
most people are using. For streams that follow these restrictions,
we believe libmpeg2 is 100% conformant to the mpeg standards -
and we have a pretty extensive test suite to check this.
- Speed - there has been huge efforts there, and we believe
libmpeg2 is the fastest library around for what it does. Please
tell us if you find a faster one! With typical video streams as
found on DVD's, and doing only decoding with no display, you should
be able to get about 110 fps on a PIII/666, or 150 fps on an
Athlon/950. This is less than 20 cycles per output pixel.
In a real player program, the display routines will probably take
as much time as the actual decoding!
- Portability - most of the code is written in C, and
when we use platform-specific optimizations (typically
assembly routines, currently used for the motion compensation
and the inverse cosine transform stages) we always have a
generic C routine to fall back on. This should be portable to
all architectures - at least we have heard reports from people
running this code on x86, ppc, sparc, arm and
sh4. Assembly-optimized implementations are available on x86
(MMX) and ppc (AltiVec) architectures. Ultrasparc (VIS) is
probably the next on the list - we'll see.
- Reuseability - we do not want libmpeg2 to include any
project-specific code, but it should still include enough features to
be used by very diverse projects. We are only starting to get there -
the best way to help here is to give us some feedback!
The project homepage is at http://libmpeg2.sourceforge.net/
mpeg2dec is a test program for libmpeg2. It decodes mpeg-1 and
mpeg-2 video streams, and also includes a demultiplexer for mpeg-1 and mpeg-2
program streams. It is purposely kept simple : it does not include features
like reading files from a DVD, CSS, fullscreen output, navigation, etc...
The main purpose of mpeg2dec is to have a simple test bed for libmpeg2.
The libmpeg2 source code is always distributed in the mpeg2dec package,
to make it easier for people to test it.
Other projects using libmpeg2
libmpeg2 is being used by various other projects, including:
- xine - started as a simple
mpeg-2 audio and video decoder, but it since became a full-featured
DVD and video media player.
- VideoLAN - video
streaming over an ethernet network, can also be used as a
- MPlayer - another good
player, it is also very robust against damaged streams.
- movietime - still
quite young, but it looks very promising!
- a graphical interface for mpeg2dec for macintosh osX.
- TCVP - video and music player
- drip - a DVD to
- a research player optimized to minimize disk power
- GStreamer - a framework for
streaming media; it has an mpeg2 decoding plugin based on
- mpeglib - a video
decoding library that usess libmpeg2 when decoding mpeg streams.
- daphne - a laserdisc
arcade game simulator.
- GOPchop -
a GOP-accurate editor for MPEG2 streams.
- XBMC - multimedia
player jukebox for Microsoft Xbox.
- VeMP - VIA
- VeXP - VIA
enhanced Xine Player.
- MPC -
Media Player Classic for Windows.
- DScaler -
video deinterlacer and scaler.
- HandBrake - a DVD to MPEG-4
ripper / converter.
- WinCE port -
libmpeg2 ported to Windows CE.
If you use libmpeg2 in another project, let us know!
There are several places where we could easily use some help:
- Web design: This site sucks! at the very least, we'd like to
come up with a nicer background picture and a logo.
- Documentation: libmpeg2 still has no documentation. Every
project using it has had to figure things out by looking at the
header files, at the mpeg2dec sample application, and by asking
questions. Writing down a nice documentation would make the code
more easily reuseable.
- Testing: If you find any stream that does not decode
right with libmpeg2, let us know! The best thing would be to
mail to the libmpeg2-devel mailing list. Also, it would be
nice to build a stress test so we can make sure libmpeg2 never
crashes on bad streams.
- Coding: There is a small TODO list in the mpeg2dec package,
you can have a look there! Most items are pretty terse though.
- Porting: If you're porting to a new architecture, you might want
to experiment with the compile flags defined in configure.in . When
you figure out whats fastest on your platform, send us a patch!
- Assembly optimizations: We only have x86 and AltiVec
optimizations yet, it would be worthwhile writing routines for
other architectures, especially those that have SIMD
instruction set extensions! Also the yuv2rgb x86 routines
could probably be optimized a lot.
This file last modified Friday July 18, 2008
Comments ? email@example.com