Install FFMPEG and FFMPEG-PHP On CentOs & RedHat

Install FFMPEG and FFMPEG-PHP On CentOs & RedHat

 

We can install ffmpeg with yum repository but before we have to create new repo with name dag.repo

 

  1. Create new repository with name dag.repo

#vi /etc/yum.repos.d/dag.repo

ffmpeg_html_c1b0954

  1. Add DAG GPG key

 

ffmpeg_html_4f93dc46

  1. Update yum

# yum -y update

4) Install FFMPEG with yum:

ffmpeg_html_1fa53af6

 

To check ffmpeg installed propely, use below command:

#rpm -qa|grep ffmpeg

ffmpeg_html_m769c48ea

 

5)Install ffmpeg-php:

Before install ffmpeg-php on the server, chck php-gd and php-devel installed with php.

Download ffmpeg-php from below url.

# wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download

# bunzip2 ffmpeg-php-0.6.0.tbz2

# tar -xvf ffmpeg-php-0.6.0.tar

# cd ffmpeg-php-0.6.0

If C compiler is not installed, Install it with below command:

# yum -y install gcc

  •  If got below error:

[root@node1 ffmpeg-php-0.6.0]# make

-bash: make: command not found

Solution:

#yum -y install make

 

Next Error while compiling with make:

ffmpeg_html_m213e28aa

While compiling ffmpeg-php get above error. Sulition is here.

# vi ffmpeg_frame.c

Search for PIX_FMT_RGBA32 and replace it with PIX_FMT_RGB32

To replace string use below

:%s/ PIX_FMT_RGBA32/ PIX_FMT_RGB32/g

After again re-run make:

# [root@node1 ffmpeg-php-0.6.0]# make

    [root@node1 ffmpeg-php-0.6.0]# make install

 

Add ffmpeg.so extension in php.ini configuration file with below command.

ffmpeg_html_3711c139

# Check ffmpeg-php installed properly:

Browse phpinfo.php page

http://ip address/phpinfo.php

http://192.168.91.130/phpinfo.php

ffmpeg_html_539b7da2

 

  •  check ffmpeg-php extension is avialable.

 

1 Comment to “Install FFMPEG and FFMPEG-PHP On CentOs & RedHat”

  1. Hi

    Thanks

    Only I think after re-run make: you need restart apache

    service httpd restart

    Thanks

Leave a comment

Your email address will not be published.


*