Difference between pages "Install/pt-br/Configuring" and "FLOP:FFmpeg"

From Funtoo
< Install(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
=== Configurando seu sistema ===
{{FLOP
Como é esperado de uma distribuição Linux, Funtoo Linux tem seu compartilhamento de arquivos de configuração. O arquivo que absolutamente requer que você edite de forma a assegurar que o Funtoo Linux inicialize com sucesso é <code>/etc/fstab</code>. Os outros são opcionais.  
|Created on=2015/01/31
|Summary=Funtoo Linux prefers FFmpeg. Some enlightenment about our choice and why we prefer this  or could switch to alternative in future.
|Author=Oleg, Mgorny
|Maintainer=Oleg
|Reference Bug=FL-844
}}
== Introduction ==
FFmpeg and Libav are library sets for multimedia decoding (and more). Both libraries expose similar API and features.


==== Utilizando o Nano ====
Both project have common origins and diverged only recently. The developers share the same bad coding practices causing permanent lack of API and ABI stability, therefore requiring frequent rebuilds of reverse dependencies.


O editor padrão incluso no ambiente chroot é chamado de <code>nano</code>. Para editar um dos arquivos abaixo, chame o nano como a seguir:
Worse than that, after the split projects use colliding SONAMEs for libraries with potentially different ABI. This means that after switching from one implementation to another, the reverse dependencies may become broken instantly (preserved-libs doesn't help) and need to be rebuilt ASAP.


<console>
Many packages for video decoding, are done via FFmpeg or Libav.  Differences between FFmpeg and Libav can have a major impact on its behavior: the number of files it can decode, whether it decodes correctly, what video and audio filters are provided, network behavior, and more.
(chroot) # ##i##nano /etc/fstab
</console>


Quando estiver no editor, você pode utilizar as teclas de cetas para mover o cursor, e teclas comuns como backspace e delete funcionarão como esperado. Para salvar o arquivo, pressione Control-X, e responda <code>y</code> quando solicitado para salvar o buffer modificado se você gostaria de salvar suas alterações.
== Current status ==
=== Funtoo ===
Funtoo supports only FFmpeg. It is forced by Funtoo version of virtual/ffmpeg. This provides the ability to avoid the Gentoo issues, as explained below.


==== Configuration Files ====
Decision made by Oleg, forced by #funtoo community and bugtracker reports.


Aqui estão uma lista completa de arquivos que você pode queres editar, dependendo de suas necessidades:
=== Gentoo ===
{{TableStart}}
Gentoo supports both ffmpeg and libav, with a preference towards libav. The preference is caused by package order in virtual/ffmpeg — when no other circumstance affects the package choice, Portage will prefer libav. However, if ffmpeg is already installed or a package incompatible with libav is requested, Portage will use ffmpeg instead.
<tr class="active"><th>Arquivo</th>
<th>Preciso alter-á-lo?</th>
<th>Descrição</th>
</tr><tr  class="danger">
<td><code>/etc/fstab</code></td>
<td>'''SIM - exigido'''</td>
<td>Pontos de montagem para todos os filesystems a serem utilizados no momento do boot. Esse arquivo deve refletir sua configuação de partição de disco. Vamos lhe guiar através da modificação desse arquivo abaixo.</td>
</tr><tr>
<td><code>/etc/localtime</code></td>
<td>''Talvez - recomendável''</td>
<td>Seu fuso horário (timezone), que será padrão ao UTC se não definido. Esse deve ser um link simbólico para algo localizado sob /usr/share/zoneinfo (ex. /usr/share/zoneinfo/America/Montreal) </td>
</tr><tr>
<td><code>/etc/make.conf</code> (symlink) - also known as:<br/><code>/etc/portage/make.conf</code></td>
<td>''Talvêz - recomendado''</td>
<td>Parâmetros utilizado pelo gcc (compilador), pelo portage, e pelo make. É uma boa ideia definir o MAKEOPTS. Isso é coberto mais para frente nessa documentação.</td>
</tr><tr>
<td><code>/etc/conf.d/hostname</code></td>
<td>''Talvez - recomendado''</td>
<td>Utilizado para definir o hostname do sistema. Defina a variável <code>hostname</code> como nome fully-qualified (com pontos, ex. <code>foo.funtoo.org</code>) se você tiver um. Caso contrário, defina para o hostname do sistema local (sem pontos, ex. <code>foo</code>). Padrões para <code>localhost</code> se não definido.</td>
</tr><tr>
<td><code>/etc/hosts</code></td>
<td>''Não''</td>
<td> Você não precisa mais definir manual o hostname nesse arquivo. Esse arquivo é gerado manualmente pelo <code>/etc/init.d/hostname</code>.</td>
</tr><tr>
<td><code>/etc/conf.d/keymaps</code></td>
<td>Opcional</td>
<td>Arquivo de configuração de mapeamento do teclado (fara console pseudo terminais). Configure se você não possui um teclado no padrão americano (non-US). Veja [[Funtoo Linux Localization]].</td>
</tr><tr>
<td><code>/etc/conf.d/hwclock</code></td>
<td>Opcional</td>
<td>Como o tempo de clock do hardware mantido pela bateria (battery-backed) do sistema é interpretado [UTC ou hora local (local time)]. Linux utiliza o clock do hardware mantido pela bateria para inicializar a hora do sistema quando o sistema é inicializado.</td>
</tr><tr>
<td><code>/etc/conf.d/modules</code></td>
<td>Opcional</td>
<td>Módulos do Kernel para carregar automaticamente na inicialização do sistema. Tipicamente não exigido. Veja [[Additional Kernel Resources]] para mais informações.</td>
</tr><tr>
<td><code>/etc/conf.d/consolefont</code></td>
<td>Opcional</td>
<td>Lhe permite especificar a font padrão do console. Para aplicar essa font, habilite o serviço consolefont ao executar rc-update add consolefont.</td>
</tr><tr>
<td><code>profiles</code></td>
<td>Opcional</td>
<td>Algumas configurações úteis para o portage que podem ajudar a acelerar a configuração inicial.</td>
</tr>
{{TableEnd}}


Se você estiver instalando uma versão em Inglês do Funtoo Linux, você está com sorte desde que muitos dos arquivos de configuração pode ser utilizadas como é. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])
There are two major technical issues with this design:
# there is no technically correct way of forcing rebuilds on ABI changes — subslot dependencies do not work with virtuals or || () deps,
# there is no way of forcing rebuilds when switching from libav to ffmpeg, and the other way around.


