How to modify build rules in Makefile
I tried to compile FFmpeg from source code located HERE. All is good, but the built binaries lack ffplay. And looks like the build rule is missing from the makefile located under /fftools.
How can I modify the makefile(s) to also build ffplay, alongside with ffmpeg and ffprobe?
12 Answers
No need to modify any Makefile.
ffplay
ffplay requires sdl2, so install the libsdl2-dev package to fulfill that dependency. You won't need --enable-ffplay as it is enabled automatically.
Your other ./configure line options
--enable-pthreadsRemove this. It is auto enabled.--enable-libvpxrequires libvpx-dev package.--enable-libmp3lamerequires libmp3lame-dev package.--enable-libtheorarequires libtheora-dev, but I would omit it and use libvpx instead.--enable-libvorbisrequires libvorbis-dev, but I would omit it and use libopus instead.--enable-libx264requires libx264-dev.--enable-libx265requires libx265-dev.--enable-runtime-cpudetectno need for this unless you're building an executable that will run on various machines.--enable-libfdk-aacrequires libfdk-aac-dev.--enable-avfilterRemove this as it is automatically enabled.--enable-libopencore_amrwb--enable-libopencore_amrnbOld, legacy encoders/decoders that nobody uses anymore. Requires libopencore-amrnb-dev and libopencore-amrwb-dev. If you remove this then you can remove--enable-version3.--enable-filtersRemove this as it is automatically enabled.--enable-libvidstabRequires libvidstab-dev.--enable-libaomRequires a recent libaom-dev. You may have to compile it if your repo version is too old.--enable-libxcbRequires libxcb1-dev, libxcb-shm0-dev, and libxcb-xfixes0-dev. You can omit declaring this option as it is automatically detected and enabled.--enable-gnutlsRequires libgnutls-dev or libgnutls28-dev depending on your Ubuntu version.
Compile guide
If you don't want to have to guess what to install just follow FFmpeg Wiki: Ubuntu.
1Required libraries:
sudo apt-get install autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-devTo build depency for aom which requires recent version than the one in the repo:
git clone
cd aom
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=1 ..
make
sudo make install
sudo ldconfigTo build ffmpeg:
wget -O ffmpeg-snapshot.tar.bz2 tar xjvf ffmpeg-snapshot.tar.bz2 cd ffmpeg/You need to run ./configure script in the source directory before you run make. I used the following flags to set the options:
./configure --prefix=/usr/local --enable-shared --disable-debug --enable-ffplay --disable-doc --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libvidstab --enable-libaom --enable-libxcb --enable-gnutlsFor complete list of options:
./configure --help 13