Converting/Encoding x265 under Mac OS X with FFmpeg

Suppose that we have our brew up and running and we’d like to do some video conversion, namely something to x265. To do this, first it is advisable to install ffmpeg using brew by issuing the following command:

brew install ffmpeg --with-faac --with-fdk-aac --with-x265

Should this not work for whatever reason, try installing the base package and then reconfigure it using these commands:

brew install ffmpeg
brew reinstall ffmpeg --with-faac --with-fdk-aac --with-x265

After it has finished, the only thing we need to do is to start the conversion itself. This example will take input.mp4 and downscale it to X:720 size with the medium preset, meaning that the width will be scaled down proportionally to the height, which we have fixed at 720p. Other valid presets are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.

ffmpeg -i input.mp4 -vf scale=-1:720 -c:v libx265 -preset medium -x265-params crf=28 -c:a aac -strict experimental -b:a 128k output.mp4

Word of advice: always do lenghty jobs in a terminal screen!

Thanks for reading! Please consider Buying me a Coffee or checking out Colibri!