M HYPE SPLASH
// general

How to modify build rules in Makefile

By John Peck

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?

1

2 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-pthreads Remove this. It is auto enabled.
  • --enable-libvpx requires libvpx-dev package.
  • --enable-libmp3lame requires libmp3lame-dev package.
  • --enable-libtheora requires libtheora-dev, but I would omit it and use libvpx instead.
  • --enable-libvorbis requires libvorbis-dev, but I would omit it and use libopus instead.
  • --enable-libx264 requires libx264-dev.
  • --enable-libx265 requires libx265-dev.
  • --enable-runtime-cpudetect no need for this unless you're building an executable that will run on various machines.
  • --enable-libfdk-aac requires libfdk-aac-dev.
  • --enable-avfilter Remove this as it is automatically enabled.
  • --enable-libopencore_amrwb --enable-libopencore_amrnb Old, 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-filters Remove this as it is automatically enabled.
  • --enable-libvidstab Requires libvidstab-dev.
  • --enable-libaom Requires a recent libaom-dev. You may have to compile it if your repo version is too old.
  • --enable-libxcb Requires libxcb1-dev, libxcb-shm0-dev, and libxcb-xfixes0-dev. You can omit declaring this option as it is automatically detected and enabled.
  • --enable-gnutls Requires 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.

1

Required 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-dev

To 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 ldconfig

To 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-gnutls

For complete list of options:

 ./configure --help
13

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy