0

On OSX Yosemite I'm trying to build FFmpeg with freetype library included ( I need it for drawtext filter ). Unfortunately I cannot configure ffmpeg properly and every try ends with "freetype not found" error.

  1. Building plain FFmpeg-2.5.3 without freetype works perfectly well (followed this tutorial)
  2. Building Freetype-2.5.3 also works fine (followed this tutorial)
  3. Included extra library locations, where built freetype is located,

like this:

--extra-ldflags="-L$PREFIX/lib" 
--extra-cflags="-I$PREFIX/include -I$PREFIX/include/freetype2"
  1. ./build_android.sh ends up with ERROR: freetype2 not found

build_android.sh:

#!/bin/bash
NDK=$HOME/Desktop/adt/android-ndk-r10d
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
function build_one
{
./configure \
 --prefix=$PREFIX \
 --enable-shared \
 --disable-static \
 --enable-libfreetype \
 --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
 --target-os=linux \
 --arch=arm \
 --enable-cross-compile \
 --sysroot=$SYSROOT \
 --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
 --extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}

CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm -I$PREFIX/include"
ADDI_LDFLAGS="-L$PREFIX/lib"
build_one

Last 3 lines of config.log :

require_libfreetype
false --exists --print-errors freetype2
ERROR: freetype2 not found

Thanks in advance ( and sorry for my poor english )

PS: I've checked patch sources in guardian-project and I've found this:

# this is a fake pkg-config since ffmpeg requires pkg-config if you want to
# include external libraries like libfreetype or libass.  The Android NDK does
# not provide any kind of pkg-config.

Does it mean I have to move to Linux ? Isn't pkg-config installed on OSX ?

algakzru$ pkg-config --version
0.28

1 Answer 1

0

I got this to work with the guardian project version of ffmpeg build (for a command line output). See my fork here:

https://github.com/touchlab/android-ffmpeg

Essentially, you need to get the ffmpeg configure to use the fake-pkg-config, and modify that to look at param 3 instead of param 2 (which is in my fork). There are a few instructions at the top of the forked version. I just ran a test build, and according to that, you can ignore the part about fixing the comments in ffmpeg/libavutil/arm/intmath.h. Just do the ffmpeg/configure change.

Originally, the ffmpeg/configure change was done with a patch in config_ffmpeg.sh, but I removed the patches entirely, and didn't make a new one. The patches were no longer valid after updating the submodule versions.

Also, for reference, I'm using ndk r10c version.

ffmpeg, freetype2, and x264 should all be master as of today (2/8/2015). I may eventually pin them to a version, but its not very high on my priority list, so...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .