comparison DOCS/xml/en/encoding-guide.xml @ 17249:4d4878a4c6e5

New section: choosing the video codec for your encode: what to consider before picking it.
author gpoirier
date Tue, 27 Dec 2005 09:34:57 +0000
parents 64decafd9108
children 338e5704c5b1
comparison
equal deleted inserted replaced
17248:61cc20df7f3e 17249:4d4878a4c6e5
1345 </para> 1345 </para>
1346 <para> 1346 <para>
1347 There have also been reports of A/V desync when encoding from stdin 1347 There have also been reports of A/V desync when encoding from stdin
1348 with <application>MEncoder</application>. 1348 with <application>MEncoder</application>.
1349 Do not do this! Always use a file or CD/DVD/etc device as input. 1349 Do not do this! Always use a file or CD/DVD/etc device as input.
1350 </para>
1351 </sect2>
1352
1353 <sect2 id="menc-feat-dvd-mpeg4-codec">
1354 <title>Choosing the video codec</title>
1355
1356 <para>
1357 Choosing the video codec to use depends on several factors, some of
1358 which widely depend on personal taste and technical constraints.
1359 </para>
1360 <itemizedlist>
1361 <listitem><para>
1362 <emphasis role="bold">Compression efficiency</emphasis>:
1363 It's quite easy to understand that newer-generation codecs are made
1364 to yield better picture quality than previous generations.
1365 Therefore, you cannot be wrong
1366 <footnote id='fn-menc-feat-dvd-mpeg4-codec-cpu'>
1367 <para>Be careful, however: decoding DVD-resolution MPEG-4 AVC videos
1368 requires a fast machine (i.e. a Pentium 4 over 1.5Ghz or a Pentium M
1369 over 1Ghz).
1370 </para></footnote>
1371 by choosing MPEG-4 AVC codecs like
1372 <systemitem class="library">x264</systemitem> instead of MPEG-4 ASP codecs
1373 such as <systemitem class="library">libavcodec</systemitem> MPEG-4 or
1374 <systemitem class="library">XviD</systemitem>.
1375 (To get a better grasp of what the fundamental differences between
1376 MPEG-4 ASP and MPEG-4 AVC are, you would be well advised to read the entry
1377 "<ulink url="http://guru.multimedia.cx/?p=10">15 reasons why MPEG4 sucks</ulink>"
1378 from Michael Niedermayer's blog.)
1379 Likewise, you should get better quality using MPEG-4 ASP instead
1380 of MPEG-2 codecs.
1381 </para>
1382 <para>
1383 However, newer codecs which are in heavy development can suffer from
1384 bugs which have not yet been noticed and which can ruin an encode.
1385 This is simply the tradeoff for using bleeding-edge technology.
1386 </para>
1387 <para>
1388 What's more, beginning to use a new codec requires that you spend some
1389 time becoming familiar with its available options, so that you know what
1390 to adjust to achieve a desired picture quality.
1391 </para></listitem>
1392
1393 <listitem><para>
1394 <emphasis role="bold">Hardware compatibility</emphasis>:
1395 It usually takes a long time for standalone video players to begin to
1396 include support for the latest video codecs.
1397 As a result, most only support MPEG-2 and MPEG-4 ASP
1398 (beware: usually, not all MPEG-4 ASP features are supported).
1399 Please refer to the technical specs of your player (if they are available),
1400 or Google around for more information.
1401 </para></listitem>
1402
1403 <listitem><para>
1404 <emphasis role="bold">Best quality per encoding time</emphasis>:
1405 Codecs that have been around for some time (such as
1406 <systemitem class="library">libavcodec</systemitem> MPEG-4 and
1407 <systemitem class="library">XviD</systemitem>) are usually heavily
1408 optimized with all kinds of smart algorithms and SIMD assembly code.
1409 That's why they tend to yield the best quality per fps.
1410 However, they may have some very advanced options that, if enabled,
1411 will make the encode really slow for marginal gains.
1412 </para>
1413 <para>
1414 If you are after blazing speed you should stick around the default
1415 settings of the video codec (which doesn't mean you should not experiment
1416 with some of the options which are mentioned in other sections
1417 of this guide).
1418 </para>
1419 <para>
1420 You may also consider choosing a codec which can do multi-threaded
1421 processing.
1422 <systemitem class="library">libavcodec</systemitem> MPEG-4 does
1423 allow that, resulting in small speed gains at the price of lower
1424 picture quality.
1425 <systemitem class="library">XviD</systemitem> has some experimental
1426 patches available to boost encoding speed, by about 40-60% in typical
1427 cases, with low picture degradation.
1428 <systemitem class="library">x264</systemitem> also allows multi-threaded
1429 encoding, which currently speeds-up encoding by 15-30% while lowering
1430 PSNR by about 0.05dB.
1431 </para></listitem>
1432
1433 <listitem><para>
1434 <emphasis role="bold">Personal taste</emphasis>:
1435 This is where it gets almost irrational: For the same reason that some
1436 hung on to DivX&nbsp;3 for years when newer codecs were already doing wonders,
1437 some folks will prefer <systemitem class="library">XviD</systemitem>
1438 or <systemitem class="library">libavcodec</systemitem> MPEG-4 over
1439 <systemitem class="library">x264</systemitem>.
1440 </para>
1441 <para>
1442 Make your own judgment, and don't always listen to what some people will
1443 tell you to do or think: The best codec is the one you master the best,
1444 and the one that looks best to your eyes on your display
1445 <footnote id='fn-menc-feat-dvd-mpeg4-codec-playback'>
1446 <para>The same encode may not look the same on someone else's monitor or
1447 when played back by a different decoder, so future-proof your encodes by
1448 playing them back on different setups.</para></footnote>!
1449 </para></listitem>
1450 </itemizedlist>
1451 <para>
1452 Please refer to the section
1453 <link linkend="menc-feat-selecting-codec">selecting codecs and container formats</link>
1454 to get a list of supported codecs.
1350 </para> 1455 </para>
1351 </sect2> 1456 </sect2>
1352 1457
1353 <sect2 id="menc-feat-dvd-mpeg4-audio"> 1458 <sect2 id="menc-feat-dvd-mpeg4-audio">
1354 <title>Audio</title> 1459 <title>Audio</title>