Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install libx265 for ffmpeg on Mac OSX

I have tried multiple guides here (search for "Building libx265") and here with no success. Both times I made sure I uninstalled ffmpeg first, went through the guides, then ran

brew install ffmpeg --with-fdk-aac --with-freetype --with-libass --with-libvpx --enable-libx265

No matter what when I go to run a command like

ffmpeg -i source.mkv -c:v libx265 test1.mkv

I get the error:

Unknown encoder 'libx265'

Has anyone had success building libx265 for use with ffmpeg on OSX and can you please share how you did it?

P.S. I am running OSX 10.11.3

like image 761
Spencer Avatar asked Mar 20 '16 19:03

Spencer


People also ask

Where is ffmpeg path on Mac?

In Terminal, navigate to the folder containing the ffmpeg file using the "cd" (change directory) command. Type "cd" followed by the file path to your Downloads folder. For example, the path on my system is "/Users/aaron/Downloads".

Does ffmpeg work on Mac?

There are a few ways to get FFmpeg on macOS: Use a package manager like ​Homebrew or ​MacPorts to install ffmpeg . These will automatically keep your FFmpeg installation up-to-date. See the Homebrew section and the MacPorts section below for more info.


2 Answers

Seems like you can't just do brew install ffmpeg --with-x265 anymore (this is Oct 2019). What worked for me is this:

brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg

This is from https://github.com/homebrew-ffmpeg/homebrew-ffmpeg. It says the default already includes x265, but you can then optionally pass some arguments like

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-xvid --with-fdk-aac

You can take a look at what options are available by doing

brew options homebrew-ffmpeg/ffmpeg/ffmpeg
like image 74
Jack Avatar answered Oct 03 '22 19:10

Jack


Try using --with-x265 instead of --enable-libx265 as described in the official FFmpeg wiki. https://trac.ffmpeg.org/wiki/CompilationGuide/MacOSX

Those guides you linked to are not specifically for homebrew, which is why they used --enable instead of --with.

like image 35
Tandy Freeman Avatar answered Oct 03 '22 19:10

Tandy Freeman