You can find FFMpeg compilation instructions from https://trac.ffmpeg.org/wiki/CompilationGuide
If you can't find a pre-built version of FFMpeg, you'll have to compile it from the source. By using the above link, you'll be getting the latest snapshot and it may not be the version you want. If you need to compile a specific version, follow the instructions below.
Pick the correct version you need from https://git.ffmpeg.org/ffmpeg
On the guide, follow all instructions upto 'FFMpeg' section, then instead of the snapshot build, switch to the version needed. (Using v4.3 on the example below)
cd ~/ffmpeg_sources
git clone https://git.ffmpeg.org/ffmpeg.git
cd ffmpeg
git checkout origin/release/4.3
git switch -c release/4.3
git branch --set-upstream-to=origin/release/4.3
git pull --rebase
git describe HEAD
// (optional) change TMPDIR if required
export TMPDIR=~/tmpdir
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --extra-libs=-lpthread --extra-libs=-lm --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
make
make install
hash -d ffmpeg
ffmpeg -version
If you follow the instructions above, you'll get an automated version number, such as n4.3.1-14-ga15a3318e1
. If you need to get a semvar version number, such as 4.3.1
then do the following.
Go to the ffmpeg source folder and run
ffbuild/version.sh ./ VERSION
Then open the VERSION
file generated, and edit the version number as required.