[FFmpeg-user] ffmpeg with static x264

Stefano Sabatini stefasab at gmail.com
Thu Oct 11 13:26:43 CEST 2012


On date Sunday 2012-10-07 21:42:14 +0200, Reindl Harald encoded:
> 
> 
> Am 07.10.2012 21:26, schrieb Carl Eugen Hoyos:
> > Reindl Harald <h.reindl <at> thelounge.net> writes:
> > 
> >> ../configure \
> >>  --prefix=/usr/local \
> >>  --bindir=/usr/local/bin \
> >>  --datadir=/usr/local/share/ffmpeg \
> >>  --incdir=/usr/local/include/ffmpeg \
> >>  --libdir=/usr/local/lib64 \
> >>  --mandir=/usr/local/man \
> >>  --arch=x86_64 \
> >>  --extra-cflags="-I/usr/local/includes" \
> > 
> >>  --extra-ldflags="-I/usr/local/include -L/usr/local/lib64" \
> > 
> > I know you don't care much but this looks very strange...
> 
> i do care - but i am simply a php-developer and
> not understanding what exactly looks strange
> 
> gaol if to have a static ffmpeg with static linked x264
> on fedora under /usr/local to not collide in anyway
> with rpmfusion/fedora-packages
> 
> how exactly i achieve this does not really matter for me :-)
> 
> >> ERROR: libx264 not found
> > 
> > Relevant part of config.log (NOT: config.log) missing
> 

> sorry - i am not qualified to find out what is the
> "relevant part" so excuse me to attach the compressed
> file as it is

The ending part of the file:


/usr/local/include/x264.h:36:4: warning: #warning You must include stdint.h or inttypes.h before x264.h [-Wcpp]
check_func x264_encoder_encode -lx264
check_ld cc -lx264
check_cc
BEGIN /tmp/ffconf.EteL6xpz.c
    1	extern int x264_encoder_encode();
    2	int main(void){ x264_encoder_encode(); }
END /tmp/ffconf.EteL6xpz.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I/usr/local/include -O3 -march=corei7 -mtune=corei7 -mmmx -msse2 -msse3 -msse4.1 -msse4.2 -fopenmp -mfpmath=sse -fstack-protector --param=ssp-buffer-size=4 -pipe -D_FORTIFY_SOURCE=2 -fexceptions -std=c99 -fomit-frame-pointer -pthread -I/usr/include/freetype2 -I/usr/include/opencv -I/usr/include/p11-kit-1 -I/usr/include/schroedinger-1.0 -I/usr/include/orc-0.4 -c -o /tmp/ffconf.fmO7uQrp.o /tmp/ffconf.EteL6xpz.c
gcc -I/usr/local/include -L/usr/local/lib64 -Wl,--as-needed -o /tmp/ffconf.vcjlMweM /tmp/ffconf.fmO7uQrp.o -lx264 -lvpx -lvpx -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lschroedinger-1.0 -lrtmp -lz -lgnutls -lopenjpeg -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -lmp3lame -lgsm -lfreetype -lfaac -lm -pthread -lbz2 -lz -lrt
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x88): undefined reference to `XAllocSizeHints'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x19d): undefined reference to `XCreateWindow'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x1c2): undefined reference to `XSelectInput'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x1e9): undefined reference to `XSetStandardProperties'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x1f8): undefined reference to `XMapWindow'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x210): undefined reference to `XNextEvent'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x256): undefined reference to `XSetStandardProperties'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x26b): undefined reference to `XResizeWindow'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x27c): undefined reference to `XSync'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x284): undefined reference to `XFree'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_init_window':
(.text+0x2da): undefined reference to `XCreateColormap'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_setcolor':
(.text+0x392): undefined reference to `XAllocNamedColor'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_setcolor':
(.text+0x3ab): undefined reference to `XSetForeground'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_gray':
(.text+0x459): undefined reference to `XCreateImage'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_gray':
(.text+0x5c4): undefined reference to `XPutImage'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_gray':
(.text+0x601): undefined reference to `XPutImage'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_gray':
(.text+0x61a): undefined reference to `XSync'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_gray':
(.text+0x64d): undefined reference to `XOpenDisplay'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_line':
(.text+0x886): undefined reference to `XDrawLine'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_rect':
(.text+0x8dc): undefined reference to `XDrawRectangle'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_sync':
(.text+0x34d): undefined reference to `XSync'
/usr/local/lib64/libx264.a(display-x11.o): In function `disp_point':
(.text+0x834): undefined reference to `XDrawPoint'
collect2: error: ld returned 1 exit status
ERROR: libx264 not found

So apparently libx264 is being fancy and including other libraries,
and since it doesn't provide a .pc file (doesn't it?, or
ffmpeg/configure doesn't use it) there is no way to tell which
libraries it uses and fails with static linking. As a workaround you
can try to disable the foreign components (display-x11) in your
libx264 build.

> 
> as said: if i build x624 in /usr/local with --enable-shared
> from the same source without any other change ffmpeg builds
> but links dynamically resulting in a dependency to lib264.so
> instead of static linked x264
-- 
ffmpeg-user random tip #21
Create a video from a single image:
ffmpeg -loop_input -f image2 -i image.jpeg -t 20 image-movie.mpeg


More information about the ffmpeg-user mailing list