x265 not found using pkg-config

Issue #503 new
timgogo created an issue

At frist, I have a project with ffmpeg build with x264,

Now, I want add the x265 support.

I has compiled the x265 with make & make install like this:

[ 81%] Built target x265-static
[100%] Built target cli
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/lib/libx265.a
-- Up-to-date: /usr/local/include/x265.h
-- Up-to-date: /usr/local/include/x265_config.h
-- Up-to-date: /usr/local/lib/pkgconfig/x265.pc
-- Up-to-date: /usr/local/bin/x265

ant then, run the shell like:

make distclean 

NDK_PATH=$NDK_HOME
NDK_ARM_PATH=${NDK_PATH}/platforms/android-9/arch-arm
NDK_ARM_BIN_PATH=${NDK_PATH}/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin

CC=${NDK_ARM_BIN_PATH}/arm-linux-androideabi-gcc

chmod +x configure
chmod +x version.sh

if [ $APP_ABI = "armeabi-v7a" ]; then
LOCAL_CFLAGS="-O3 -DANDROID -fpic -I/usr/local/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
ABLES="--enable-asm --enable-thumb --enable-hwaccels --cpu=armv7-a --enable-neon"
elif [ $APP_ABI = "armeabi" ]; then
LOCAL_CFLAGS="-O3 -DANDROID -fpic -I/usr/local/include"
ABLES="--disable-neon"
fi
echo $LOCAL_CFLAGS
echo $ABLES
echo $PKG_CONFIG_PATH

echo "开始configure"
./configure \
--disable-yasm \
--disable-debug \
--disable-doc \
--disable-ffmpeg \
--disable-ffprobe \
--disable-ffplay \
--disable-ffserver \
--disable-stripping \
--disable-avdevice \
--disable-postproc \
--disable-network \
--enable-pthreads \
--enable-small \
--disable-encoders \
--enable-encoder=libx264 \
--enable-encoder=libfdk_aac \
--enable-libx265 \
--pkg-config-flags="--static" \
--enable-encoder=gif \
--enable-libx264 \
--enable-libfdk_aac \
--disable-decoders \
--enable-decoder=h264 \
--enable-decoder=aac \
--enable-decoder=mpeg4 \
--enable-decoder=mpegvideo \
--disable-parsers \
--enable-parser=mpeg4video \
--enable-parser=mpegaudio \
--enable-parser=mpegvideo \
--enable-parser=ac3 \
--enable-parser=h261 \
--enable-parser=h264 \
--enable-parser=vc1 \
--enable-muxers \
--enable-muxer=mp4 \
--enable-muxer=h264 \
--enable-muxer=mpeg2video \
--enable-muxer=mov \
--disable-demuxers \
--enable-demuxer=aac \
--enable-demuxer=h264 \
--enable-demuxer=mov \
--enable-demuxer=mpegvideo \
--enable-demuxer=m4v \
--enable-demuxer=vc1 \
--disable-protocols \
--enable-protocol=file \
--disable-indevs \
--enable-indev=v4l \
--enable-indev=v4l2 \
--disable-bsfs \
--enable-nonfree \
--enable-static \
--enable-gpl \
--enable-pic \
--enable-cross-compile \
--arch=arm \
--enable-demuxer=concat \
--enable-protocol=concat \
--enable-decoder=mjpeg \
--enable-encoder=mjpeg \
--enable-parser=mjpeg \
--enable-decoder=png \
--enable-parser=png \
--enable-encoder=png \
--enable-demuxer=apng \
--enable-demuxer=image_jpeg_pipe \
--enable-demuxer=image_png_pipe \
--enable-demuxer=mpegts \
--enable-demuxer=mp3 \
--enable-decoder=mp3 \
--enable-bsf=aac_adtstoasc \
--enable-bsf=h264_mp4toannexb \
$ABLES \
--target-os=linux \
--extra-cflags="${LOCAL_CFLAGS}" \
--extra-ldflags='-L${NDK_ARM_PATH}/usr/lib -lc -lm -ldl -llog -L/usr/local/lib' \
--cross-prefix=${NDK_ARM_BIN_PATH}/arm-linux-androideabi- \
--sysroot=${NDK_ARM_PATH}

echo "开始make"
make -j4

echo "开始install"
sudo make install

It is has an error.

-O3 -DANDROID -fpic -I/usr/local/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon
--enable-asm --enable-thumb --enable-hwaccels --cpu=armv7-a --enable-neon
/usr/local/lib/pkgconfig
开始configure
ERROR: x265 not found using pkg-config

look the config.log

use_pkg_config x265 x265.h x265_api_get
check_pkg_config x265 x265.h x265_api_get
false --exists --print-errors x265
ERROR: x265 not found using pkg-config

but, the file of x265.pc has exist in the path:

It’s content is:

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: x265
Description: H.265/HEVC video encoder
Version: 0.0
Libs: -L${libdir} -lx265
Libs.private: -lstdc++ -lm -lgcc -ldl -lgcc -ldl
Cflags: -I${includedir}

and the x265.h in the include path too.

and then I run

pkg-config --list-all

It is also find x265

TIMWEILIU-MC0:libSrc timweiliu$ pkg-config --list-all
libecpg_compat libecpg_compat - PostgreSQL libecpg_compat library
fdk-aac        Fraunhofer FDK AAC Codec Library - AAC codec library
apr-1          APR - The Apache Portable Runtime library
apr-util-1     APR Utils - Companion library for APR
libpq          libpq - PostgreSQL libpq library
libpcre        libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
libpgtypes     libpgtypes - PostgreSQL libpgtypes library
libecpg        libecpg - PostgreSQL libecpg library
x264           x264 - H.264 (MPEG4 AVC) encoder library
x265           x265 - H.265/HEVC video encoder
libpcreposix   libpcreposix - PCREPosix - Posix compatible interface to libpcre
libiodbc       iODBC - iODBC Driver Manager

Now, I don’t know why dose not it work.

Is someone help me fix it?

Comments (3)

  1. Log in to comment