How To Install FFmpeg on CentOS 7 Step by Step

Install FFmpeg on CentOS 7

FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. In this tutorial i will show you the easy way to install ffmpeg and ffmpeg-php (php extension). In this tutorial we will learn how to Install FFmpeg on CentOS 7 Step by Step.

Prerequisites

This tutorial assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation FFmpeg on a CentOS 7 server.

Install FFmpeg on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum install -y epel-release
yum -y update

Step 2. Installing the Nux repository.

After enabling Epel repo, go ahead and install Nux Dextop repository:

sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Step 3. Installing FFmpeg and FFmpeg development packages on CentOS 7.

Install ffmpeg and ffmpeg -devel packages:

yum install ffmpeg ffmpeg-devel -y

To check for a installed ffmpeg version run:

ffmpeg -version

This should result in something very similar to the following output:

[[email protected] ~]# ffmpeg -version ffmpeg -version
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

If you want to learn more about FFmpeg, input:

ffmpeg -h

Congratulation’s! You have successfully installed FFmpeg. Thanks for using this tutorial for installing FFmpeg in CentOS 7 system. For additional help or useful information, we recommend you to check the official FFmpeg web site.

How To Install FFmpeg 4.1.3.tar.bz2 on Ubuntu 18.04 LTS

FFmpeg

FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. In this tutorial i will show you the easy way to install ffmpeg and ffmpeg-php (php extension).

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation FFmpeg on an Ubuntu 18.04 Bionic Beaver server.

Install FFmpeg on Ubuntu 18.04 LTS

Step 1. First make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing FFmpeg on Ubuntu 18.04 LTS.
Method 1. Install FFmpeg using PPA:

You’ll need to add FFmpeg’s PPA (personal package archive) to your system:

sudo add-apt-repository ppa:jonathonf/ffmpeg-3
sudo apt update
sudo apt install ffmpeg libav-tools x264 x265

Method 2. Install FFmpeg using default repository Ubuntu:

Install FFmpeg on Ubuntu is to use the apt command:

sudo apt install ffmpeg

To check for a installed ffmpeg version run:

### ffmpeg -version
ffmpeg version 3.4.2-1build1 Copyright (c) 2000-2018 the FFmpeg developers

Congratulation’s! You have successfully installed FFmpeg. Thanks for using this tutorial for installing FFmpeg on your Ubuntu 18.04 LTS Bionic Beaver. For additional help or useful information, we recommend you to check the official FFmpeg web site.

How To Install FFmpeg and FFmpeg-PHP Extension on CentOS

Install FFmpeg and FFmpeg-PHP Extension on CentOS

FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. In this tutorial we will learn Install FFmpeg and FFmpeg-PHP Extension on CentOS server.

Install FFmpeg on CentOS

Step 1. To install, first you must add the DAG yum repository information corresponding to your CentOS/RHEL version to yum:

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

Add the following text to the file and save:

[dag]
name=DAG RPM Repository
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

Step 2. After add Dag repository, Use yum to install ffmpeg using following command.

#<code>rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
#yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc

 

FFmpeg Basic Commands

#ffmpeg -version:            show version
#ffmpeg -formats:            show available formats
#ffmpeg -codecs:             show available codecs
#ffmpeg -decoders:           show available decoders
#ffmpeg -encoders:           show available encoders
#ffmpeg -bsfs:               show available bit stream filters
#ffmpeg -protocols:          show available protocols
#ffmpeg -pix_fmts:           show available pixel formats
#ffmpeg -layouts:            show standard channel layouts
#ffmpeg -sample_fmts:        show available audio sample formats
#ffmpeg -filters:            show available filters

 Install FFmpeg-PHP Extension on CentOS

Step 1.

 #yum install php-gd php-devel

Step 2.Download the latest ffmpeg-php release

#wget http://nchc.dl.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
#make
#make install

If you get  [ffmpeg_movie.lo] Error 1 when compiling ffmpeg-php, then you will need to do:

#nano ffmpeg_movie.c
Changes in ffmpeg_movie.c:
#row 311: list_entry *le; to zend_rsrc_list_entry *le;
#row 346: list_entry new_le; to zend_rsrc_list_entry new_le;
#row 360: hashkey_length+1, (void *)&new_le, sizeof(list_entry), to hashkey_length+1, (void *)&new_le,sizeof(zend_rsrc_list_entry),

 

Step 3. Copy the ffmpeg.so module in php default module location. Now you have to edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.

 #nano /etc/php.ini

Put the below two lines at the end of the php.ini file

[ffmpeg]
extension=ffmpeg.so

FFmpeg-PHP extension should now be installed. You can check by creating a file called info.php in /var/www/html/ with the following content:

<?php phpinfo(); ?>

How To Install FFmpeg on Ubuntu 17.04

Install FFmpeg on Ubuntu

FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. In this tutorial i will show you the easy way to install ffmpeg and ffmpeg-php (php extension).

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation FFmpeg on an Ubuntu 17.04 Zesty Zapus server.
Install FFmpeg on Ubuntu 17.04 Zesty Zapus

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing FFmpeg.
You’ll need to add FFmpeg’s PPA (personal package archive) to your system:

sudo add-apt-repository ppa:jonathonf/ffmpeg-3
sudo apt-get update
sudo apt upgrade

To undo the changes and restore to the stock version of FFmpeg in main Ubuntu repositories, purge the PPA via command:

sudo apt install ppa-purge
sudo ppa-purge ppa:jonathonf/ffmpeg-3

Congratulation’s! You have successfully installed FFmpeg. Thanks for using this tutorial for installing FFmpeg on your Ubuntu 17.04 Zesty Zapus. For additional help or useful information, we recommend you to check the official FFmpeg web site.