This build script provides a basic build of ffmpeg to include x264, x265 and Fraunhofer FDK AAC codecs.
Copy the build_ffmpeg.sh script to a temp location on your Ubuntu/linux installation and run sh build_ffmpeg.sh
or chmod +x build_ffmpeg.sh
and then ./build_ffmpeg.sh