Before Proceeding with the FFMPEG compilation script, please make sure the check the Wiki section for different usage examples of FFMPEG. Another good source of information is the Ubuntu compilation guide for FFMPEG
Automated scripts for compilation of FFMPEG v.5.0 and its most popular librarires for Ubuntu based systems. The script is tested and working on Ubuntu 16.04 LTS Xenial Xerus and Ubuntu 18.04 LTS Bionic Beaver. After compilation the FFMPEG configuration should be:
ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --pkg-config-flags=--static --extra-libs='-lpthread -lm' --toolchain=hardened --enable-gpl --enable-nonfree --enable-version3 --disable-stripping --enable-libass --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-librubberband --enable-libshine --enable-libsnappy --enable-libssh --enable-libtwolame --enable-libzvbi --enable-openal --enable-sdl2 --enable-libdrm --enable-frei0r --enable-ladspa --enable-libpulse --enable-libsoxr --enable-libspeex --enable-avfilter --enable-postproc --enable-pthreads --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --disable-ffplay --enable-libopenjpeg --enable-libwebp --enable-libxvid --enable-libvidstab --enable-zlib --enable-openssl --enable-pic --enable-libzimg
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
The following libraries are also installed from source:
-
Video Codecs:
- Dirac - Dirac is an open and royalty-free video compression format, specification and system developed by BBC Research & Development.
- Kvazaar - Kvazaar is an award-winning academic open-source HEVC encoder developed from scratch in C.
- OpenH264 - OpenH264 is a free software library for real-time encoding and decoding video streams in the H.264/MPEG-4 AVC format, developed by Cisco.
- OpenJPEG - OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of JPEG 2000, a still-image compression standard.
- Theora - Theora is a free and open lossy video compression format from the Xiph.org Foundation.
- x264 - x264 is a free software library developed by VideoLAN for encoding video streams into the H.264/MPEG-4 AVC format.
- x265 - x265 is a library for encoding video into the High Efficiency Video Coding (HEVC/H.265) video compression format.
- Libvpx - Libvpx is a free software video codec library from Google and the Alliance for Open Media.
- Webp - WebP is an image format employing both lossy[6] and lossless compression. It is currently developed by Google
- AV1 - AOMedia Video 1 (AV1), is an open, royalty-free video coding format designed for video transmissions over the Internet. It is being developed by the Alliance for Open Media (AOMedia)
-
Video Plugins:
- vid.stab - vid.stab provides a reasonably easy and flexible way to stabilize (deshake) even strongly jiggled video clips.
-
Transport Protocols
- SRT - Secure Reliable Transport (SRT) is an open source video transport protocol and technology stack that optimizes streaming performance across unpredictable networks with secure streams and easy firewall traversal, bringing the best quality live video over the worst networks.
-
Audio Codecs:
- FDK-AAC - Fraunhofer's FDK AAC code provides a complete, high-quality audio compression.
- Lame MP3 - LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
- Opus - Opus is a lossy audio coding format developed by the Xiph.Org Foundation and standardized by the Internet Engineering Task Force
- Vorbis - Vorbis is a free and open-source codec for lossy audio compression headed by the Xiph.Org Foundation.
-
Container Formats:
- Ogg - Ogg is a free, open container format maintained by the Xiph.Org Foundation.
-
Filters
- VMAF - VMAF is a perceptual video quality assessment algorithm developed by Netflix
Please run the compilation.sh script sh compilation.sh
and it will take care of installing the latest version of FFMPEG and its most popular libraries from scratch presuming that you have cloned this repository.
In case you want to automate the installation of GIT and run the compilation script you can execute:
sudo apt update && sudo apt install git -y && git clone https://github.com/stoyanovgeorge/ffmpeg.git && cd ffmpeg && sh compilation.sh
If you want to omit the installation of some of these libraries, please comment the line in the compilation.sh script and also remove the parameter in the ffmpeg.sh script.
For example if you want to remove x265 support, you need to comment the sh $PWD/scripts/libx265.sh 2> $HOME/ffmpeg/logs/libx265.log
line in the compilation.sh script.
And in the ffmpeg.sh script you need to remove --enable-libkvazaar
option.
- Currently I am unable to compile the AV1 video codec from source.
Please use Github Issues in case you spot a bug or have an idea how to optimize the scripts.
- FFMPEG Generic Compilation Guide
- FFMPEG Ubuntu Compilation Guide
- FFMPEG Syntax
- FFMPEG Filters
- Comparison of Video Codecs and Containers
- List of YUV Formats
- Comparison of Container Formats
- X264 Encoding Guide
- FFV1 Video Encoding
- FFMPEG Ubuntu Compilation Guide
- Kvazaar - Open Source HEVC Encoding Library GitHub Project
- Kvazaar Official Webpage
- X265 Commands
- FFMPEG Presets Github
- FFPROBE examples
- FFProbe Tips
- VP9 Compression Guide
- VP9 vs. H.264 vs. H.265 Comparison
- VP9 Encoder Parameters
- VMAF