[FFmpeg-devel] Slight x265 encoder build bug in OSX + workaround

David Favor david at davidfavor.com
Thu Apr 3 16:21:12 CEST 2014


David Favor wrote:
> Hanspeter Niederstrasser wrote:
>> David Favor wrote:
>>
>>> There's a subtle library path problem building on OSX.
>>>
>>> The library path for x265 is empty, where all other libraries
>>> have their full path set. This causes a runtime error.
>>>
>>> So...
>>>
>>> David-Favor-iMac> which ffmpeg
>>> /david-favor-tools/osx-10.9/bin/ffmpeg
>>>
>>> David-Favor-iMac> ffmpeg -codecs | grep 26[45]
>>> dyld: Library not loaded: libx265.13.dylib
>>>    Referenced from: /david-favor-tools/osx-10.9/bin/ffmpeg
>>>    Reason: image not found
>>>
>>> David-Favor-iMac> otool -L /david-favor-tools/osx-10.9/bin/ffmpeg | 
>>> grep x26[45]
>>>     libx265.13.dylib (compatibility version 13.0.0, current version 
>>> 0.8.0)
>>>     /david-favor-tools/osx-10.9/lib/libx264.142.dylib (compatibility 
>>> version 0.0.0, current version 0.0.0)
>>
>> This is not an ffmpeg bug.  Your libx265 library is misbuilt.
>> Whatever method x265 is using to set -install_name is incorrect (if
>> it's even being used) and not giving an appropriate path to the
>> install location of the library.
> 
> I'll look further then.

Since others may hit this problem, here's a work around to correctly
set the OSX -rpath equivalent in the target shared object file.

At the end of the x265 build process, execute this command...

     install_name_tool -id $PREFIX/lib/$dylib $dylib

Where $dylib is the dynamic library generated during build, something like...

     libx265.13.dylib

The man page for install_name_tool leaves much to be desired. The -add_rpath
option does nothing. The -id option does the trick.


More information about the ffmpeg-devel mailing list