{"id":1661,"date":"2015-01-27T06:18:12","date_gmt":"2015-01-27T06:18:12","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=1661"},"modified":"2015-01-27T06:18:12","modified_gmt":"2015-01-27T06:18:12","slug":"add-ffmpeg","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/27\/add-ffmpeg\/","title":{"rendered":"Add ffmpeg"},"content":{"rendered":"<p>Import the GPG key from the repo:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# rpm -ivh http:\/\/dl.atrpms.net\/all\/atrpms-repo-6-7.el6.x86_64.rpm\nRetrieving http:\/\/dl.atrpms.net\/all\/atrpms-repo-6-7.el6.x86_64.rpm\nPreparing...                ########################################### &#x5B;100%]\n   1:atrpms-repo            ########################################### &#x5B;100%]\n\n<\/pre>\n<p>Install the ATRPMS Repo:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n#rpm -ivh http:\/\/dl.atrpms.net\/all\/atrpms-repo-6-7.el6.x86_64.rpm\n\n<\/pre>\n<p>Install<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n # yum -y --enablerepo=atrpms install ffmpeg ffmpeg-devel\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n]# ffmpeg -version\nffmpeg version 2.2.1\nbuilt on Apr 13 2014 13:00:18 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)\nconfiguration: --prefix=\/usr --libdir=\/usr\/lib64 --shlibdir=\/usr\/lib64 --mandir=\/usr\/share\/man --enable-shared --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --extra-cflags=&#039;-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC&#039; --disable-stripping\nlibavutil      52. 66.100 \/ 52. 66.100\nlibavcodec     55. 52.102 \/ 55. 52.102\nlibavformat    55. 33.100 \/ 55. 33.100\nlibavdevice    55. 10.100 \/ 55. 10.100\nlibavfilter     4.  2.100 \/  4.  2.100\nlibswscale      2.  5.102 \/  2.  5.102\nlibswresample   0. 18.100 \/  0. 18.100\nlibpostproc    52.  3.100 \/ 52.  3.100\n\n<\/pre>\n<p>Check the supported formats:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nffmpeg -format\n\n<\/pre>\n<p>Test converting videos. Here\u2019s an example from mp4 to h264:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\ncd \/usr\/local\/src\nwget https:\/\/archive.org\/download\/WoodstockFestivalTrailer\/Woodstock_Festival_Trailer.avi\nffmpeg -i Woodstock_Festival_Trailer.avi -vcodec libx264 Woodstock_Festival_Trailer-H264.avi\nAfter done, you should see the new H264 file:\n\n-rw-r--r-- 1 root root 20M May 4 2006 Woodstock_Festival_Trailer.avi\n-rw-r--r-- 1 root root 15M Jan 30 10:01 Woodstock_Festival_Trailer-H264.avi\n\n<\/pre>\n<p>How can I work with ffmpeg using PHP?<\/p>\n<p>Simple.  Just install php-ffmpeg extension. First, install REMI repo in order to get your php-ffmpeg package, then type:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nyum install php-ffmpeg\nVerify ffmpeg is loading from PHP:\n\nphp -i | grep ffmpeg -i\n\n<\/pre>\n<p>If you see this, it\u2019s working:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n&#x5B;root@nginxtips.com:~]php -i | grep ffmpeg -i\n\/etc\/php.d\/ffmpeg.ini,\nffmpeg\nffmpeg-php version =&gt; 0.7.0\nffmpeg-php built on =&gt; Jan  1 2013 09:50:55\nffmpeg-php gd support  =&gt; enabled\nffmpeg libavcodec version =&gt; Lavc53.61.100\nffmpeg libavcodec license =&gt; GPL version 3 or later\nffmpeg libavformat version =&gt; Lavf53.32.100\nffmpeg libavformat license =&gt; GPL version 3 or later\nffmpeg swscaler version =&gt; SwS2.1.100\nffmpeg swscaler license =&gt; GPL version 3 or later\n\n<\/pre>\n<p>Examples<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# ffmpeg -i source.wmv -s 500x400 -vcodec libx264 -strict -2 destination.mp4\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# ffmpeg -i source.wmv -strict -2 destination.mp4\n<\/pre>\n<p>Resources:<\/p>\n<p>h<a href=\"http:\/\/www.nginxtips.com\/ffmpeg-php-ffmpeg-centos-6-7\/\" target=\"_blank\" rel=\"noopener\">ttp:\/\/www.nginxtips.com\/ffmpeg-php-ffmpeg-centos-6-7\/<\/a><\/p>\n<p><a href=\"https:\/\/trac.ffmpeg.org\/wiki\/CompilationGuide\/Centos\" target=\"_blank\" rel=\"noopener\">https:\/\/trac.ffmpeg.org\/wiki\/CompilationGuide\/Centos<\/a><\/p>\n<p><a href=\"http:\/\/wiki.razuna.com\/display\/ecp\/FFMpeg+Installation+on+CentOS+and+RedHat\" target=\"_blank\" rel=\"noopener\">http:\/\/wiki.razuna.com\/display\/ecp\/FFMpeg+Installation+on+CentOS+and+RedHat<\/a><\/p>\n<p><a href=\"https:\/\/chrisjean.com\/install-ffmpeg-and-ffmpeg-php-on-centos-easily\/\" target=\"_blank\" rel=\"noopener\">https:\/\/chrisjean.com\/install-ffmpeg-and-ffmpeg-php-on-centos-easily\/<\/a><\/p>\n<p><a href=\"http:\/\/www.cpanelkb.net\/ffmpeg-auto-install-shell-script\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cpanelkb.net\/ffmpeg-auto-install-shell-script\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Import the GPG key from the repo: # rpm -ivh http:\/\/dl.atrpms.net\/all\/atrpms-repo-6-7.el6.x86_64.rpm Retrieving http:\/\/dl.atrpms.net\/all\/atrpms-repo-6-7.el6.x86_64.rpm Preparing&#8230; ########################################### &#x5B;100%] 1:atrpms-repo ########################################### &#x5B;100%] Install the ATRPMS Repo: #rpm -ivh http:\/\/dl.atrpms.net\/all\/atrpms-repo-6-7.el6.x86_64.rpm Install # yum -y &#8211;enablerepo=atrpms install ffmpeg ffmpeg-devel ]# ffmpeg -version ffmpeg version 2.2.1 built on Apr 13 2014 13:00:18 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4) configuration: &#8230; <a title=\"Add ffmpeg\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/27\/add-ffmpeg\/\" aria-label=\"Read more about Add ffmpeg\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1661","post","type-post","status-publish","format-standard","hentry","category-administration"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=1661"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1661\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=1661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=1661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=1661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}