I had to build FFmpeg with x264 support on macO statically, so I had to look around for a bunch of scattered commands. This is why I thought I should gather them up into a single post for easier reference later on. Here’s the result.
Start by getting x264 source codes, configuring and then building them. Here is what you need to run from Terminal:
git clone https://code.videolan.org/videolan/x264.git
./configure --disable-asm --enable-static
sudo make install
Now, download FFmpeg source codes from the following link and extract them somewhere on your computer.
https://ffmpeg.org/download.html
The last think you need to do, is to configure and build it. Here is how:
./configure --enable-static --disable-shared --disable-debug --disable-doc --disable-x86asm --enable-gpl --enable-libx264 --prefix=/Users/someuser/ffmpeg-install
make install
Obviously you can modify the parameters above as it fits your needs. After the build completes, you’ll end up with the binaries inside ffmpeg-install folder (provided to the prefix parameter in configure) .