ffmpeg doesn't work like that. You can't really just install arbitrary encoders and expect it to use them.
Several options
If you want a specific set of encoders you will have to either:
- compile ffmpeg, or
- find a different ffmpeg build that supports your wanted encoders, or
- use an alternative encoder that your ffmpeg already supports.
ffmpeg
Compiling
Because libfdk_aac is considered non-free, and therefore incompatible with the GPL, it is unlikely that you will find any existing ffmpeg builds supporting it being distributed, so you will have to compile. There is a guide you can follow that will do just that and it will include support for libfdk_aac and libx264:
FFmpeg Wiki: Compile FFmpeg on Ubuntu
Download a compiled ffmpeg and/or use a different encoder
If you are willing to use the native FFmpeg AAC encoder (-c:a aac
) instead of libfdk_aac, then just use ffmpeg from the repository or even better is to download a recent version.
The ffmpeg from the 16.04 repository is quite old, but it should support libx264 by default, so you must be using a version that is not from the repository.
But I want all encoders
FFmpeg has many built-in ("native") encoders and most get compiled by default, but it also support many external encoders. If you want all of them then you will have to individually enable all of the supported external libraries when running configure
during compilation. There are many external libraries and each one needs the proper header files, so you will have to find out which library needs which -dev package. For example, to use --enable-libx264
you need the libx264-dev package to be installed first.
This would be a waste of time. Nobody needs all encoders, and some are not relevant or useful. Just enable the ones you need.