{"id":514,"date":"2008-07-31T00:00:00","date_gmt":"2008-07-30T16:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=514"},"modified":"2011-07-15T09:23:04","modified_gmt":"2011-07-15T01:23:04","slug":"ffmpeg-install-for-centos-5","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=514","title":{"rendered":"FFMPEG Install for CentOS 5"},"content":{"rendered":"<p><DIV class=entry-head><br \/>\n<H3 class=entry-title><A title='Permanent Link to \"A Robust FFMPEG Install for CentOS 5\"' href=\"http:\/\/gregorytomlinson.com\/encoded\/2008\/06\/11\/a-robust-ffmpeg-install-for-centos-5\/\" rel=bookmark>&nbsp;FFMPEG Install for CentOS 5<\/A><\/H3><\/DIV><!-- .entry-head --><br \/>\n<DIV class=entry-content><br \/>\n<P>A little while back, I posted a <A href=\"http:\/\/gregorytomlinson.com\/encoded\/2008\/04\/11\/installing-ffmpeg-on-centos-5\/\">basic install of ffmpeg for CentOS 5<\/A>. After working with that build over the last month, I found I needed to expand it to include many different video codecs. Because of licensing restrictions, binaries of the build cannot be distributed. However, instructions for a similar build can! I spent several days (or more) researching the packages I would need and I must have combed dozens of blogs to find this information. <STRIKE>The build I made strips sound from videos<\/STRIKE> [See update at the end of this post for more information on this subject], this decreases the final file size. If you need sound, you will not want to follow these steps exactly. I also stripped ffserver and ffplay from my build.<\/P><br \/>\n<P>These packages were executed in the following order. I cannot say for certain this exact order must be followed, it was the order in which ffmpeg threw the errors. This tutorial assumes you have wget, bzip2, tar and subversion installed on your system. If you do not, please find and install the lastest versions of these utilities for CentOS 5. Additionally, I have allowed all packages to install into their default directories, typically this is \/usr\/local\/[bin | lib]. If at any point during the process of a \u2018make\u2019 you run into errors, be sure and run \u2018make clean\u2019 before running \u2018make\u2019 again. You will either need root access of su access to install ffmpeg. The marker \u2018codec:$\u2019 is my prompt, it is merely to indicate separate commands.<\/P><br \/>\n<UL><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/liba52.sourceforge.net\/');\" href=\"http:\/\/liba52.sourceforge.net\/\" target=_blank>Package a52<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.audiocoding.com\/');\" href=\"http:\/\/www.audiocoding.com\/\" target=_blank>Package FAAD2<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.audiocoding.com\/');\" href=\"http:\/\/www.audiocoding.com\/\" target=_blank>Package FAAC<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/lame.sourceforge.net\/index.php');\" href=\"http:\/\/lame.sourceforge.net\/index.php\" target=_blank>Package LAME<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.tortall.net\/projects\/yasm\/');\" href=\"http:\/\/www.tortall.net\/projects\/yasm\/\" target=_blank>Package yasm<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.videolan.org\/developers\/x264.html');\" href=\"http:\/\/www.videolan.org\/developers\/x264.html\" target=_blank>Package X264<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.xvid.org\/');\" href=\"http:\/\/www.xvid.org\/\" target=_blank>Package Xvid<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.linux1394.org\/');\" href=\"http:\/\/www.linux1394.org\/\" target=_blank>Package libraw1394<\/A><\/LI><br \/>\n<LI><A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/libdc1394.sourceforge.net\/');\" href=\"http:\/\/libdc1394.sourceforge.net\/\" target=_blank>Package libdc1394<\/A><\/LI><\/UL><br \/>\n<P><STRONG>Getting Started<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$<BR>codec:$ mkdir -p .\/tmp\/ffmpeg-packages<BR>codec:$ cd .\/tmp\/ffmpeg-packages<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing a52<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$ wget http:\/\/liba52.sourceforge.net\/files\/a52dec-0.7.4.tar.gz<BR>codec:$ tar -zxf a52dec-0.7.4.tar.gz<BR>codec:$ cd a52dec-0.7.4<BR>codec:$ .\/configure &#8211;enable-shared=PKGS<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing FAAD2<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$ wget http:\/\/downloads.sourceforge.net\/faac\/faad2-2.6.1.tar.gz<BR>codec:$ tar zxf faad2-2.6.1.tar.gz<BR>codec:$ cd faad2<BR>codec:$ autoreconf -vif<BR>codec:$ .\/configure &#8211;disable-drm &#8211;disable-mpeg4ip<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing FAAC<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$ wget http:\/\/downloads.sourceforge.net\/faac\/faac-1.26.tar.gz<BR>codec:$ tar zxfv faac-1.26.tar.gz<BR>codec:$ cd faac<BR>codec:$ .\/bootstrap<BR>codec:$ .\/configure &#8211;disable-mp4v2<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing LAME<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$ wget \\<BR>http:\/\/superb-east.dl.sourceforge.net\/sourceforge\/lame\/\\<BR>lame-3.98b8.tar.gz<BR>codec:$ tar zxfv lame-3.98b8.tar.gz<BR>codec:$ cd lame-3.98b8<BR>codec:$ .\/configure<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing yasm<\/STRONG><\/P><br \/>\n<P>YASM is a modular assembler, it is required by the x264 package.<\/P><br \/>\n<P><CODE><BR>codec:$ wget \\<BR>http:\/\/www.tortall.net\/projects\/yasm\/releases\/yasm-0.7.0.tar.gz<BR>codec:$ tar zfvx yasm-0.7.0.tar.gz<BR>codec:$ cd yasm-0.7.0<BR>codec:$ .\/configure<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing x264<\/STRONG><BR>The x264 package is under <A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/en.wikipedia.org\/wiki\/Git_(software)');\" href=\"http:\/\/en.wikipedia.org\/wiki\/Git_%28software%29\" target=_blank>git<\/A> revision control, which is much like CVS or SVN. Thankfully, they provide daily tarballs. I grabbed this one:<\/P><br \/>\n<P><CODE><BR>codec:$ wget \\<BR>ftp:\/\/ftp.videolan.org:21\/\/pub\/videolan\/x264\/snapshots\/\\<BR>x264-snapshot-20080513-2245.tar.bz2<BR><\/CODE><\/P><br \/>\n<P>I just did a little exploring via an FTP program to find the snapshot I was after. If you are feeling adventurous, <A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.kernel.org\/pub\/software\/scm\/git\/');\" href=\"http:\/\/www.kernel.org\/pub\/software\/scm\/git\/\" target=_blank>download git<\/A> and try checking out the latest version from their repository.<\/P><br \/>\n<P><CODE><BR>codec:$ bzip2 -d x264-snapshot-20080513-2245.tar.bz2<BR>codec:$ tar xfv x264-snapshot-20080513-2245.tar<BR>codec:$ cd x264-snapshot-20080513-2245<BR>codec:$ .\/configure &#8211;enable-mp4-output &#8211;enable-shared &#8211;enable-pthread<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing Xvid<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$ wget http:\/\/downloads.xvid.org\/downloads\/xvidcore-1.1.3.tar.gz<BR>codec:$ tar zxfv xvidcore-1.1.3.tar.gz<BR>codec:$ cd xvidcore-1.1.3\/build\/generic<BR>codec:$ .\/configure<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..\/..\/..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing libraw1394<\/STRONG><\/P><br \/>\n<P><CODE><BR>codec:$ wget http:\/\/www.linux1394.org\/dl\/libraw1394-1.3.0.tar.gz<BR>codec:$ tar zxfv libraw1394-1.3.0.tar.gz<BR>codec:$ cd libraw1394-1.3.0<BR>codec:$ .\/configure<BR>codec:$ make dev<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing libdc1394<\/STRONG><\/P><br \/>\n<P>This project requires libraw1394, you must build it first. This project is a little confusing there is both a libdc1394 and a libdc1394-2. I have only installed the former. <A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/sourceforge.net\/project\/showfiles.php?group_id=8157');\" href=\"http:\/\/sourceforge.net\/project\/showfiles.php?group_id=8157\" target=_blank>Visit Sourceforge here<\/A>. I grabbed the tarball here:<\/P><br \/>\n<P><CODE><BR>codec:$ wget \\<BR>http:\/\/superb-west.dl.sourceforge.net\/sourceforge\/libdc1394\/\\<BR>libdc1394-1.2.2.tar.gz<BR>codec:$ tar zxfv libdc1394-1.2.2.tar.gz<BR>codec:$ cd libdc1394-1.2.2<BR>codec:$ .\/configure<BR>codec:$ make &amp;&amp; make install<BR>codec:$ cd ..<BR><\/CODE><\/P><br \/>\n<P><STRONG>Installing ffmpeg<\/STRONG><\/P><br \/>\n<P>For FFMPEG, you will need to get the latest out of SVN. FFMPEG doesn\u2019t ever make releases. To do so, run:<\/P><br \/>\n<P><CODE><BR>codec:$ svn checkout svn:\/\/svn.mplayerhq.hu\/ffmpeg\/trunk ffmpeg<BR>codec:$ cd ffmpeg<BR><\/CODE><\/P><br \/>\n<P><CODE><BR>codec:$ .\/configure &#8211;enable-gpl &#8211;enable-postproc &#8211;enable-nonfree &#8211;enable-postproc &#8211;enable-libfaad &#8211;enable-swscale &#8211;enable-avfilter &#8211;enable-pthreads &#8211;enable-libxvid &#8211;enable-libx264 &#8211;enable-libmp3lame &#8211;enable-libdc1394 &#8211;enable-liba52 &#8211;enable-libfaac &#8211;disable-ffserver &#8211;disable-ffplay<BR>codec:$ make<BR>codec:$ make install<BR><\/CODE><\/P><br \/>\n<P>It usually takes at least 5 mins for \u2018make\u2019 to run, be sure you have a good file before attempting to install. You will need to be sure and run the ldconfig setting if you have to re-compile, otherwise ffmpeg will throw an error that it cannot find library files. Here is a <A onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/howto-pages.org\/ffmpeg\/');\" href=\"http:\/\/howto-pages.org\/ffmpeg\/\" target=_blank>good resource for using ffmpeg<\/A>.<\/P><br \/>\n<P><STRONG>Post-Installation Actions<\/STRONG><\/P><br \/>\n<P>After the install in complete, you may need to add the \/usr\/local\/lib directory to your ld.so.config file. Do the following:<\/P><br \/>\n<P><CODE><BR>codec:$ cd \/etc\/<BR>codec:$ cd ld.so.conf.d<BR>codec:$ vi ffmpeg.conf<BR><\/CODE><\/P><br \/>\n<P>You need to add \u2018\/usr\/local\/lib\u2019 [sans-quotes] to this file and save it. Press Esc, :, x to do so in vi. Afterwords you need to run the following from the commandline<\/P><br \/>\n<P><CODE><BR>codec:$ ldconfig<BR><\/CODE><BR>That\u2019s it, you now have a fairly robust build of ffmpeg that can take almost anything you can throw at it. Sadly, licensing restrictions prevent binaries from being made of the above steps. Happy (video) encoding!<\/P><br \/>\n<P><STRONG>Update:<\/STRONG> This build doesn\u2019t actually strip sound from videos, I am doing that with a flag when I run ffmpeg, however, it should be noted that all the audio codecs you may find in many common video formats may not be supported in this build of ffmpeg, which is why I am choosing to strip audio entirely from videos.<\/P><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;FFMPEG Install for CentOS 5 A little while back, I posted a basic install of ffmpeg for CentOS 5. After working with that build over the last month, I found I needed to expand it to include many different video codecs. Because of licensing restrictions, binaries of the build cannot be distributed. However, instructions for &hellip; <a href=\"https:\/\/www.strongd.net\/?p=514\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">FFMPEG Install for CentOS 5<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[78,77],"class_list":["post-514","post","type-post","status-publish","format-standard","hentry","category-linux","tag-centos5","tag-ffmpeg"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=514"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions"}],"predecessor-version":[{"id":853,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/514\/revisions\/853"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}