Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin

 1 year ago -  by Daniel -  howto centos virtualmin ffmpeg ffmpeg-php

The other day I was requested to set-up few requirements for a client such as mod_rewriteGD libraryPHP Dombcmath etc.. and among these in the list there was theFFMPEG library and the FFMPEG-PHP extension. OK, no big deal, but this box has CentOS 6 (RHEL6) with Virtualmin/Webmin set-up on top of it using the base repositories only, so let's do it I said...

ok, I took the following steps in order to install and set-up FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin

  1. Update the system
  2. Install Development Tools
  3. Protect base repositories
  4. Add dag's repository
  5. Install FFMPEG
  6. Install FFMPEG-PHP
  7. Load FFMPEG-PHP extension

1. Make sure the CentOS 6 system is fully up-to-date

yum update

2. Install Development Tools

yum groupinstall "Development tools"

3. Protect the base repositories so the packages don't get updated by the unprotected ones

Install the ProtectBase yum plugin by

yum install yum-protectbase

and then navigate to /etc/yum.repos.d

cd /etc/yum.repos.d/

before doing any changes to the repositories, always do backup of the original ones.

cp -prv ../yum.repos.d{,.orig}

in order for a repository to be protected, a line protect=1 needs to be added to each repository section in CentOS-Base.repoCentOS-Media.repo and virtualmin.repo.

So, edit these files using your favourite editor or do the sed if you're feeling brave

sed -i '/gpgkey=/a\protect=1' CentOS-{Base,Media}.repo
sed -i '/gpgkey=/a\protect=1' virtualmin.repo

4. Add dag's repository by adding the following to /etc/yum.repos.d/dag.repo

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
enabled=1
protect=0

next import dag's rpm gpg key by

wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt -P /tmp
rpm --import /tmp/RPM-GPG-KEY.dag.txt

5. Proceed with installing FFMPEG and some development packages

yum install ffmpeg-devel php-devel re2c php-xml ffmpeg

verify FFMPEG is installed successfully by executing

ffmpeg

you should get something like

FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder

6. Compile and install the FFMPEG-PHP extension

mkdir /srv/build
cd /srv/build
wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
tar -xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0/ phpize
./configure

now run the following to prevent compilation failure with something like ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)

sed -i 's#PIX_FMT_RGBA32#PIX_FMT_RGB32#' ./ffmpeg_frame.c

and compile and install using

make
make install

you should end up with something like

Installing shared extensions:     /usr/lib64/php/modules/

7. Load the FFMPEG-PHP extension and reload Apache

echo -e "extension=ffmpeg.so\n" > /etc/php.d/ffmpeg.ini

restart the webserver by

/etc/init.d/httpd restart

verify that the FFMPEG-PHP extension is loaded

php -i | grep ffmpeg
php -m | grep ffmpeg

Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin的更多相关文章

  1. Linux下源码安装ffmpeg及ffmpeg的简单使用说明

    一.编译安装 ffmpeg在安装时依赖的包和版本都很让人头疼,不同编译环境也各不相同.公司之前封装了一个又各种出错. 其实办法很简单,就是到官网一步一步按着做就行了:http://trac.ffmpe ...

  2. (转载)[FFmpeg]使用ffmpeg从各种视频文件中直接截取视频图片

    你曾想过从一个视频文件中提取图片吗?在Linux下就可以,在这个教程中我将使用ffmpeg来从视频中获取图片. 什么是ffmpeg?What is ffmpeg? ffmpeg是一个非常有用的命令行程 ...

  3. 【FFMPEG】ffmpeg 中添加264支持

    ffmpeg 中带有264的解码,没有编码,需要添加x264: 参考百度上的"windows_ffmpeg编译 " 文档 下载ffmpeg 代码合x264代码, ffmpeg 代码 ...

  4. Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux

    Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux¶ Overview Use this tutorial t ...

  5. Install Apache, PHP And MySQL On CentOS 7 (LAMP)

    This tutorial shows how you can install an Apache2 webserver on a CentOS 7.0 server with PHP5 suppor ...

  6. Transaction check error: file /etc/rpm/macros.ghc-srpm from install of redhat-rpm-config-9.1.0-80.el7.centos.noarch conflicts with file from package epel-release-6-8.noarch Error Summary ----------

    ./certbot-auto certonly 报错: Transaction check error:   file /etc/rpm/macros.ghc-srpm from install of ...

  7. How to Install Apache Tomcat 8.5 on CentOS 7.3

    How to Install Apache Tomcat 8.5 on CentOS 7.3 From: https://www.howtoforge.com/tutorial/how-to-inst ...

  8. How to Install Apache Solr 4.5 on CentOS 6.4

    By Shay Anderson on October 2013 Knowledge Base  /  Linux  /  How to Install Apache Solr 4.5 on Cent ...

  9. Install .NET Core SDK on Linux CentOS / Oracle x64 | .NET

    原文:Install .NET Core SDK on Linux CentOS / Oracle x64 | .NET Linux发行版  CentOS / Oracle添加dotnet产品Feed ...

随机推荐

  1. AsyncTask的基本使用和各个参数的说明

    AsyncTask 的执行分为四个步骤,每一步都对应一个回调方法,需要注意的是这些方法不应该由应用程序调用,开发者需要做的就是实现这些方法.在任务的执行过程中,这些方法被自动调用. * onPreEx ...

  2. 【转】jQuery异步上传文件

    用了 jQuery Form插件来解决这个问题:http://malsup.com/jquery/form/#code-samples 有没有不用该插件来实现呢? 解决方法: 可以采用HTML5,用j ...

  3. SPFA算法学习笔记

    一.理论准备 为了学习网络流,先水一道spfa. SPFA算法是1994年西南交通大学段凡丁提出,只要最短路径存在,SPFA算法必定能求出最小值,SPFA对Bellman-Ford算法优化的关键之处在 ...

  4. 算法(第4版)-1.3.1 API

    总结:本小节介绍了泛型.自动装箱.迭代.Bag.Queue.Stack以及一个栈用例的经典例子--算术表达式求值. 重点: 1. 集合类的抽象数据类型的一个关键特性是我们应该可以用它们储存任意类型的数 ...

  5. 2015百度之星1002 查找有序序列(RMQ+主席树模板水过)

    题意:求在数列中能找到几个个长度为k 的区间,里面的 k 个数字排完序后是连续的. 思路:枚举范围,判断区间内是否有重复的数字(主席树),没有的话求区间最大-区间最小(RMQ),判断是否等于K,是的话 ...

  6. 【LeetCode OJ】Path Sum II

    Problem Link: http://oj.leetcode.com/problems/path-sum-ii/ The basic idea here is same to that of Pa ...

  7. LintCode Binary Tree Maximum Path Sum

    Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. ...

  8. 深入C#中get与set的详解(转)

    转自:http://www.jb51.net/article/37960.htm 释一:属性的访问器包含与获取(读取或计算)或设置(写)属性有关的可执行语句.访问器声明可以包含 get 访问器或 se ...

  9. 递归输出文件夹下的所有文件的名称(转自 MSDN)

    问题:如何输出给定文件夹目录下面的所有文件的名称? C#代码: using System; using System.IO; namespace MyTest { public class Progr ...

  10. latch: cache buffers chains故障处理总结(转载)

    一大早就接到开发商的电话,说数据库的CPU使用率为100%,应用相应迟缓.急匆匆的赶到现场发现进行了基本的检查后发现是latch: cache buffers chains 作祟,处理过程还算顺利,当 ...