[FFmpeg-user] How to resolve “ERROR: libx264 not found”?

Reindl Harald h.reindl at thelounge.net
Fri Aug 1 15:00:24 CEST 2014



Am 01.08.2014 um 14:44 schrieb David Varghese:
> Thanks for the reply .
> 
> I tried with static builds for libx264 . I edited the build script for
> libx264 and added options --enable -static , --disable -shared . After
> running the script I got libx264.a at /usr/local/lib x264(executable file)
> at /usr/local/bin and x_264.h and x_264_config.h at /usr/local/include .
>
> I modified my ffmpeg script by adding --extra-cflags='-I/usr/local/'
> --extra-ldflags='-I/usr/local/x264 -L/usr/local/ -ldl' .
> 
> But still I'm getting the error .

first now you have possibly different x264 stuff lying around
that is why i decided for /usr/local/x264 to not collide with
system packages

second you should post "ls -a" outputs instead of descriptions

below my x264 and ffmpeg configure (you need to translate the rpm macros)
AFAIK it's important to disable most stuff for a static x264 useable
to link with ffmpeg - in case of non x86_64 maybe you need to reduce
the linker flags by trial and error

./configure \
 --host=x86_64-redhat-linux \
 --prefix=%{_prefix}/local \
 --exec-prefix=%{_prefix}/local \
 --bindir=%{_prefix}/local/bin \
 --libdir=%{_prefix}/local/lib64 \
 --includedir=%{_prefix}/local/include \
 --extra-cflags="-O3 -std=c99 -fomit-frame-pointer -fno-strict-aliasing" \
 --extra-ldflags="-Wl,-z,now -Wl,-z,relro,-z,noexecstack" \
 --enable-static \
 --disable-avs \
 --disable-cli \
 --disable-ffms \
 --disable-gpac \
 --disable-lavf \
 --disable-opencl \
 --disable-swscale

./configure \
 --prefix=%{_prefix}/local \
 --bindir=%{_prefix}/local/bin \
 --datadir=%{_prefix}/local/share/ffmpeg \
 --incdir=%{_prefix}/local/include/ffmpeg \
 --libdir=%{_prefix}/local/lib64 \
 --shlibdir=%{_prefix}/local/lib64 \
 --mandir=%{_prefix}/local/man \
 --arch=x86_64 \
 --cpu=corei7 \
 --extra-cflags="-I%{_prefix}/local/x264 -O3 -fomit-frame-pointer -fno-strict-aliasing" \
 --extra-ldflags="-I%{_prefix}/local/x264 -L%{_prefix}/local/x264 -ldl -Wl,-z,now -Wl,-z,relro,-z,noexecstack" \

> On Fri, Aug 1, 2014 at 5:16 PM, Reindl Harald <h.reindl at thelounge.net>
> wrote:
> 
>>
>> Am 01.08.2014 um 13:37 schrieb David Varghese:
>>> I needed to install ffmpeg with libx264 support for enabling H.264
>> encoding
>>> . I installed libx264 successfully using the below script with toolchains
>>> available in android-ndk-r9d .
>>>
>>> Now I wanted to build ffmpeg with libx264 support .  I used the below
>>> script with --enable-libx264 , --enable-nonfree , --enable-gpl options
>>> as in the below script .
>>>
>>> But when I run the script I'm getting error "ERROR: libx264 not found" .
>>>
>>> I suppose ffmpeg is not able to figure out the installed location of
>>> libx264 . After libx264 installation I have libx264.so file in
>>> /usr/local/lib executable at /usr/local/bin and header files at
>>> /usr/local/include directories .
>>>
>>> What all changes do I need to make to the ffmpeg build script in-order to
>>> make it detect libx264?
>>
>> i build x264 a static lib below /usr/local/x264 and while
>> the rest of my ffmpeg-build is using shared libraries from
>> the default --prefix=/usr those below let the build find
>> my static x264
>>
>> --extra-cflags='-I/usr/local/x264'
>> --extra-ldflags='-I/usr/local/x264 -L/usr/local/x264 -ldl'

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140801/9dbddb5d/attachment.asc>


More information about the ffmpeg-user mailing list