[FFmpeg-user] Enabling libx265

宮村 公男 xanadu at apost.plala.or.jp
Thu Apr 17 18:26:01 CEST 2014


Hello, I'm trying to build ffmpeg enabling libx265 on Mac (10.8.5 and 10.9.2)

I build x265 as following:
$ hg clone https://bitbucket.org/multicoreware/x265
$ cd x265/build/linux/
$ ./make-Makefiles.bash

at the time ccmake execute, I select "/Volumes/ffmpeg_compile" as CMAKE_INSTALL_PREFIX.

$ make && make install

As a result, I get following:
-- Install configuration: "Release"
-- Installing: /Volumes/ffmpeg_compile/lib/libx265.a
-- Installing: /Volumes/ffmpeg_compile/include/x265.h
-- Installing: /Volumes/ffmpeg_compile/include/x265_config.h
-- Installing: /Volumes/ffmpeg_compile/lib/libx265.0.9.dylib
-- Installing: /Volumes/ffmpeg_compile/lib/libx265.16.dylib
-- Installing: /Volumes/ffmpeg_compile/lib/libx265.dylib
-- Installing: /Volumes/ffmpeg_compile/lib/pkgconfig/x265.pc
-- Installing: /Volumes/ffmpeg_compile/bin/x265

Here's contents of x265.pc

prefix=/Volumes/ffmpeg_compile
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: x265
Description: H.265/HEVC video encoder
Version: 0.9
Libs: -L${libdir} -lx265
Libs.private: -lstdc++ -l/usr/lib/clang/4.2/lib/darwin/libclang_rt.osx.a
Cflags: -I${includedir}


Now I remove *.dylib files to build ffmpeg as static binary.

$ git clone git://source.ffmpeg.org/ffmpeg.git
$ cd ffmpeg
$ ./configure --as=yasm --enable-gpl --enable-libx265

then ffmpeg configure script exits with "ERROR: x265 not found" error.

then I put back  *.dylib files to /Volumes/ffmpeg_compile/lib/ directory.

Retry

$ cd ffmpeg
$ ./configure --as=yasm --enable-gpl --enable-libx265

this time ffmpeg configure script passes successfully.  So:

$ make

ffmpeg seems to build successfully, but:

$ ./ffmpeg -encoders
dyld: Library not loaded: libx265.16.dylib
  Referenced from: /Volumes/ffmpeg_compile/compile/ffmpeg/./ffmpeg
  Reason: image not found
Trace/BPT trap: 5

$ otool -L ./ffmpeg
./ffmpeg:
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.19.0)
	/System/Library/Frameworks/VideoDecodeAcceleration.framework/Versions/A/VideoDecodeAcceleration (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.8.0)
	libx265.16.dylib (compatibility version 16.0.0, current version 0.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
	/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.8.0)

This ffmpeg seems deepens on libx265.16dylib not /Volumes/ffmpeg_compile/lib/libx265.16dylib.  So I put x265.*.dylib into /usr/local/lib, then ffmpeg can execute.

$ ./ffmpeg -encoders | grep 265
ffmpeg version N-62495-g197fe39 Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 18 2014 00:37:18 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --as=yasm --enable-gpl --enable-libx265
  libavutil      52. 76.100 / 52. 76.100
  libavcodec     55. 58.103 / 55. 58.103
  libavformat    55. 37.100 / 55. 37.100
  libavdevice    55. 13.100 / 55. 13.100
  libavfilter     4.  4.100 /  4.  4.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
 V..... libx265              libx265 H.265 / HEVC (codec hevc)



As a result, I have 2 questions:
1.Why ffmpeg configure script exits with error when I try to build ffmpeg with x265.a only? (without x265.*.dylib)
2.With  x265.*.dylib, it seems ffmpeg can build, but funny dependency occur.  Is there any wrong in building x265?




More information about the ffmpeg-user mailing list