[FFmpeg-user] Cannot build ffmpeg with libx264

Peterson, David J djpeter at sandia.gov
Tue Nov 14 01:07:41 EET 2017


Hello All,

Let me first say thank you in advance for the help on this.  I have been trying to compile a static install of ffmpeg support libx264 for several months now on a RHEL cluster we have and I have tried just about EVERY help forum suggestion I come across but still no luck.  The script I have been using to date is copied below.  Mostly it just clears everything out and then re-extracts and attempts to build everything necessary to function.  I don't know how I can be more explicit for where I am putting the x264 library and I can see from the config.out that it knows where libx264.a is at but it always dies and says:

collect2: error: ld returned 1 exit status
ERROR: libx264 not found

Here is the script I have been using so far.  See anything that stands out that I have wrong with this?

#!/bin/bash

export FFMPEGDIR=/place_where_it_is/ffmpeg_installation

rm -rf $FFMPEGDIR/ffmpeg_sources/yasm
rm -rf $FFMPEGDIR/ffmpeg_sources/nasm-2.13.01
rm -rf $FFMPEGDIR/ffmpeg_sources/x264
rm -rf $FFMPEGDIR/ffmpeg_sources/ffmpeg
rm -rf $FFMPEGDIR/ffmpeg_build
rm -rf $FFMPEGDIR/ffmpeg_related_bin

cd $FFMPEGDIR/ffmpeg_sources
tar -xvf nasm-2.13.01.tar.xz
tar -xvf yasm.tar.gz
tar -xvf x264.tar.gz
tar -xvf ffmpeg.tar.gz


cd $FFMPEGDIR/ffmpeg_sources/yasm
autoreconf -fiv
./configure --prefix="$FFMPEGDIR/ffmpeg_build" --bindir="$FFMPEGDIR/ffmpeg_related_bin"
make
make install
make distclean

cd $FFMPEGDIR/ffmpeg_sources/nasm-2.13.01
make clean
./configure --prefix="$FFMPEGDIR/ffmpeg_build" --bindir="$FFMPEGDIR/ffmpeg_related_bin"
make
make install

export PATH="$FFMPEGDIR/ffmpeg_related_bin:$PATH"

cd $FFMPEGDIR/ffmpeg_sources/x264
make clean
./configure --prefix="$FFMPEGDIR/ffmpeg_build" --bindir="$FFMPEGDIR/ffmpeg_related_bin" --enable-static --disable-opencl
make
make install
ldconfig

cd $FFMPEGDIR/ffmpeg_sources/ffmpeg
export PKG_CONFIG_PATH="$FFMPEGDIR/ffmpeg_build/lib/pkgconfig"
export LD_LIBRARY_PATH="$FFMPEGDIR/ffmpeg_build/lib:$FFMPEGDIR/ffmpeg_build/include:$LD_LIBRARY_PATH"
make clean
./configure --prefix="$FFMPEGDIR/ffmpeg_build" --pkg-config-flags="--static" --enable-static --extra-cflags="-I$FFMPEGDIR/ffmpeg_build/include" --extra-ldflags="-L$FFMPEGDIR/ffmpeg_build/lib" --extra-ldexeflags="-static" --bindir="$FFMPEGDIR/ffmpeg_related_bin" --enable-gpl --enable-libx264
make
make install
make distclean



Thank you again for helping with this!

David


More information about the ffmpeg-user mailing list