How to install libx265 for ffmpeg on Mac OSX
Asked Answered
W

2

16

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

Wiburg answered 20/3, 2016 at 19:47 Comment(0)
C
17

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.

Carminacarminative answered 20/3, 2016 at 19:56 Comment(3)
Bah, of course it would be that simple. Thanks so much!Wiburg
I had the exact same issue a while back when learning to use homebrew.Carminacarminative
This doesn't seem to work anymore, see Jack's answer below.Raoul
C
25

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
Clinkerbuilt answered 20/10, 2019 at 7:40 Comment(1)
Thank you! As of 12/4/19, option flags still don't seem to be working with standard brew install ffmpegOverage
C
17

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.

Carminacarminative answered 20/3, 2016 at 19:56 Comment(3)
Bah, of course it would be that simple. Thanks so much!Wiburg
I had the exact same issue a while back when learning to use homebrew.Carminacarminative
This doesn't seem to work anymore, see Jack's answer below.Raoul

© 2022 - 2024 — McMap. All rights reserved.