├── scripts ├── nasm.sh ├── openh264.sh ├── vidstab.sh ├── ogg.sh ├── libopus.sh ├── libx265.sh ├── libvpx.sh ├── libsrt.sh ├── libvorbis.sh ├── libwebp.sh ├── libtheora.sh ├── kvazaar.sh ├── libx264.sh ├── libmp3lame.sh ├── libfdk-aac.sh ├── libaom.sh ├── libopenjpeg.sh ├── dirac.sh ├── vmaf.sh ├── ffmpeg.sh └── update_system.sh ├── compilation.sh ├── README.md └── LICENSE /scripts/nasm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/cyrillos/nasm.git 5 | cd nasm 6 | sh autogen.sh 7 | sh configure 8 | make -j$cpu_cnt 9 | sudo make install 10 | -------------------------------------------------------------------------------- /scripts/openh264.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/cisco/openh264.git 5 | cd openh264 6 | make -j$cpu_cnt 7 | sudo make install 8 | make clean 9 | sudo ldconfig 10 | -------------------------------------------------------------------------------- /scripts/vidstab.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/georgmartius/vid.stab.git 5 | cd vid.stab 6 | cmake . 7 | make -j$cpu_cnt 8 | sudo make install 9 | sudo ldconfig 10 | -------------------------------------------------------------------------------- /scripts/ogg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/soundcloud/ogg.git 5 | cd ogg 6 | ./autogen.sh --enable-static 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | -------------------------------------------------------------------------------- /scripts/libopus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone git://git.opus-codec.org/opus.git 5 | cd opus 6 | ./autogen.sh 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | sudo ldconfig 11 | -------------------------------------------------------------------------------- /scripts/libx265.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/videolan/x265.git 5 | cd x265/build/linux 6 | ./make-Makefiles.bash 7 | make -j$cpu_cnt 8 | sudo make install 9 | make clean 10 | -------------------------------------------------------------------------------- /scripts/libvpx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/webmproject/libvpx.git 5 | cd libvpx 6 | ./configure --enable-static 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | -------------------------------------------------------------------------------- /scripts/libsrt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/Haivision/srt.git 5 | cd srt 6 | ./configure --enable-static 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | sudo ldconfig 11 | -------------------------------------------------------------------------------- /scripts/libvorbis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/gypified/libvorbis.git 5 | cd libvorbis 6 | ./configure --enable-static 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | sudo ldconfig 11 | -------------------------------------------------------------------------------- /scripts/libwebp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/webmproject/libwebp.git 5 | cd libwebp 6 | ./autogen.sh 7 | ./configure --enable-static 8 | make -j$cpu_cnt 9 | sudo make install 10 | make distclean 11 | -------------------------------------------------------------------------------- /scripts/libtheora.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/Distrotech/libtheora.git 5 | cd libtheora 6 | ./configure --enable-static 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | sudo ldconfig 11 | -------------------------------------------------------------------------------- /scripts/kvazaar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/ultravideo/kvazaar.git 5 | cd kvazaar 6 | ./autogen.sh 7 | ./configure --enable-static --enable-pic 8 | make -j$cpu_cnt 9 | sudo make install 10 | make distclean 11 | sudo ldconfig 12 | -------------------------------------------------------------------------------- /scripts/libx264.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git 5 | cd x264 6 | ./configure --enable-static --enable-pic 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | -------------------------------------------------------------------------------- /scripts/libmp3lame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/gypified/libmp3lame.git 5 | cd libmp3lame 6 | ./configure --enable-static --enable-pic --disable-shared --enable-nasm 7 | make -j$cpu_cnt 8 | sudo make install 9 | make distclean 10 | sudo ldconfig 11 | -------------------------------------------------------------------------------- /scripts/libfdk-aac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #mkdir $HOME/install 4 | cd $HOME/ffmpeg/downloads/ 5 | git clone https://github.com/mstorsjo/fdk-aac.git 6 | cd fdk-aac 7 | ./autogen.sh 8 | ./configure --enable-static --enable-pic 9 | make -j$cpu_cnt 10 | sudo make install 11 | make distclean 12 | sudo ldconfig 13 | -------------------------------------------------------------------------------- /scripts/libaom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/mozilla/aom.git 5 | mkdir -p aom/aom_build 6 | cd aom/aom_build 7 | cmake -G "Unix Makefiles" -DENABLE_SHARED=off -DENABLE_NASM=on ../ 8 | make -j$cpu_cnt 9 | sudo make install 10 | make distclean 11 | sudo ldconfig 12 | -------------------------------------------------------------------------------- /scripts/libopenjpeg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/uclouvain/openjpeg.git 5 | mkdir -p openjpeg/openjpeg_build 6 | cd openjpeg/opengpeg_build 7 | cmake -G "Unix Makefiles" -DENABLE_SHARED=off .. 8 | make -j$cpu_cnt 9 | sudo make install 10 | sudo ldconfig 11 | make clean 12 | -------------------------------------------------------------------------------- /scripts/dirac.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | cd $HOME/ffmpeg/downloads 4 | git clone https://github.com/DIRACGrid/DIRAC.git 5 | cd DIRAC 6 | PATH="$HOME/ffmpeg/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg/lib/pkgconfig" 7 | ./configure --enable-static --prefix="$HOME/ffmpeg/install" --bindir="$HOME/ffmpeg/bin" --enable-pic 8 | make -j$cpu_cnt 9 | sudo make install 10 | make distclean 11 | sudo ldconfig 12 | -------------------------------------------------------------------------------- /scripts/vmaf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Installing the prerequisite packages 4 | prerequisites() { 5 | sudo apt update -qq 6 | sudo apt install -y \ 7 | pkg-config \ 8 | gfortran \ 9 | libhdf5-dev \ 10 | libfreetype6-dev \ 11 | liblapack-dev \ 12 | python \ 13 | python-setuptools \ 14 | python-dev \ 15 | python-pip \ 16 | python-tk \ 17 | git 1> /dev/null 18 | sudo -H pip install --upgrade pip 1> /dev/null 19 | pip install --user numpy scipy matplotlib notebook pandas sympy nose scikit-learn scikit-image h5py 1> /dev/null 20 | echo ""export PATH="$PATH:$HOME/.local/bin""" >> $HOME/.bashrc 21 | source "$HOME"/.bashrc 22 | } 23 | 24 | # Cloning the VMAF repository from Github 25 | vmaf_compilation() { 26 | cd "$HOME"/ffmpeg/downloads 27 | git clone https://github.com/Netflix/vmaf.git 1> /dev/null 28 | cd vmaf 29 | ./configure 30 | make 1> /dev/null 31 | sudo make install >1 /dev/null 32 | } 33 | 34 | # Testing the VMAF installation 35 | vmaf_testing() { 36 | git submodule update --init --recursive 1> /dev/null 37 | make -j"$cpu_cnt" 1> /dev/null 38 | echo ""export PYTHONPATH="$(pwd)/python/src:$(pwd)/sureal/python/src:$PYTHONPATH""" >> $HOME/.bashrc 39 | source "$HOME"/.bashrc 40 | ./unittest 41 | } 42 | prerequisites 43 | vmaf_compilation 44 | vmaf_testing 45 | 46 | -------------------------------------------------------------------------------- /scripts/ffmpeg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Download link for the latest ffmpeg version. 5 | url="http://ffmpeg.org/releases/ffmpeg-4.2.tar.bz2" 6 | # Finding out the name of the directory 7 | dirname=$(basename "$url" .tar.bz2) 8 | 9 | # Download of the latest ffmpeg version 10 | cd "$HOME/ffmpeg/downloads" || exit 11 | wget "$url" 12 | # Extraction of the latest ffmpeg package 13 | tar xjvf ffmpeg-*.tar.bz2 14 | # Removal of the tar.bz2 package 15 | rm ffmpeg-*.tar.bz2 16 | cd "$dirname" || exit 17 | 18 | # FFMPEG Compilation 19 | ./configure \ 20 | --pkg-config-flags="--static" \ 21 | --extra-libs="-lpthread -lm" \ 22 | --toolchain=hardened \ 23 | --enable-gpl \ 24 | --enable-nonfree \ 25 | --enable-version3 \ 26 | --disable-stripping \ 27 | --enable-avisynth \ 28 | --enable-libass \ 29 | --enable-libfontconfig \ 30 | --enable-libfreetype \ 31 | --enable-libfribidi \ 32 | --enable-libgme \ 33 | --enable-libvmaf \ 34 | --enable-libgsm \ 35 | --enable-librubberband \ 36 | --enable-libshine \ 37 | --enable-libsnappy \ 38 | --enable-libssh \ 39 | --enable-libtwolame \ 40 | --enable-libwavpack \ 41 | --enable-libzvbi \ 42 | --enable-openal \ 43 | --enable-sdl2 \ 44 | --enable-libdrm \ 45 | --enable-frei0r \ 46 | --enable-ladspa \ 47 | --enable-libpulse \ 48 | --enable-libsoxr \ 49 | --enable-libspeex \ 50 | --enable-avfilter \ 51 | --enable-postproc \ 52 | --enable-pthreads \ 53 | --enable-libfdk-aac \ 54 | --enable-libmp3lame \ 55 | --enable-libopus \ 56 | --enable-libtheora \ 57 | --enable-libvorbis \ 58 | --enable-libvpx \ 59 | --enable-libx264 \ 60 | --enable-libx265 \ 61 | --disable-ffplay \ 62 | --enable-libopenjpeg \ 63 | --enable-libsrt \ 64 | --enable-libwebp \ 65 | --enable-libxvid \ 66 | --enable-libvidstab \ 67 | --enable-libopenh264 \ 68 | --enable-zlib \ 69 | --enable-openssl 70 | make -j$cpu_cnt 71 | sudo make install 72 | sudo make distclean 73 | source ~/.profile 74 | -------------------------------------------------------------------------------- /compilation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PWD=`pwd` 4 | 5 | # Creating of install, bin and package config directories where we will download all the source packages, install them and link the package config 6 | mkdir -p $HOME/ffmpeg/logs $HOME/ffmpeg/downloads 7 | 8 | # Defining the CPU cores count to optimize the compilation 9 | cpu_cnt="$(nproc --all)" 10 | export cpu_cnt 11 | 12 | # Start executing the scripts 13 | 14 | echo "System Update is started..." 15 | sh $PWD/scripts/update_system.sh 2> $HOME/ffmpeg/logs/sysupdate.log 16 | echo "Update of the system had finished" 17 | echo "Start Compilation of the libs needed for ffmpeg..." 18 | # sh $PWD/scripts/nasm.sh 2> $HOME/ffmpeg/logs/nasm.log 19 | # sh $PWD/scripts/kvazaar.sh 2> $HOME/ffmpeg/logs/kvazaar.log 20 | # sh $PWD/scripts/libfdk-aac.sh 2> $HOME/ffmpeg/logs/libfdk-aac.log 21 | sh $PWD/scripts/ogg.sh 2> $HOME/ffmpeg/logs/ogg.log 22 | sh $PWD/scripts/libvorbis.sh 2> $HOME/ffmpeg/logs/libvorbis.log 23 | # sh $PWD/scripts/libopenjpeg.sh 2> $HOME/ffmpeg/logs/libopenjpeg.log 24 | # sh $PWD/scripts/libmp3lame.sh 2> $HOME/ffmpeg/logs/libmp3lame.log 25 | # sh $PWD/scripts/libopus.sh 2> $HOME/ffmpeg/logs/libopus.log 26 | # sh $PWD/scripts/libtheora.sh 2> $HOME/ffmpeg/logs/libtheora.log 27 | # sh $PWD/scripts/libwebp.sh 2> $HOME/ffmpeg/logs/libwebp.log 28 | # sh $PWD/scripts/libvpx.sh 2> $HOME/ffmpeg/logs/libvpx.log 29 | sh $PWD/scripts/libx264.sh 2> $HOME/ffmpeg/logs/libx264.log 30 | sh $PWD/scripts/libx265.sh 2> $HOME/ffmpeg/logs/libx265.log 31 | sh $PWD/scripts/vidstab.sh 2> $HOME/ffmpeg/logs/vidstab.log 32 | sh $PWD/scripts/openh264.sh 2> $HOME/ffmpeg/logs/openh264.log 33 | # sh $PWD/scripts/libaom.sh 2> $HOME/ffmpeg/logs/libaom.log 34 | sh $PWD/scripts/libsrt.sh 2> $HOME/ffmpeg/logs/libsrt.log 35 | sh $PWD/scripts/vmaf.sh 2> $HOME/ffmpeg/logs/vmaf.log 36 | echo "All required libs had been installed" 37 | echo "Start compilation of ffmpeg" 38 | sh $PWD/scripts/ffmpeg.sh 2> $HOME/ffmpeg/logs/ffmpeg.log 39 | echo "FFMPEG compilation has finished" 40 | 41 | # Removing of the install directory where the sources of the additional libraries were saved 42 | 43 | while true; do 44 | read -p "Do you wish to remove the install directory [Y/n]? " rmv 45 | rmv=${rmv,,} # lower all the cases in the rmv variable 46 | case $rmv in 47 | [y]* | "" ) rm -rf $HOME/ffmpeg/downloads 48 | echo "The install directory was successfully removed"; break;; # check if the "rmv" var starts with the letter Y or for Enter key 49 | [n]* ) echo "The install directory won't be removed"; exit;; 50 | * ) echo "Please try again [Y/n]! ";; 51 | esac 52 | done 53 | 54 | # Reboot of the system 55 | 56 | while true; do 57 | read -p "Do you wish to reboot your machine [Y/n]? " rmv 58 | rmv=${rmv,,} # lower all the cases in the rmv variable 59 | case $rmv in 60 | [y]* | "" ) echo "Your machine will be restarted in 5 seconds..." 61 | sleep 5 62 | sudo reboot; break;; # check if the "rmv" var starts with the letter Y or for Enter key 63 | [n]* ) echo "Please reboot manually your machine later on!"; exit;; 64 | * ) echo "Please try again [Y/n]! ";; 65 | esac 66 | done 67 | -------------------------------------------------------------------------------- /scripts/update_system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Start the system update..." 4 | sudo apt update 5 | sudo apt upgrade -y 6 | sudo apt dist-upgrade -y 7 | sudo apt install \ 8 | autoconf \ 9 | automake \ 10 | build-essential \ 11 | nasm \ 12 | fonts-dejavu-core \ 13 | fontconfig-config \ 14 | libtool \ 15 | pkg-config \ 16 | texinfo \ 17 | yasm \ 18 | libass-dev \ 19 | checkinstall \ 20 | zlib1g-dev \ 21 | libxvidcore-dev \ 22 | libfontconfig1 \ 23 | cmake \ 24 | libasound2 \ 25 | libasound2-data \ 26 | libasound2-plugins \ 27 | fontconfig \ 28 | libaacs0 \ 29 | libasyncns0 \ 30 | libbdplus0 \ 31 | libbs2b0 \ 32 | libcaca0 \ 33 | libcairo2 \ 34 | libcroco3 \ 35 | libcrystalhd3 \ 36 | libdatrie1 \ 37 | libdrm-amdgpu1 \ 38 | libdrm-intel1 \ 39 | libdrm-nouveau2 \ 40 | libdrm-radeon1 \ 41 | libfftw3-double3 \ 42 | libflac8 \ 43 | libflite1 \ 44 | libgbm1 \ 45 | libgme0 \ 46 | libgomp1 \ 47 | libgraphite2-3 \ 48 | libgsm1 \ 49 | libharfbuzz0b \ 50 | libjbig0 \ 51 | libjpeg-turbo8 \ 52 | libjpeg8 \ 53 | libmp3lame0 \ 54 | libogg0 \ 55 | libopenal-dev \ 56 | libopenjp2-7-dev \ 57 | libwebp-dev \ 58 | libzvbi-dev \ 59 | libopus0 \ 60 | libpango-1.0-0 \ 61 | libpangocairo-1.0-0 \ 62 | libpangoft2-1.0-0 \ 63 | libpciaccess0 \ 64 | libpgm-5.2-0 \ 65 | libpixman-1-0 \ 66 | libpulse0 \ 67 | libdrm-dev \ 68 | libfdk-aac-dev \ 69 | libgme-dev \ 70 | libgsm1-dev \ 71 | libmp3lame-dev \ 72 | libopus-dev \ 73 | libpulse-dev \ 74 | librubberband-dev \ 75 | libshine-dev \ 76 | libsnappy-dev \ 77 | libssh-dev \ 78 | libtheora-dev \ 79 | libtwolame-dev \ 80 | libvpx-dev \ 81 | libwavpack-dev \ 82 | libraw1394-11 \ 83 | librsvg2-2 \ 84 | libsamplerate0 \ 85 | libsdl2-dev \ 86 | libsensors4 \ 87 | libshine3 \ 88 | libsndfile1 \ 89 | libsoxr0 \ 90 | libspeex1 \ 91 | libssh-gcrypt-4 \ 92 | libthai-data \ 93 | libthai0 \ 94 | libtheora0 \ 95 | libtiff5 \ 96 | libtwolame0 \ 97 | libvdpau1 \ 98 | libvorbis0a \ 99 | libvorbisenc2 \ 100 | libvorbisfile3 \ 101 | libwavpack1 \ 102 | libwayland-client0 \ 103 | libwayland-cursor0 \ 104 | libwayland-server0 \ 105 | libx11-xcb1 \ 106 | libxcb-dri2-0 \ 107 | libxcb-dri3-0 \ 108 | libxcb-present0 \ 109 | libxcb-render0 \ 110 | libxcb-shape0 \ 111 | libxcb-shm0 \ 112 | libxcb-sync1 \ 113 | libxcb-xfixes0 \ 114 | libxcursor1 \ 115 | libxdamage1 \ 116 | libxfixes3 \ 117 | libxi6 \ 118 | libxinerama1 \ 119 | libxkbcommon0 \ 120 | libxrandr2 \ 121 | libxrender1 \ 122 | libxshmfence1 \ 123 | libxss1 \ 124 | libxv1 \ 125 | libxvidcore4 \ 126 | libxxf86vm1 \ 127 | libzmq5 \ 128 | libzvbi-common \ 129 | libzvbi0 \ 130 | x11-common \ 131 | alsa-utils \ 132 | libbluray-bdj \ 133 | libfftw3-bin \ 134 | libfftw3-dev \ 135 | libportaudio2 \ 136 | opus-tools \ 137 | frei0r-plugins-dev \ 138 | tcl \ 139 | pulseaudio \ 140 | librsvg2-bin \ 141 | lm-sensors \ 142 | sndiod \ 143 | speex \ 144 | libvdpau-va-gl1 \ 145 | ladspa-sdk \ 146 | libsoxr-dev \ 147 | libspeex-dev \ 148 | python-dev \ 149 | python-pip \ 150 | python-tk \ 151 | libssl-dev -y 152 | sudo apt clean -y 153 | sudo apt autoremove -y 154 | echo "End of the system update" 155 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automated FFMPEG Compilation script for Ubuntu 2 | 3 | Before Proceeding with the FFMPEG compilation script, please make sure the check the [Wiki](https://github.com/stoyanovgeorge/ffmpeg/wiki "Wiki") section for different usage examples of FFMPEG. Another good source of information is the [Ubuntu compilation guide for FFMPEG](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) 4 | 5 | Automated scripts for compilation of [FFMPEG v.4.1](https://ffmpeg.org/ "FFMPEG Official Page") 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: 6 | 7 | ``` 8 | ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers 9 | built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04) 10 | configuration: --pkg-config-flags=--static --extra-libs='-lpthread -lm' --toolchain=hardened --enable-gpl --enable-nonfree --enable-version3 --disable-stripping --enable-avisynth --enable-libass --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-librubberband --enable-libshine --enable-libsnappy --enable-libssh --enable-libtwolame --enable-libwavpack --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-libsrt --enable-libwebp --enable-libxvid --enable-libvidstab --enable-libopenh264 --enable-zlib --enable-openssl 11 | libavutil 56. 22.100 / 56. 22.100 12 | libavcodec 58. 35.100 / 58. 35.100 13 | libavformat 58. 20.100 / 58. 20.100 14 | libavdevice 58. 5.100 / 58. 5.100 15 | libavfilter 7. 40.101 / 7. 40.101 16 | libswscale 5. 3.100 / 5. 3.100 17 | libswresample 3. 3.100 / 3. 3.100 18 | libpostproc 55. 3.100 / 55. 3.100 19 | Hyper fast Audio and Video encoder 20 | usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 21 | ``` 22 | 23 | The following libraries are also installed from source: 24 | 1. Video Codecs: 25 | * [Dirac](http://www.bbc.co.uk/opensource/projects/dirac/ "Dirac Codec") - Dirac is an open and royalty-free video compression format, specification and system developed by BBC Research & Development. 26 | * [Kvazaar](http://ultravideo.cs.tut.fi/ "Kvazaar Codec") - Kvazaar is an award-winning academic open-source HEVC encoder developed from scratch in C. 27 | * [OpenH264](http://www.openh264.org/ "OpenH264 Codec") - 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. 28 | * [OpenJPEG](http://www.openjpeg.org/ "OpenJPEG Codec") - 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. 29 | * [Theora](https://www.theora.org/ "Theora Codec") - Theora is a free and open lossy video compression format from the Xiph.org Foundation. 30 | * [x264](http://www.videolan.org/developers/x264.html "x264 Codec") - x264 is a free software library developed by VideoLAN for encoding video streams into the H.264/MPEG-4 AVC format. 31 | * [x265](http://www.videolan.org/developers/x264.html "x265 Codec") - x265 is a library for encoding video into the High Efficiency Video Coding (HEVC/H.265) video compression format. 32 | * [Libvpx](https://www.webmproject.org/code/ "Libvpx Codec") - Libvpx is a free software video codec library from Google and the Alliance for Open Media. 33 | * [Webp](https://developers.google.com/speed/webp/ "Webp Codec") - WebP is an image format employing both lossy[6] and lossless compression. It is currently developed by Google 34 | * [AV1](https://aomedia.org/) - 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) 35 | 36 | 2. Video Plugins: 37 | * [vid.stab](http://public.hronopik.de/vid.stab/ "vid.stab Video Plugin") - vid.stab provides a reasonably easy and flexible way to stabilize (deshake) even strongly jiggled video clips. 38 | 39 | 3. Transport Protocols 40 | * [SRT](https://www.srtalliance.org/) - 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. 41 | 42 | 4. Audio Codecs: 43 | * [FDK-AAC](https://www.iis.fraunhofer.de/en/ff/amm/impl.html "FDK-AAC Codec") - Fraunhofer's FDK AAC code provides a complete, high-quality audio compression. 44 | * [Lame MP3](http://lame.sourceforge.net/ "Lame MP3 Codec") - LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL. 45 | * [Opus](http://opus-codec.org/downloads/ "Opus Codec") - Opus is a lossy audio coding format developed by the Xiph.Org Foundation and standardized by the Internet Engineering Task Force 46 | * [Vorbis](http://www.vorbis.com/ "Vorbis Codec") - Vorbis is a free and open-source codec for lossy audio compression headed by the Xiph.Org Foundation. 47 | 48 | 5. Container Formats: 49 | * [Ogg](https://www.xiph.org/ogg/ "Ogg Container Format") - Ogg is a free, open container format maintained by the Xiph.Org Foundation. 50 | 6. Filters 51 | * [VMAF](https://github.com/Netflix/vmaf "VMAF Github Page") - VMAF is a perceptual video quality assessment algorithm developed by Netflix 52 | 53 | 54 | ### Usage Examples 55 | 56 | Please run the [compilation.sh](https://github.com/stoyanovgeorge/ffmpeg/blob/master/compilation.sh "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. 57 | 58 | In case you want to automate the installation of GIT and run the compilation script you can execute: 59 | 60 | ``` 61 | sudo apt update && sudo apt install git -y && git clone https://github.com/stoyanovgeorge/ffmpeg.git && cd ffmpeg && sh compilation.sh 62 | ``` 63 | 64 | If you want to omit the installation of some of these libraries, please comment the line in the [compilation.sh](https://github.com/stoyanovgeorge/ffmpeg/blob/master/compilation.sh "compilation.sh") script and also remove the parameter in the [ffmpeg.sh](https://github.com/stoyanovgeorge/ffmpeg/blob/master/scripts/ffmpeg.sh "ffmpeg.sh") script. 65 | 66 | 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](https://github.com/stoyanovgeorge/ffmpeg/blob/master/compilation.sh "compilation.sh") script. 67 | 68 | And in the [ffmpeg.sh](https://github.com/stoyanovgeorge/ffmpeg/blob/master/scripts/ffmpeg.sh "ffmpeg.sh") script you need to remove `--enable-libkvazaar` option. 69 | 70 | ### Bugs and Missing Features 71 | 72 | 1. Currently I am unable to compile the AV1 video codec from source. 73 | 74 | Please use [Github Issues](https://github.com/stoyanovgeorge/ffmpeg/issues "Github Issues") in case you spot a bug or have an idea how to optimize the scripts. 75 | 76 | ### External Links 77 | 78 | * [FFMPEG Generic Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Generic "FFMPEG Generic Compilation Guide") 79 | * [FFMPEG Ubuntu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu "FFMPEG Ubuntu Compilation Guide") 80 | * [FFMPEG Syntax](https://ffmpeg.org/ffmpeg-all.html "FFMPEG Syntax") 81 | * [FFMPEG Filters](https://ffmpeg.org/ffmpeg-filters.html "FFMPEG Filters") 82 | * [Comparison of Video Codecs and Containers](http://download.das-werkstatt.com/pb/mthk/info/video/comparison_video_codecs_containers.html "Video Codecs Comparison") 83 | * [List of YUV Formats](http://www.fourcc.org/yuv.php "List of YUV Formats") 84 | * [Comparison of Container Formats](http://www.digitizationguidelines.gov/guidelines/video_reformatting_compare.html "Comparison of Container Formats") 85 | * [X264 Encoding Guide](https://trac.ffmpeg.org/wiki/Encode/H.264 "X264 Encoding Guide") 86 | * [FFV1 Video Encoding](https://trac.ffmpeg.org/wiki/Encode/FFV1 "FFV1 Video Encoding") 87 | * [FFMPEG Ubuntu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu "FFMPEG Ubuntu Compilation Guide") 88 | * [Kvazaar - Open Source HEVC Encoding Library GitHub Project](https://github.com/ultravideo/kvazaar "Kvazaar GitHub") 89 | * [Kvazaar Official Webpage](http://ultravideo.cs.tut.fi/#encoder "Kvazaar Official Webpage") 90 | * [X265 Commands](http://x265.readthedocs.io/en/default/cli.html "X265 Encoding Guide") 91 | * [FFMPEG Presets Github](https://github.com/joeyblake/FFmpeg-Presets "FFMPEG Precompiled Presets") 92 | * [FFPROBE examples](http://www.bugcodemaster.com/article/use-ffprobe-obtain-information-video-files "FFPROBE examples") 93 | * [FFProbe Tips](https://trac.ffmpeg.org/wiki/FFprobeTips "FFProbe Tips") 94 | * [VP9 Compression Guide](https://sites.google.com/a/webmproject.org/wiki/ffmpeg/vp9-encoding-guide "VP9 Compression Guide") 95 | * [VP9 vs. H.264 vs. H.265 Comparison](https://blogs.gnome.org/rbultje/2015/09/28/vp9-encodingdecoding-performance-vs-hevch-264/ "VP9 vs. H.264 vs. H.265") 96 | * [VP9 Encoder Parameters](https://www.webmproject.org/docs/encoder-parameters/ "VP9 Encoder Parameters") 97 | * [VMAF](https://github.com/Netflix/vmaf "VMAF Github Page") 98 | 99 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------