Пересборка ffpmeg: различия между версиями

Материал из wiki.nntc.nnov.ru
Перейти к навигации Перейти к поиску
(Новая: http://ubuntuforums.org/showpost.php?p=6963607&postcount=360)
 
Строка 1: Строка 1:
 
http://ubuntuforums.org/showpost.php?p=6963607&postcount=360
 
http://ubuntuforums.org/showpost.php?p=6963607&postcount=360
 +
 +
<td style="border-right: 1px solid rgb(255, 255, 255);" id="td_post_6963607">
 +
 +
 +
 +
<!-- icon and title -->
 +
<div class="smallfont">
 +
 +
<strong>Install FFmpeg and x264 on Ubuntu Hardy Heron 8.04 LTS</strong>
 +
</div>
 +
<hr size="1" style="color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);">
 +
<!-- / icon and title -->
 +
 +
 +
 +
 +
<!-- message -->
 +
<div id="post_message_6963607" class="vbclean_msgtext"><font size="4">Getting the Dependencies</font><br>
 +
<font size="4">1.</font>  First, install packages that x264 and FFmpeg require.  Make sure the Ubuntu universe and multiverse repositories are enabled.  For help doing this, refer to <a target="_blank" href="https://help.ubuntu.com/community/Repositories/Ubuntu#head-5bbef89639d9a7d93fe38f6356dc17847d373096">Adding the Universe and Multiverse Repositories</a> on the Ubuntu Wiki.<br>
 +
<br>
 +
<br>
 +
<font size="4">2.</font> Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following:<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 34px; text-align: left; overflow: auto;" dir="ltr" class="alt2">sudo apt-get remove ffmpeg x264 libx264-dev</pre>
 +
</div>Next, get all of the packages you will need to install FFmpeg and x264.<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 50px; text-align: left; overflow: auto;" dir="ltr" class="alt2">sudo apt-get update
 +
sudo apt-get install build-essential subversion git-core checkinstall texi2html libfaac-dev liblame-dev libsdl1.2-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev libxvidcore4-dev zlib1g-dev</pre>
 +
</div><font size="4">Install Yasm</font><br>
 +
<font size="4">3.</font> Yasm is required for x264:<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 130px; text-align: left; overflow: auto;" dir="ltr" class="alt2">cd
 +
wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
 +
tar xzvf yasm-1.1.0.tar.gz
 +
cd yasm-1.1.0
 +
./configure
 +
make
 +
sudo checkinstall --pkgname=yasm --pkgversion="1.1.0" --backup=no --deldoc=yes --default</pre>
 +
</div><br>
 +
<font size="4">Install x264</font><br>
 +
<font size="4">4.</font>  Get the most current source files from the official x264 git repository, compile, and install. <a target="_blank" href="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/">Daily source tarballs</a> are also available as an alternative to using git.<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 114px; text-align: left; overflow: auto;" dir="ltr" class="alt2">cd
 +
git clone git://git.videolan.org/x264.git
 +
cd x264
 +
./configure
 +
make
 +
sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" --backup=no --deldoc=yes --default</pre>
 +
</div><br>
 +
<font size="4">Install LAME</font><br>
 +
<font size="4">5.</font> This is used to encode mp3 audio. You can skip this step and omit <i>--enable-libmp3lame</i> from the <i>./configure</i> line in step 8 if you don't plan on encoding mp3.<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 162px; text-align: left; overflow: auto;" dir="ltr" class="alt2">sudo apt-get remove liblame-dev
 +
sudo apt-get install nasm
 +
cd
 +
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
 +
tar xzvf lame-3.98.4.tar.gz
 +
cd lame-3.98.4
 +
./configure --enable-nasm --disable-shared
 +
make
 +
sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4" --backup=no --deldoc=yes --fstrans=no --default</pre>
 +
</div><br>
 +
<font size="4">Install libopencore-amr</font><br>
 +
<font size="4">6.</font>  This will allow you to decode and encode AMR audio. You can skip this step and omit <i>--enable-libopencore-amrnb --enable-libopencore-amrwb</i> in step 8 if you don't plan on decoding or encoding AMR audio:<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 130px; text-align: left; overflow: auto;" dir="ltr" class="alt2">cd
 +
wget http://transact.dl.sourceforge.net/project/opencore-amr/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz
 +
tar xvf opencore-amr-0.1.2.tar.gz
 +
cd opencore-amr-0.1.2
 +
./configure --disable-shared
 +
make
 +
sudo checkinstall --pkgname=libopencore-amr --pkgversion="0.1.2" --backup=no --deldoc=yes --fstrans=no --default</pre>
 +
</div><br>
 +
<font size="4">Install libtheora</font><br>
 +
<font size="4">7.</font> This is used to encode Theora video that is usually found in ogg/ogv files. You can skip this step and omit <i>--enable-libtheora</i> in step 8 if you don't plan on encoding to Theora video:<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 146px; text-align: left; overflow: auto;" dir="ltr" class="alt2">sudo apt-get install libogg-dev
 +
cd
 +
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
 +
tar xzvf libtheora-1.1.1.tar.gz
 +
cd libtheora-1.1.1
 +
./configure --disable-shared
 +
make
 +
sudo checkinstall --pkgname=libtheora --pkgversion="1.1.1" --backup=no --deldoc=yes --fstrans=no --default</pre>
 +
</div><br>
 +
<font size="4">Install FFmpeg</font><br>
 +
<font size="4">8.</font>  Get the most current source files from the official FFmpeg svn, compile, and install. <a target="_blank" href="http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2">Nightly FFmpeg snapshots</a> are also available as an alternative to using subversion.<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 130px; text-align: left; overflow: auto;" dir="ltr" class="alt2">cd
 +
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
 +
cd ffmpeg
 +
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
 +
make
 +
sudo checkinstall --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" --backup=no --default
 +
hash x264 ffmpeg ffplay</pre>
 +
</div>That's it for installation.  You can keep the <i>~/x264</i> and <i>~/ffmpeg</i> directories if you later want to update the source files to a new revision.  See "Updating Your Installation" on the first page of this guide for more details.<br>
 +
<br>
 +
That's it!  Now head back to the <a target="_blank" href="http://ubuntuforums.org/showthread.php?t=786095">FFmpeg guide</a> for usage instructions and more.<br>
 +
<br>
 +
<br>
 +
<font size="4">Reverting Changes Made by This Tutorial</font><br>
 +
To remove FFmpeg/x264 and any changes made from this tutorial:<br>
 +
<div style="margin: 5px 20px 20px;">
 +
<div style="margin-bottom: 2px;" class="smallfont">Code:</div>
 +
<pre style="margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 34px; text-align: left; overflow: auto;" dir="ltr" class="alt2">sudo apt-get remove build-essential checkinstall ffmpeg git-core lame-ffmpeg libfaac-dev libopencore-amr libsdl1.2-dev libtheora libvorbis-dev libx11-dev libxext-dev libxfixes-dev libxvidcore4-dev nasm subversion texi2html x264 yasm zlib1g-dev</pre>
 +
</div>Lastly, delete the <i>ffmpeg</i>, <i>x264</i>, <i>yasm</i>, <i>theora</i>, <i>opencore</i>, and <i>lame</i> directories in your home folder.</div>
 +
<!-- / message -->
 +
               
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
<!-- edit note -->
 +
<div class="smallfont">
 +
<hr size="1" style="color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);">
 +
<em>
 +
 +
Last edited by FakeOutdoorsman; 3 Weeks Ago at <span class="time">03:43 PM</span>..
 +
 +
 +
Reason: added lame section; general cleanup
 +
 +
</em>
 +
</div>
 +
<!-- / edit note -->
 +
 +
 +
</td>

Версия 14:00, 26 ноября 2010

http://ubuntuforums.org/showpost.php?p=6963607&postcount=360


Install FFmpeg and x264 on Ubuntu Hardy Heron 8.04 LTS




Getting the Dependencies

1. First, install packages that x264 and FFmpeg require. Make sure the Ubuntu universe and multiverse repositories are enabled. For help doing this, refer to <a target="_blank" href="https://help.ubuntu.com/community/Repositories/Ubuntu#head-5bbef89639d9a7d93fe38f6356dc17847d373096">Adding the Universe and Multiverse Repositories</a> on the Ubuntu Wiki.


2. Uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open a terminal and run the following:

Code:
sudo apt-get remove ffmpeg x264 libx264-dev
Next, get all of the packages you will need to install FFmpeg and x264.
Code:
sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall texi2html libfaac-dev liblame-dev libsdl1.2-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev libxvidcore4-dev zlib1g-dev
Install Yasm

3. Yasm is required for x264:

Code:
cd
wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
tar xzvf yasm-1.1.0.tar.gz
cd yasm-1.1.0
./configure
make
sudo checkinstall --pkgname=yasm --pkgversion="1.1.0" --backup=no --deldoc=yes --default

Install x264
4. Get the most current source files from the official x264 git repository, compile, and install. <a target="_blank" href="ftp://ftp.videolan.org/pub/videolan/x264/snapshots/">Daily source tarballs</a> are also available as an alternative to using git.

Code:
cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" --backup=no --deldoc=yes --default

Install LAME
5. This is used to encode mp3 audio. You can skip this step and omit --enable-libmp3lame from the ./configure line in step 8 if you don't plan on encoding mp3.

Code:
sudo apt-get remove liblame-dev
sudo apt-get install nasm
cd
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
tar xzvf lame-3.98.4.tar.gz
cd lame-3.98.4
./configure --enable-nasm --disable-shared
make
sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4" --backup=no --deldoc=yes --fstrans=no --default

Install libopencore-amr
6. This will allow you to decode and encode AMR audio. You can skip this step and omit --enable-libopencore-amrnb --enable-libopencore-amrwb in step 8 if you don't plan on decoding or encoding AMR audio:

Code:
cd
wget http://transact.dl.sourceforge.net/project/opencore-amr/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz
tar xvf opencore-amr-0.1.2.tar.gz
cd opencore-amr-0.1.2
./configure --disable-shared
make
sudo checkinstall --pkgname=libopencore-amr --pkgversion="0.1.2" --backup=no --deldoc=yes --fstrans=no --default

Install libtheora
7. This is used to encode Theora video that is usually found in ogg/ogv files. You can skip this step and omit --enable-libtheora in step 8 if you don't plan on encoding to Theora video:

Code:
sudo apt-get install libogg-dev
cd
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
tar xzvf libtheora-1.1.1.tar.gz
cd libtheora-1.1.1
./configure --disable-shared
make
sudo checkinstall --pkgname=libtheora --pkgversion="1.1.1" --backup=no --deldoc=yes --fstrans=no --default

Install FFmpeg
8. Get the most current source files from the official FFmpeg svn, compile, and install. <a target="_blank" href="http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2">Nightly FFmpeg snapshots</a> are also available as an alternative to using subversion.

Code:
cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" --backup=no --default
hash x264 ffmpeg ffplay
That's it for installation. You can keep the ~/x264 and ~/ffmpeg directories if you later want to update the source files to a new revision. See "Updating Your Installation" on the first page of this guide for more details.


That's it! Now head back to the <a target="_blank" href="http://ubuntuforums.org/showthread.php?t=786095">FFmpeg guide</a> for usage instructions and more.


Reverting Changes Made by This Tutorial
To remove FFmpeg/x264 and any changes made from this tutorial:

Code:
sudo apt-get remove build-essential checkinstall ffmpeg git-core lame-ffmpeg libfaac-dev libopencore-amr libsdl1.2-dev libtheora libvorbis-dev libx11-dev libxext-dev libxfixes-dev libxvidcore4-dev nasm subversion texi2html x264 yasm zlib1g-dev
Lastly, delete the ffmpeg, x264, yasm, theora, opencore, and lame directories in your home folder.







Last edited by FakeOutdoorsman; 3 Weeks Ago at 03:43 PM..


Reason: added lame section; general cleanup