{"id":979,"date":"2015-10-27T10:34:33","date_gmt":"2015-10-27T13:34:33","guid":{"rendered":"http:\/\/blog.abratel.com.br\/?p=979"},"modified":"2015-10-27T13:35:00","modified_gmt":"2015-10-27T16:35:00","slug":"instalacao-ffmpeg-centos-7","status":"publish","type":"post","link":"https:\/\/blog.abratel.com.br\/?p=979","title":{"rendered":"Instala\u00e7\u00e3o FFmpeg CentOS 7"},"content":{"rendered":"<p>No centos 7 n\u00e3o existe mais o pacote FFmpeg.<br \/>\nNa internet existem tutoriais para instala\u00e7\u00e3o utilizando reposit\u00f3rios porem sempre est\u00e3o quebrados.<br \/>\nUma alternativa a isso tudo \u00e9 compilar todas as bibliotecas e o proprio ffmpeg &#8220;na unha&#8221;<\/p>\n<p><strong>1 &#8211; Instalar as depend\u00eancias:<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel\r\n<\/pre>\n<p><strong>2 &#8211; Criar um diret\u00f3rio onde armazenaremos todas as depend\u00eancias:<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmkdir ~\/ffmpeg_sources\r\n<\/pre>\n<p><strong>3 &#8211; Instala\u00e7\u00e3o do Yasm <\/strong><br \/>\nYasm is an assembler used by x264 and FFmpeg<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ngit clone --depth 1 git:\/\/github.com\/yasm\/yasm.git\r\ncd yasm\r\nautoreconf -fiv\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --bindir=&quot;$HOME\/bin&quot;\r\nmake\r\nmake install\r\nmake distclean\r\nlibx264\r\n<\/pre>\n<p><strong>4 &#8211; Instala\u00e7\u00e3o do H.264 video encoder. <\/strong><\/p>\n<p>See the H.264 Encoding Guide for more information and usage examples<br \/>\nRequires ffmpeg to be configured with &#8211;enable-gpl &#8211;enable-libx264.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ngit clone --depth 1 git:\/\/git.videolan.org\/x264\r\ncd x264\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --bindir=&quot;$HOME\/bin&quot; --enable-static\r\nmake\r\nmake install\r\nmake distclean\r\nlibx265\r\n<\/pre>\n<p><strong>5 &#8211; H.265\/HEVC video encoder. See the H.265 Encoding Guide for more information and usage examples.<\/strong><\/p>\n<p>Requires ffmpeg to be configured with &#8211;enable-gpl &#8211;enable-libx265.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\nhg clone https:\/\/bitbucket.org\/multicoreware\/x265\r\ncd ~\/ffmpeg_sources\/x265\/build\/linux\r\ncmake -G &quot;Unix Makefiles&quot; -DCMAKE_INSTALL_PREFIX=&quot;$HOME\/ffmpeg_build&quot; -DENABLE_SHARED:bool=off ..\/..\/source\r\nmake\r\nmake install\r\n<\/pre>\n<p><strong>6 &#8211; libfdk_aac <\/strong><br \/>\nAAC audio encoder.<\/p>\n<p>Requires ffmpeg to be configured with &#8211;enable-libfdk-aac (and &#8211;enable-nonfree if you also included &#8211;enable-gpl).<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ngit clone --depth 1 git:\/\/git.code.sf.net\/p\/opencore-amr\/fdk-aac\r\ncd fdk-aac\r\nautoreconf -fiv\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --disable-shared\r\nmake\r\nmake install\r\nmake distclean\r\n<\/pre>\n<p><strong>7 &#8211; libmp3lame <\/strong><\/p>\n<p>MP3 audio encoder.<br \/>\nRequires ffmpeg to be configured with &#8211;enable-libmp3lame.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ncurl -L -O http:\/\/downloads.sourceforge.net\/project\/lame\/lame\/3.99\/lame-3.99.5.tar.gz\r\ntar xzvf lame-3.99.5.tar.gz\r\ncd lame-3.99.5\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --bindir=&quot;$HOME\/bin&quot; --disable-shared --enable-nasm\r\nmake\r\nmake install\r\nmake distclean\r\n<\/pre>\n<p><strong>8 &#8211; libopus <\/strong><\/p>\n<p>Opus audio decoder and encoder.<\/p>\n<p>Requires ffmpeg to be configured with &#8211;enable-libopus.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ngit clone git:\/\/git.opus-codec.org\/opus.git\r\ncd opus\r\nautoreconf -fiv\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --disable-shared\r\nmake\r\nmake install\r\nmake distclean\r\n<\/pre>\n<p><strong>9 &#8211; libogg <\/strong> <\/p>\n<p>Ogg bitstream library. Required by libtheora and libvorbis.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ncurl -O http:\/\/downloads.xiph.org\/releases\/ogg\/libogg-1.3.2.tar.gz\r\ntar xzvf libogg-1.3.2.tar.gz\r\ncd libogg-1.3.2\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --disable-shared\r\nmake\r\nmake install\r\nmake distclean\r\n<\/pre>\n<p><strong>10 &#8211; libvorbis <\/strong> <\/p>\n<p>Vorbis audio encoder. Requires libogg.<\/p>\n<p>Requires ffmpeg to be configured with &#8211;enable-libvorbis.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ncurl -O http:\/\/downloads.xiph.org\/releases\/vorbis\/libvorbis-1.3.4.tar.gz\r\ntar xzvf libvorbis-1.3.4.tar.gz\r\ncd libvorbis-1.3.4\r\nLDFLAGS=&quot;-L$HOME\/ffmeg_build\/lib&quot; CPPFLAGS=&quot;-I$HOME\/ffmpeg_build\/include&quot; .\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --with-ogg=&quot;$HOME\/ffmpeg_build&quot; --disable-shared\r\nmake\r\nmake install\r\nmake distclean\r\n<\/pre>\n<p><strong>11 &#8211; libvpx  <\/strong><\/p>\n<p>VP8\/VP9 video encoder.<\/p>\n<p>Requires ffmpeg to be configured with &#8211;enable-libvpx.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ngit clone --depth 1 https:\/\/chromium.googlesource.com\/webm\/libvpx.git\r\ncd libvpx\r\n.\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --disable-examples\r\nmake\r\nmake install\r\nmake clean\r\n<\/pre>\n<p><strong>12 &#8211; FFmpeg<\/strong> <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/ffmpeg_sources\r\ngit clone --depth 1 git:\/\/source.ffmpeg.org\/ffmpeg\r\ncd ffmpeg\r\nPKG_CONFIG_PATH=&quot;$HOME\/ffmpeg_build\/lib\/pkgconfig&quot; .\/configure --prefix=&quot;$HOME\/ffmpeg_build&quot; --extra-cflags=&quot;-I$HOME\/ffmpeg_build\/include&quot; --extra-ldflags=&quot;-L$HOME\/ffmpeg_build\/lib&quot; --bindir=&quot;$HOME\/bin&quot; --pkg-config-flags=&quot;--static&quot; --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265\r\nmake\r\nmake install\r\nmake distclean\r\nhash -r\r\n\r\n<\/pre>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p><strong>Atualiza\u00e7\u00f5es:<\/strong><\/p>\n<p>Updating<\/p>\n<p>Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First, remove the old files and then update the dependencies:<\/p>\n<p>rm -rf ~\/ffmpeg_build ~\/bin\/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,x265,yasm,ytasm}<br \/>\n# yum install autoconf automake cmake gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel<br \/>\nUpdate Yasm<\/p>\n<p>cd ~\/ffmpeg_sources\/yasm<br \/>\nmake distclean<br \/>\ngit pull<br \/>\nThen run .\/configure, make, and make install as shown in the Install yasm section.<\/p>\n<p>Update x264<\/p>\n<p>cd ~\/ffmpeg_sources\/x264<br \/>\nmake distclean<br \/>\ngit pull<br \/>\nThen run .\/configure, make, and make install as shown in the Install x264 section.<\/p>\n<p>Update x265<\/p>\n<p>cd ~\/ffmpeg_sources\/x265<br \/>\nrm -rf ~\/ffmpeg_sources\/x265\/build\/linux\/*<br \/>\nhg update<br \/>\ncd ~\/ffmpeg_sources\/x265\/build\/linux<br \/>\nThen run cmake, make, and make install as shown in the Install x265 section.<\/p>\n<p>Update libfdk_aac<\/p>\n<p>cd ~\/ffmpeg_sources\/fdk_aac<br \/>\nmake distclean<br \/>\ngit pull<br \/>\nThen run .\/configure, make, and make install as shown in the Install libfdk_aac section.<\/p>\n<p>Update libvpx<\/p>\n<p>cd ~\/ffmpeg_sources\/libvpx<br \/>\nmake clean<br \/>\ngit pull<br \/>\nThen run .\/configure, make, and make install as shown in the Install libvpx section.<\/p>\n<p>Update FFmpeg<\/p>\n<p>cd ~\/ffmpeg_sources\/ffmpeg<br \/>\nmake distclean<br \/>\ngit pull<br \/>\nThen run .\/configure, make, and make install as shown in the Install FFmpeg section.<\/p>\n<p>Reverting changes made by this guide<\/p>\n<p>rm -rf ~\/ffmpeg_build ~\/ffmpeg_sources ~\/bin\/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,yasm,ytasm}<br \/>\n# yum erase autoconf automake cmake gcc gcc-c++ git libtool mercurial nasm pkgconfig zlib-devel<br \/>\nhash -r<br \/>\nIf You Need Help<\/p>\n<p>Feel free to ask your questions at the #ffmpeg IRC channel or the \u200bffmpeg-user mailing list.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No centos 7 n\u00e3o existe mais o pacote FFmpeg. Na internet existem tutoriais para instala\u00e7\u00e3o utilizando reposit\u00f3rios porem sempre est\u00e3o quebrados. Uma alternativa a isso tudo \u00e9 compilar todas as bibliotecas e o proprio ffmpeg &#8220;na unha&#8221; 1 &#8211; Instalar as depend\u00eancias: 2 &#8211; Criar&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/979"}],"collection":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=979"}],"version-history":[{"count":5,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/979\/revisions"}],"predecessor-version":[{"id":984,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/979\/revisions\/984"}],"wp:attachment":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}