Skip to content

Instantly share code, notes, and snippets.

@iJackUA
Last active May 30, 2023 20:03
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save iJackUA/5582974 to your computer and use it in GitHub Desktop.
Save iJackUA/5582974 to your computer and use it in GitHub Desktop.
Build ffmpeg and all needed codecs from latets git revisions
#!/bin/bash
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential git libass-dev libfaac-dev libgpac-dev libmp3lame-dev libopus-dev libtheora-dev libtool libvorbis-dev libvpx-dev pkg-config texi2html yasm zlib1g-dev
# YASM
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make
make install
cd ..
# x264
git clone --depth 1 git://git.videolan.org/x264.git
cd x264
./configure --prefix="$HOME/ffmpeg_build" --bindir="/usr/bin" --enable-static
make
make install
cd ..
# fdk-aac
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
cd ..
# ffmpeg
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="/usr/bin" --enable-gpl --enable-libass \
--enable-libfaac --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora \
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
make
make install
cd ..
wget https://gist.github.com/iJackUA/5582974/raw/b3dd91aa0c2fab4b5a8eda70f09d1d23bae6cd75/ffmpeg_build.sh
chmod a+x ffmpeg_build.sh
./ffmpeg_build.sh
@andrewsyc
Copy link

Yevhen, thanks for making this. I wanted a comprehensive build and this does it! :)

@talkingnews
Copy link

Hi there! Great script, but a few things have changed and I've updated it for 2019 and forked it to
https://gist.github.com/talkingnews/3a2ba82a18ccfd2b38eadcb1cbf78757

@citadelcitadel
Copy link

The # x264 section fails (hope someone can craft a working git clone make command)
did this as a workaround only if you have a apt-get system I did
aptitude search x264
aptitude search x265
made sure these are installed with

apt-get install libx265-dev x265 libx264-dev x264

root@GreenStorm:/tmp/fdk-aac# aptitude search x265
i A libx265-146 - H.265/HEVC video stream encoder (shared library)
p libx265-146:i386 - H.265/HEVC video stream encoder (shared library)
i libx265-dev - H.265/HEVC video stream encoder (development files)
p libx265-dev:i386 - H.265/HEVC video stream encoder (development files)
p libx265-doc - H.265/HEVC video stream encoder (documentation)
v libx265-doc:i386 -
i x265 - H.265/HEVC video stream encoder
p x265:i386 - H.265/HEVC video stream encoder
root@GreenStorm:/tmp/fdk-aac# aptitude search x264
i A libx264-152 - x264 video coding library
p libx264-152:i386 - x264 video coding library
i libx264-dev - development files for libx264
p libx264-dev:i386 - development files for libx264
i x264 - video encoder for the H.264/MPEG-4 AVC standard
p x264:i386 - video encoder for the H.264/MPEG-4 AVC standard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment