comparison DOCS/xml/en/containers.xml @ 19732:05710b19651f

formats.xml --> containers.xml, the chapter was renamed long ago.
author diego
date Thu, 07 Sep 2006 23:46:04 +0000
parents DOCS/xml/en/formats.xml@9bd613f6ea56
children fccaabde1978
comparison
equal deleted inserted replaced
19731:9bd613f6ea56 19732:05710b19651f
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!-- $Revision$ -->
3 <chapter id="containers">
4 <title>Containers</title>
5
6 <para>
7 It is important to clarify a common mistake. When people see a file with a
8 <filename>.AVI</filename> extension, they immediately conclude that it is
9 not an MPEG file. That is not true. At least not entirely. Contrary to
10 popular belief such a file <emphasis>can</emphasis> contain MPEG-1 video.
11 </para>
12
13 <para>
14 You see, a <emphasis role="bold">codec</emphasis> is not the same as a
15 <emphasis role="bold">container format</emphasis>.
16 Examples of video <emphasis role="bold">codecs</emphasis> are: MPEG-1, MPEG-2,
17 MPEG-4 (DivX), Indeo5, 3ivx.
18 Examples of container <emphasis role="bold">formats</emphasis> are: MPG, AVI, ASF.
19 </para>
20
21 <para>
22 In theory, you can put an OpenDivX video and MP3 audio
23 into an <emphasis role="bold">MPG container</emphasis>. However, most
24 players will not play it, since they expect MPEG-1 video and MP2 audio (unlike
25 <emphasis role="bold">AVI</emphasis>, <emphasis role="bold">MPG</emphasis>
26 does not have the necessary fields to describe its video and audio streams).
27 Or you might put MPEG-1 video into an AVI file.
28 <ulink url="http://ffmpeg.org/">FFmpeg</ulink> and
29 <link linkend="mencoder"><application>MEncoder</application></link> can create these files.
30 </para>
31
32
33 <sect1 id="video-formats">
34 <title>Video formats</title>
35
36 <sect2 id="mpg-vob-dat">
37 <title>MPEG files</title>
38
39 <para>
40 MPEG files come in different guises:
41 </para>
42
43 <itemizedlist>
44 <listitem><simpara>
45 MPG: This is the most <emphasis role="bold">basic</emphasis> form of the
46 MPEG file formats. It contains MPEG-1 video, and MP2 (MPEG-1 layer 2) or
47 rarely MP1 audio.
48 </simpara></listitem>
49 <listitem><simpara>
50 DAT: This is the very same format as MPG with a different extension. It
51 is used on <emphasis role="bold">Video CDs</emphasis>. Due to the way VCDs
52 are created and Linux is designed, the DAT files cannot be played nor copied
53 from VCDs as regular files. You have to use <option>vcd://</option>
54 to play a Video CD.
55 </simpara></listitem>
56 <listitem><simpara>
57 VOB: This is the MPEG file format on <emphasis role="bold">DVDs</emphasis>.
58 It is the same as MPG, plus the capability to contain subtitles or non-MPEG
59 (AC3) audio. It contains encoded MPEG-2 video and usually AC3 audio, but DTS,
60 MP2 and uncompressed LPCM are allowed, too. <emphasis role="bold">Read the
61 <link linkend="dvd">DVD</link> section</emphasis>!
62 </simpara></listitem>
63 <listitem><simpara>
64 TY: This is a TiVo MPEG stream. It contains MPEG PES data for audio and
65 video streams, as well as extra information like closed captions. The
66 container is not an MPEG program stream, but a closed format created by
67 TiVo. For more information on TiVo stream format, please refer to
68 <ulink url="http://dvd-create.sourceforge.net/tystudio/tystream.shtml">
69 the TyStudio page</ulink>.
70 </simpara></listitem>
71 </itemizedlist>
72
73 <para>
74 Series of frames form independent groups in MPEG files. This means that you
75 can cut/join an MPEG file with standard file tools (like
76 <command>dd</command>, <command>cut</command>), and it remains completely
77 functional.
78 </para>
79
80 <para>
81 One important feature of MPGs is that they have a field to describe the
82 aspect ratio of the video stream within. For example SVCDs have 480x480
83 resolution video, and in the header that field is set to 4:3, so that it is
84 played at 640x480. AVI files often lack this field, so they have to be
85 rescaled during encoding or played with the <option>-aspect</option>
86 option.
87 </para>
88 </sect2>
89
90
91 <sect2 id="avi">
92 <title>AVI files</title>
93
94 <para>
95 Designed by Microsoft, <emphasis role="bold">AVI (Audio Video Interleaved)</emphasis>
96 is a widespread multipurpose format currently used mostly for MPEG-4 (DivX and DivX4)
97 video. It has many known drawbacks and shortcomings (for example in streaming). It
98 supports one video stream and 0 to 99 audio streams and can be as big as
99 2GB, but there exists an extension allowing bigger files called
100 <emphasis role="bold">OpenDML</emphasis>. Microsoft currently strongly
101 discourages its use and encourages ASF/WMV. Not that anybody cares.
102 </para>
103
104 <para>
105 There is a hack that allows AVI files to contain an Ogg Vorbis audio
106 stream, but makes them incompatible with standard AVI.
107 <application>MPlayer</application> supports playing these files. Seeking is
108 also implemented but severely hampered by badly encoded files with
109 confusing headers. Unfortunately the only encoder currently capable of
110 creating these files, <application>NanDub</application>, has this problem.
111 </para>
112
113 <note>
114 <para>
115 DV cameras create raw DV streams that DV grabbing utilities convert to two
116 different types of AVI files. The AVI will then contain either separate
117 audio and video streams that <application>MPlayer</application> can play or
118 the raw DV stream for which support is under development.
119 </para>
120 </note>
121
122 <para>
123 There are two kinds of AVI files:
124 <itemizedlist>
125 <listitem><simpara>
126 <emphasis role="bold">Interleaved:</emphasis> Audio and video content is
127 interleaved. This is the standard usage. Recommended and mostly used. Some tools
128 create interleaved AVIs with bad sync. <application>MPlayer</application>
129 detects these as interleaved, and this climaxes in loss of A/V sync,
130 probably at seeking. These files should be played as non-interleaved
131 (with the <option>-ni</option> option).
132 </simpara></listitem>
133 <listitem><simpara>
134 <emphasis role="bold">Non-interleaved:</emphasis> First comes the whole
135 video stream, then the whole audio stream. It thus needs a lot of seeking,
136 making playing from network or CD-ROM difficult.
137 </simpara></listitem>
138 </itemizedlist>
139 </para>
140
141 <para>
142 <application>MPlayer</application> supports two kinds of timings for AVI
143 files:
144 <itemizedlist>
145 <listitem><simpara>
146 <emphasis role="bold">bps-based:</emphasis> It is based on the
147 bitrate/samplerate of the video/audio stream. This method is used by
148 most players, including <ulink url="http://avifile.sf.net">avifile</ulink>
149 and <application>Windows Media Player</application>. Files with broken
150 headers, and files created with VBR audio but not VBR-compliant encoder
151 will result in A/V desync with this method (mostly at seeking).
152 </simpara></listitem>
153 <listitem><simpara>
154 <emphasis role="bold">interleaving-based:</emphasis> It does not use the bitrate
155 value of the header, instead it uses the relative position of interleaved
156 audio and video chunks, making badly encoded files with VBR audio playable.
157 </simpara></listitem>
158 </itemizedlist>
159 </para>
160
161 <para>
162 Any audio and video codec is allowed, but note that VBR audio is not well
163 supported by most players. The file format makes it possible to use VBR
164 audio, but most players expect CBR audio, thus they fail with VBR. VBR is
165 uncommon and Microsoft's AVI specs only describe CBR audio. I also noticed
166 that most AVI encoders/multiplexers create bad files when using VBR audio.
167 There are only two known exceptions: <application>NanDub</application> and
168 <link linkend="mencoder"><application>MEncoder</application></link>.
169 </para>
170 </sect2>
171
172
173 <sect2 id="asf-wmv">
174 <title>ASF/WMV files</title>
175 <para>
176 ASF (Active Streaming Format) comes from Microsoft. They developed two
177 variants of ASF, v1.0 and v2.0. v1.0 is used by their media tools (<application>Windows
178 Media Player</application> and <application>Windows Media Encoder</application>)
179 and is very secret. v2.0 is published and patented :). Of course they differ,
180 there is no compatibility at all (it is just another legal game).
181 <application>MPlayer</application> supports only v1.0, as nobody has ever seen
182 v2.0 files :). Note that ASF files nowadays come with the extension
183 <filename>.WMA</filename> or <filename>.WMV</filename>.
184 </para>
185 </sect2>
186
187
188 <sect2 id="mov">
189 <title>QuickTime/MOV files</title>
190
191 <para>
192 These formats were designed by Apple and can contain any codec, CBR or VBR.
193 They usually have a <filename>.QT</filename> or <filename>.MOV</filename>
194 extension. Note that since the MPEG-4 group chose QuickTime as the recommended
195 file format for MPEG-4, their MOV files come with a <filename>.MPG</filename> or
196 <filename>.MP4</filename> extension (Interestingly the video and audio
197 streams in these files are real MPG and AAC files. You can even extract them with the
198 <option>-dumpvideo</option> and <option>-dumpaudio</option> options.).
199 </para>
200
201 <note>
202 <para>
203 Most new QuickTime files use <emphasis role="bold">Sorenson</emphasis> video and
204 QDesign Music audio. See our <link linkend="sorenson">Sorenson</link> codec section.
205 </para>
206 </note>
207 </sect2>
208
209
210 <sect2 id="vivo">
211 <title>VIVO files</title>
212
213 <para>
214 <application>MPlayer</application> happily demuxes VIVO file formats. The
215 biggest disadvantage of the format is that it has no index block, nor a
216 fixed packet size or sync bytes and most files lack even keyframes, so
217 forget seeking!
218 </para>
219
220 <para>
221 The video codec of VIVO/1.0 files is standard <emphasis role="bold">h.263</emphasis>.
222 The video codec of VIVO/2.0 files is a modified, nonstandard
223 <emphasis role="bold">h.263v2</emphasis>. The audio is the same, it may be
224 <emphasis role="bold">g.723 (standard)</emphasis>, or
225 <emphasis role="bold">Vivo Siren</emphasis>.
226 </para>
227
228 <para>
229 See the
230 <link linkend="vivo-video">VIVO video codec</link> and
231 <link linkend="vivo-audio">VIVO audio codec</link>
232 sections for installation instructions.
233 </para>
234 </sect2>
235
236
237 <sect2 id="fli">
238 <title>FLI files</title>
239 <para>
240 <emphasis role="bold">FLI</emphasis> is a very old file format used by
241 Autodesk Animator, but it is a common file format for short animations on the net.
242 <application>MPlayer</application> demuxes and decodes FLI movies and is
243 even able to seek within them (useful when looping with the
244 <option>-loop</option> option). FLI files do not have keyframes, so the
245 picture will be messy for a short time after seeking.
246 </para>
247 </sect2>
248
249
250 <sect2 id="realmedia">
251 <title>RealMedia (RM) files</title>
252
253 <para>
254 Yes, <application>MPlayer</application> can read (demux) RealMedia
255 (<filename>.rm</filename>) files.
256 Here are the lists of the supported <link
257 linkend="realvideo">RealVideo</link> and <link
258 linkend="realaudio">RealAudio</link> codecs.
259 </para>
260 </sect2>
261
262
263 <sect2 id="nuppelvideo">
264 <title>NuppelVideo files</title>
265 <para>
266 NuppelVideo
267 is a TV grabber tool (AFAIK:). <application>MPlayer</application> can read
268 its <filename>.NUV</filename> files (only NuppelVideo 5.0). Those files can
269 contain uncompressed YV12, YV12+RTJpeg compressed, YV12 RTJpeg+lzo
270 compressed, and YV12+lzo compressed frames.
271 <application>MPlayer</application> decodes (and also <emphasis role="bold">encodes</emphasis>
272 them with <application>MEncoder</application> to MPEG-4 (DivX)/etc!) them all.
273 Seeking works.
274 </para>
275 </sect2>
276
277
278 <sect2 id="yuv4mpeg">
279 <title>yuv4mpeg files</title>
280 <para>
281 <ulink url="http://mjpeg.sf.net">yuv4mpeg / yuv4mpeg2</ulink>
282 is a file format used by the
283 <ulink url="http://mjpeg.sf.net">mjpegtools programs</ulink>.
284 You can grab, produce, filter or encode video in this format using these tools.
285 The file format is really a sequence of uncompressed YUV 4:2:0 images.
286 </para>
287 </sect2>
288
289
290 <sect2 id="film">
291 <title>FILM files</title>
292 <para>
293 This format is used on old Sega Saturn CD-ROM games.
294 </para>
295 </sect2>
296
297
298 <sect2 id="roq">
299 <title>RoQ files</title>
300 <para>
301 RoQ files are multimedia files used in some ID games such as Quake III and
302 Return to Castle Wolfenstein.
303 </para>
304 </sect2>
305
306
307 <sect2 id="ogg">
308 <title>OGG/OGM files</title>
309 <para>
310 This is a new fileformat from <ulink url="http://www.xiph.org">Xiphophorus</ulink>.
311 It can contain any video or audio codec, CBR or VBR. You'll need
312 <systemitem class="library">libogg</systemitem> and
313 <systemitem class="library">libvorbis</systemitem> installed before
314 compiling <application>MPlayer</application> to be able to play it.
315 </para>
316 </sect2>
317
318
319 <sect2 id="sdp">
320 <title>SDP files</title>
321 <para>
322 <ulink url="ftp://ftp.rfc-editor.org/in-notes/rfc2327.txt">SDP</ulink> is an
323 IETF standard format for describing video and/or audio RTP streams.
324 (The &quot;<ulink url="http://www.live555.com/mplayer/">LIVE555 Streaming Media</ulink>&quot;
325 are required.)
326 </para>
327 </sect2>
328
329
330 <sect2 id="pva">
331 <title>PVA files</title>
332 <para>
333 PVA is an MPEG-like format used by DVB TV boards' software (e.g.:
334 <application>MultiDec</application>, <application>WinTV</application> under Windows).
335 </para>
336 </sect2>
337
338
339 <sect2 id="nsv">
340 <title>NSV files</title>
341 <para>
342 NSV (NullSoft Video) is the file format used by the
343 <application>Winamp</application> player to stream audio and video.
344 Video is VP3, VP5 or VP6, audio is MP3, AAC or VLB.
345 The audio only version of NSV has the <filename>.nsa</filename> extension.
346 <application>MPlayer</application> can play both NSV streams and files.
347 Please note that most files from the
348 <ulink url="http://www.winamp.com">Winamp site</ulink> use VLB audio, that
349 can't be decoded yet. Moreover streams from that site need an extra
350 depacketization layer that still has to be implemented (those files are
351 unplayable anyway because they use VLB audio).
352 </para>
353 </sect2>
354
355
356 <sect2 id="matroska">
357 <title>Matroska files</title>
358 <para>
359 Matroska is an open container format.
360 Read more on the <ulink url="http://www.matroska.org/">official site</ulink>.
361 </para>
362 </sect2>
363
364
365 <sect2 id="nut">
366 <title>NUT files</title>
367 <para>
368 NUT is the container format developed by <application>MPlayer</application> and
369 <application>FFmpeg</application> folks. Both projects support it.
370 Read more on the <ulink url="http://www.nut.hu/">official site</ulink>.
371 </para>
372 </sect2>
373
374
375 <sect2 id="gif">
376 <title>GIF files</title>
377 <para>
378 The <emphasis role="bold">GIF</emphasis> format is a common format for web
379 graphics. There are two versions of the GIF spec, GIF87a and GIF89a. The
380 main difference is that GIF89a allows for animation. <application>MPlayer</application>
381 supports both formats through use of <systemitem class="library">libungif</systemitem> or
382 another libgif-compatible library. Non-animated GIFs will be displayed as
383 single frame videos. (Use the <option>-loop</option> and <option>-fixed-vo</option>
384 options to display these longer.)
385 </para>
386
387 <para>
388 <application>MPlayer</application> currently does not support seeking in GIF
389 files. GIF files do not necessarily have a fixed frame size, nor a fixed
390 framerate. Rather, each frame is of independent size and is supposed to be
391 positioned in a certain place on a field of fixed-size. The framerate is
392 controlled by an optional block before each frame that specifies the next
393 frame's delay in centiseconds.
394 </para>
395
396 <para>
397 Standard GIF files contain 24-bit RGB frames with at most an 8-bit indexed
398 palette. These frames are usually LZW-compressed, although some GIF encoders
399 produce uncompressed frames to avoid patent issues with LZW compression.
400 </para>
401
402 <para>
403 If your distribution does not come with <systemitem class="library">libungif</systemitem>,
404 download a copy from the
405 <ulink url="http://sourceforge.net/projects/libungif">libungif
406 homepage</ulink>. For detailed technical information, have a look at the
407 <ulink url="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF89a specification</ulink>.
408 </para>
409 </sect2>
410 </sect1>
411
412 <!-- ********** -->
413
414 <sect1 id="audio-formats">
415 <title>Audio formats</title>
416
417 <para>
418 <application>MPlayer</application> is a <emphasis role="bold">movie</emphasis>
419 and not a <emphasis role="bold">media</emphasis> player, although it can play
420 some audio file formats (they are listed in the sections below). This is not
421 a recommended usage of <application>MPlayer</application>, you better use <ulink
422 url="http://www.xmms.org">XMMS</ulink>.
423 </para>
424
425 <sect2 id="mp3">
426 <title>MP3 files</title>
427 <para>
428 You may have problems playing certain MP3 files that
429 <application>MPlayer</application> will misdetect as MPEGs and play
430 incorrectly or not at all. This cannot be fixed without dropping support
431 for certain broken MPEG files and thus will remain like this for the
432 foreseeable future. The <option>-demuxer</option> flag described in the
433 man page may help you in these cases.
434 </para>
435 </sect2>
436
437 <sect2 id="ogg-vorbis">
438 <title>OGG/OGM files (Vorbis)</title>
439 <para>
440 Requires properly installed
441 <systemitem class="library">libogg</systemitem> and
442 <systemitem class="library">libvorbis</systemitem>.
443 </para>
444 </sect2>
445
446 <sect2 id="cdda">
447 <title>CD audio</title>
448 <para>
449 <application>MPlayer</application> can use <application>cdparanoia</application>
450 to play CDDA (Audio CD). The scope of this section does not contain enumerating
451 <application>cdparanoia</application>'s features.
452 </para>
453
454 <para>
455 See the man page's <option>-cdda</option> option which can be used to pass
456 options to <application>cdparanoia</application>.
457 </para>
458 </sect2>
459
460 <sect2 id="xmms">
461 <title>XMMS</title>
462 <para>
463 <application>MPlayer</application> can use <application>XMMS</application> input
464 plugins to play many file formats. There are plugins for SNES game tunes, SID
465 tunes (from Commodore 64), many Amiga formats, .xm, .it, VQF, musepack, Bonk,
466 shorten and many others. You can find them at the
467 <ulink url="http://www.xmms.org/plugins.php?category=input">XMMS input plugin page</ulink>.
468 </para>
469
470 <para>
471 For this feature you need to have <application>XMMS</application> and compile
472 <application>MPlayer</application> with <filename>./configure --enable-xmms</filename>.
473 If that does not work, you might need to set the <application>XMMS</application>
474 plugin and library path explicitly by way of the <option>--with-xmmsplugindir</option>
475 and <option>--with-xmmslibdir</option> options.
476 </para>
477 </sect2>
478 </sect1>
479
480 </chapter>