It is important to clarify a common mistake. When people see a file with a .AVI extension, they immediately conclude that it is not an MPEG file. That is not true. At least not entirely. Contrary to popular belief such a file can contain MPEG-1 video.
You see, a codec is not the same as a file format. Examples of video codecs are: MPEG-1, MPEG-2, MPEG-4 (DivX), Indeo5, 3ivx. Examples of file formats are: MPG, AVI, ASF.
In theory, you can put an OpenDivX video and MP3 audio into an MPG format file. However, most players will not play it, since they expect MPEG-1 video and MP2 audio (unlike AVI, MPG does not have the necessary fields to describe its video and audio streams). Or you might put MPEG-1 video into an AVI file. FFmpeg and MEncoder can create these files.
MPEG files come in different guises:
Series of frames form independent groups in MPEG files. This means that you can cut/join an MPEG file with standard file tools (like dd, cut), and it remains completely functional.
One important feature of MPGs is that they have a field to describe the aspect ratio of the video stream within. For example SVCDs have 480x480 resolution video, and in the header that field is set to 4:3, so that it is played at 640x480. AVI files do not have this field, so they have to be rescaled during encoding or played with the -aspect option.
Designed by Microsoft, AVI (Audio Video Interleaved) is a widespread multipurpose format currently used mostly for MPEG-4 (DivX and DivX4) video. It has many known drawbacks and shortcomings (for example in streaming). It supports one video stream and 0 to 99 audio streams and can be as big as 2GB, but there exists an extension allowing bigger files called OpenDML. Microsoft currently strongly discourages its use and encourages ASF/WMV. Not that anybody cares.
There is a hack that allows AVI files to contain an Ogg Vorbis audio stream, but makes them incompatible with standard AVI. MPlayer supports playing these files. Seeking is also implemented but severely hampered by badly encoded files with confusing headers. Unfortunately the only encoder currently capable of creating these files, NanDub, has this problem.
DV cameras create raw DV streams that DV grabbing utilities convert to two different types of AVI files. The AVI will then contain either separate audio and video streams that MPlayer can play or the raw DV stream for which support is under development.
There are two kinds of AVI files:
MPlayer supports two kinds of timings for AVI files:
Any audio and video codec is allowed, but note that VBR audio is not well supported by most players. The file format makes it possible to use VBR audio, but most players expect CBR audio, thus they fail with VBR. VBR is uncommon and Microsoft's AVI specs only describe CBR audio. I also noticed that most AVI encoders/multiplexers create bad files when using VBR audio. There are only two known exceptions: NanDub and MEncoder.
ASF (Active Streaming Format) comes from Microsoft. They developed two variants of ASF, v1.0 and v2.0. v1.0 is used by their media tools (Windows Media Player and Windows Media Encoder) and is very secret. v2.0 is published and patented :). Of course they differ, there is no compatibility at all (it is just another legal game). MPlayer supports only v1.0, as nobody has ever seen v2.0 files :). Note that ASF files nowadays come with the extension .WMA or .WMV.
These formats were designed by Apple and can contain any codec, CBR or VBR. They usually have a .QT or .MOV extension. Note that since the MPEG-4 group chose QuickTime as the recommended file format for MPEG-4, their MOV files come with a .MPG or .MP4 extension (Interestingly the video and audio streams in these files are real MPG and AAC files. You can even extract them with the -dumpvideo and -dumpaudio options.).
Most new QuickTime files use Sorenson video and QDesign Music audio. See our Sorenson codec section.
MPlayer happily demuxes VIVO file formats. The biggest disadvantage of the format is that it has no index block, nor a fixed packet size or sync bytes and most files lack even keyframes, so forget seeking!
The video codec of VIVO/1.0 files is standard h.263. The video codec of VIVO/2.0 files is a modified, nonstandard h.263v2. The audio is the same, it may be g.723 (standard), or Vivo Siren.
FLI is a very old file format used by Autodesk Animator, but it is a common file format for short animations on the net. MPlayer demuxes and decodes FLI movies and is even able to seek within them (useful when looping with the -loop option). FLI files do not have keyframes, so the picture will be messy for a short time after seeking.
NuppelVideo is a TV grabber tool (AFAIK:). MPlayer can read its .NUV files (only NuppelVideo 5.0). Those files can contain uncompressed YV12, YV12+RTJpeg compressed, YV12 RTJpeg+lzo compressed, and YV12+lzo compressed frames. MPlayer decodes (and also encodes them with MEncoder to MPEG-4 (DivX)/etc!) them all. Seeking works.
yuv4mpeg / yuv4mpeg2 is a file format used by the mjpegtools programs. You can grab, produce, filter or encode video in this format using these tools. The file format is really a sequence of uncompressed YUV 4:2:0 images.
RoQ files are multimedia files used in some ID games such as Quake III and Return to Castle Wolfenstein.
This is a new fileformat from Xiphophorus. It can contain any video or audio codec, CBR or VBR. You'll need libogg and libvorbis installed before compiling MPlayer to be able to play it.
PVA is an MPEG-like format used by DVB TV boards' software (e.g.: MultiDec, WinTV under Windows).
NSV (NullSoft Video) is the file format used by the Winamp player to stream audio and video. Video is VP3, VP5 or VP6, audio is MP3, AAC or VLB. The audio only version of NSV has the .nsa extension. MPlayer can play both NSV streams and files. Please note that most files from the Winamp site use VLB audio, that can't be decoded yet. Moreover streams from that site need an extra depacketization layer that still has to be implemented (those files are unplayable anyway because they use VLB audio).
The GIF format is a common format for web graphics. There are two versions of the GIF spec, GIF87a and GIF89a. The main difference is that GIF89a allows for animation. MPlayer supports both formats through use of libungif or another libgif-compatible library. Non-animated GIFs will be displayed as single frame videos. (Use the -loop and -fixed-vo options to display these longer.)
MPlayer currently does not support seeking in GIF files. GIF files do not necessarily have a fixed frame size, nor a fixed framerate. Rather, each frame is of independent size and is supposed to be positioned in a certain place on a field of fixed-size. The framerate is controlled by an optional block before each frame that specifies the next frame's delay in centiseconds.
Standard GIF files contain 24-bit RGB frames with at most an 8-bit indexed palette. These frames are usually LZW-compressed, although some GIF encoders produce uncompressed frames to avoid patent issues with LZW compression.
MPlayer is a movie and not a media player, although it can play some audio file formats (they are listed in the sections below). This is not a recommended usage of MPlayer, you better use XMMS.
You may have problems playing certain MP3 files that MPlayer will misdetect as MPEGs and play incorrectly or not at all. This cannot be fixed without dropping support for certain broken MPEG files and thus will remain like this for the foreseeable future. The -demuxer flag described in the man page may help you in these cases.
MPlayer can use cdparanoia to play CDDA (Audio CD). The scope of this section does not contain enumerating cdparanoia's features.
See the man page's -cdda option which can be used to pass options to cdparanoia.
MPlayer can use XMMS input plugins to play many file formats. There are plugins for SNES game tunes, SID tunes (from Commodore 64), many Amiga formats, .xm, .it, VQF, musepack, Bonk, shorten and many others. You can find them at the XMMS input plugin page.
For this feature you need to have XMMS and compile MPlayer with ./configure --enable-xmms. If that does not work, you might need to set the XMMS plugin and library path explicitly by way of the --with-xmmsplugindir and --with-xmmslibdir options.