Let's go ahead and see what we have to do. Use <code>nano -w <name_of_file></code> to edit files -- the "<code>-w</code>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.
== Future status ==
=== Funtoo ===
Funtoo has no plan to change default FFmpeg, it only needs to mask libav in the profiles. Then dependencies on updated packages will unconditionally use FFmpeg. Eventually Funtoo will want to remove virtual/ffmpeg and depend on media-video/ffmpeg:0= directly in forked packages.


{{fancywarning|It's important to edit your <code>/etc/fstab</code> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <code>gdisk</code> or <code>fdisk</code>. Skipping this step may prevent Funtoo Linux from booting successfully.}}
=== Gentoo ===
There is a planned Gentoo change which will eventually replace virtual/ffmpeg and explicit || () deps with 'libav' USE flag. The flag will be added to all packages that support both FFmpeg and libav. When the flag is enabled, the package will use libav; otherwise it will use FFmpeg. The choice of flag name is forced by the fact that USE=ffmpeg is already used as generic ffmpeg-or-libav flag.


==== /etc/fstab ====
This change fixes both Gentoo issues:
# USE-conditional dependencies allow subslot dependencies to force rebuilds on ABI changes,
# provider change will force rebuild because of USE flag change.


<code>/etc/fstab</code> is used by the <code>mount</code> command which is ran when your system boots. Statements of this file inform <code>mount</code> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <code>/etc/fstab</code> and ensure that it reflects the partition configuration you used earlier:
The change may also eventually make it possible to install FFmpeg and libav side-by-side. Until then, the flag state would involve 'strong' preference of one implementation over the other, and user will have to change USE=libav as a global flag. '''Installing a package that supports only one of the two implementations will result in blocker that needs to be handled manually'''.


<console>
(chroot) # ##i##nano -w /etc/fstab
</console>


<pre>
== Detailed information on FFmpeg and libav ==
# The root filesystem should have a pass number of either 0 or 1.
=== FFmpeg and Libav history ===
# All other filesystems should have a pass number of 0 or greater than 1.
In 2011, parts of the FFmpeg developers were unhappy about the FFmpeg leadership, and decided to take over. This didn't quite work out. Apparently Fabrice Bellard, original FFmpeg developer and owner of the ffmpeg.org domain name, decided not to hand over the domain name to the new maintainers. So they followed Plan B, and forked FFmpeg, resulting in Libav. Since then, Libav did its own development, and completely ignored whatever FFmpeg did. FFmpeg, on the other hand, started to merge literally everything Libav did.
#
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# See the manpage fstab(5) for more information.
#
# <fs>     <mountpoint>  <type>  <opts>        <dump/pass>


/dev/sda1    /boot        ext2    noauto,noatime 1 2
The reason for the fork is most likely that the developers hate each other. While this formulation seems somewhat sloppy, it is most likely the truth. To this date, the #libav-devel IRC channel still has Michael Niedermayer (the FFmpeg maintainer since 2004 according to Wikipedia) on their ban list (similar misbehavior is exhibited by some FFmpeg developers). There is little to no cooperation between the two projects.
/dev/sda2    none          swap    sw            0 0
/dev/sda3    /            ext4    noatime        0 1
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0
</pre>


{{Note|Currently, our default <code>/etc/fstab</code> has the root filesystem as <code>/dev/sda4</code> and the swap partition as <code>/dev/sda3</code>. These will need to be changed to <code>/dev/sda3</code> and <code>/dev/sda2</code>, respectively.}}
More about FFmpeg's history and the fork incident can be found on Wikipedia


{{Note|If you're using UEFI to boot, change the <code>/dev/sda1</code> line so it says <code>vfat</code> instead of <code>ext2</code>. Similarly, make sure that the <code>/dev/sda3</code> line specifies either <code>xfs</code> or <code>ext4</code>, depending on which filesystem you chose at filesystem-creation time.}}
=== Situation today ===
FFmpeg has more features and slightly more active development than Libav, going by mailing list and commit volume. In particular, FFmpeg's features are a superset of Libav's features. This is because FFmpeg merges Libav's git master on a daily basis. Libav on the other hand seems to prefer to ignore FFmpeg development (with occasional cherry-picking of bug fixes and features).


==== /etc/localtime ====
Some Linux distributions, especially those that had Libav developers as FFmpeg package maintainers, replaced FFmpeg with Libav, while other distributions stick with FFmpeg. Application developers typically have to make sure their code works with both libraries. This can be trivial to hard, depending on the details. One larger problem is that the difference between the libraries makes it hard to keep up a consistent level of the user experience, since either library might silently or blatantly be not up to the task. It also encourages library users to implement some features themselves, rather than dealing with the library differences, or the question to which project to contribute.


<code>/etc/localtime</code> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <code>/etc/localtime</code> with a symbolic link to the timezone that you wish to use.
FFmpeg and Libav developers also seem to have the tendency to ignore the damage their rivalry is causing. Apparently fighting out these issues on the users' backs is better than reconciling. This means everyone using these libraries either has to suffer from the differences, or reimplement functionality that is not the same between FFmpeg and Libav.
 
{{FLOPFooter}}
<console>
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime
</console>
 
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <code>ls /usr/share/zoneinfo</code> to see what timezones are available. There are also sub-directories containing timezones described by location.
 
==== /etc/make.conf ====
 
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:
 
<pre>
MAKEOPTS="-j3"
</pre>
 
If you are unsure about how many processors/threads you have then use nproc to help you.
<console>
(chroot) # ##i##nproc
16
</console>
 
Set MAKEOPTS to this number plus one:
 
<pre>
MAKEOPTS="-j17"
</pre>
 
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<code>-</code>") sign tells Portage not to use the flag when compiling.  A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].
 
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:
 
<pre>
LINGUAS="fr"
</pre>
 
==== /etc/conf.d/hwclock ====
If you dual-boot with Windows, you'll need to edit this file and change the value of '''clock''' from '''UTC''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.
<console>
(chroot) # ##i##nano -w /etc/conf.d/hwclock
</console>
 
==== Localization ====
 
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].

Latest revision as of 07:44, February 1, 2015

Created on
2015/01/31
Original Author(s)
Oleg,Mgorny
Current Maintainer(s)
Error: No field named "Full_name" found for any of the specified database tables.
Status
Reference Bug
FL-844

Funtoo Linux Optimization Proposal: FFmpeg

Funtoo Linux prefers FFmpeg. Some enlightenment about our choice and why we prefer this or could switch to alternative in future.

Introduction

FFmpeg and Libav are library sets for multimedia decoding (and more). Both libraries expose similar API and features.

Both project have common origins and diverged only recently. The developers share the same bad coding practices causing permanent lack of API and ABI stability, therefore requiring frequent rebuilds of reverse dependencies.

Worse than that, after the split projects use colliding SONAMEs for libraries with potentially different ABI. This means that after switching from one implementation to another, the reverse dependencies may become broken instantly (preserved-libs doesn't help) and need to be rebuilt ASAP.

Many packages for video decoding, are done via FFmpeg or Libav. Differences between FFmpeg and Libav can have a major impact on its behavior: the number of files it can decode, whether it decodes correctly, what video and audio filters are provided, network behavior, and more.

Current status

Funtoo

Funtoo supports only FFmpeg. It is forced by Funtoo version of virtual/ffmpeg. This provides the ability to avoid the Gentoo issues, as explained below.

Decision made by Oleg, forced by #funtoo community and bugtracker reports.

Gentoo

Gentoo supports both ffmpeg and libav, with a preference towards libav. The preference is caused by package order in virtual/ffmpeg — when no other circumstance affects the package choice, Portage will prefer libav. However, if ffmpeg is already installed or a package incompatible with libav is requested, Portage will use ffmpeg instead.

There are two major technical issues with this design:

  1. there is no technically correct way of forcing rebuilds on ABI changes — subslot dependencies do not work with virtuals or || () deps,
  2. there is no way of forcing rebuilds when switching from libav to ffmpeg, and the other way around.

Future status

Funtoo

Funtoo has no plan to change default FFmpeg, it only needs to mask libav in the profiles. Then dependencies on updated packages will unconditionally use FFmpeg. Eventually Funtoo will want to remove virtual/ffmpeg and depend on media-video/ffmpeg:0= directly in forked packages.

Gentoo

There is a planned Gentoo change which will eventually replace virtual/ffmpeg and explicit || () deps with 'libav' USE flag. The flag will be added to all packages that support both FFmpeg and libav. When the flag is enabled, the package will use libav; otherwise it will use FFmpeg. The choice of flag name is forced by the fact that USE=ffmpeg is already used as generic ffmpeg-or-libav flag.

This change fixes both Gentoo issues:

  1. USE-conditional dependencies allow subslot dependencies to force rebuilds on ABI changes,
  2. provider change will force rebuild because of USE flag change.

The change may also eventually make it possible to install FFmpeg and libav side-by-side. Until then, the flag state would involve 'strong' preference of one implementation over the other, and user will have to change USE=libav as a global flag. Installing a package that supports only one of the two implementations will result in blocker that needs to be handled manually.


Detailed information on FFmpeg and libav

FFmpeg and Libav history

In 2011, parts of the FFmpeg developers were unhappy about the FFmpeg leadership, and decided to take over. This didn't quite work out. Apparently Fabrice Bellard, original FFmpeg developer and owner of the ffmpeg.org domain name, decided not to hand over the domain name to the new maintainers. So they followed Plan B, and forked FFmpeg, resulting in Libav. Since then, Libav did its own development, and completely ignored whatever FFmpeg did. FFmpeg, on the other hand, started to merge literally everything Libav did.

The reason for the fork is most likely that the developers hate each other. While this formulation seems somewhat sloppy, it is most likely the truth. To this date, the #libav-devel IRC channel still has Michael Niedermayer (the FFmpeg maintainer since 2004 according to Wikipedia) on their ban list (similar misbehavior is exhibited by some FFmpeg developers). There is little to no cooperation between the two projects.

More about FFmpeg's history and the fork incident can be found on Wikipedia

Situation today

FFmpeg has more features and slightly more active development than Libav, going by mailing list and commit volume. In particular, FFmpeg's features are a superset of Libav's features. This is because FFmpeg merges Libav's git master on a daily basis. Libav on the other hand seems to prefer to ignore FFmpeg development (with occasional cherry-picking of bug fixes and features).

Some Linux distributions, especially those that had Libav developers as FFmpeg package maintainers, replaced FFmpeg with Libav, while other distributions stick with FFmpeg. Application developers typically have to make sure their code works with both libraries. This can be trivial to hard, depending on the details. One larger problem is that the difference between the libraries makes it hard to keep up a consistent level of the user experience, since either library might silently or blatantly be not up to the task. It also encourages library users to implement some features themselves, rather than dealing with the library differences, or the question to which project to contribute.

FFmpeg and Libav developers also seem to have the tendency to ignore the damage their rivalry is causing. Apparently fighting out these issues on the users' backs is better than reconciling. This means everyone using these libraries either has to suffer from the differences, or reimplement functionality that is not the same between FFmpeg and Libav.