Installing FFMPEG from source on Ubuntu 14.0.4

Replace paths with where you like, but make sure you change also in my guide!

#go to opt folder, make directories, make directories if not exits
$cd /opt/dev-tools-sources
$mkdir ffmpeg
$cd ffmpeg

#make build and bin directories
$mkdir build
$mkdir bin

#clone the repo
$git clone source

#go to the source dir
$cd source

#install required packages
$sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev

#install yasm compilre
$sudo apt install yasm

#instal h264 lib
$sudo apt install libx264-dev

$./configure –prefix=”/opt/dev-tools-sources/ffmpeg/build” –bindir=”/opt/dev-tools-sources/ffmpeg/bin” –enable-gpl –enable-libx264 –enable-static –enable-shared

$make -j4

$sudo make install

#do not forget to add “/opt/dev-tools-sources/ffmpeg/bin” to you environment. eg in /home/usr/.profile

#you may face problem with ffmpeg binary can not find where XX is a number e.g. 57
#to fix this, first find out where it has been compiled in the make step:
$sudo find / -name

#the output of the find should look like something like this:

#now that you have found where the libavdevice is, you have to make it available to system by ldconfig
#to do so, go to /etc/ folder
$cd /etc/

#now make a new config file
$sudo nano ffmpeg.conf

#add the following content to the file (replace where actually you is!!!!)

#save and exit the nano editor

#now update the ldconfig by just calling it
$sudo ldconfig

#If you need to use header files provide by ffmpeg for other stuff, like opencv, you can find them here:



Saeid Yazdani

An Electronics Engineer with passion in Embedded Systems, Wireless Sensor Networks, Assembly, Desktop and Mobile Development, Web Development and generally anything that has to do with hardware and software of any kind!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.