I have a question about installing libx264.

Asked 2 years ago, Updated 2 years ago, 71 views

I checked the ffmpeg encoding as not found libx264, but it wasn't in /usr/lib/, so I tried to install it, but I couldn't do it many times, so I asked this question.
I downloaded x264 on git clone and compiled it.

  • Downloading x264 on the git clone
  • Run configure in the x264 directory
  • Then do make and make install

However, after doing the above, x264 was added to /usr/local/bin/ instead of /usr/lib/.
Is this the wrong installation?
Also, even if I can install libx264, can I use ffmpeg right away?
Do I need to compile ffmpeg again after I put it in?

Thank you for your cooperation.

Additional information

The operating system I use is raspbian.
configure results are

 platform:ARM
byte order —Little-endian
system:LINUX
cli —Yes
libx264—internal
shared —no
static —no
asm —Yes
interlaced —Yes
avs —avxsynth
lavf —Yes
ffms —no
mp4 —no
gpl:yes
thread —posix
opencl:yes
filters —resize crop select_every 
debug: no
gprof —no
strip —no
PIC: no
bit depth —8
chroma format —all

It came out like this.
The results of the make are as follows.

rm-f libx264.a
ar rc libx264.a  common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o common/dct.o common/cpu.o common/cabac.o common/common.o common/osdep.o common/rectangle.o common/set.o common/quant.o common/deblock.o common/vlc.o common/mvpred.o common/bitstream.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/lookahead.o common/threadpool.o common/arm/mc-c.o common/arm/predict-c.o common/opencl.o encoder/slicettype-cl.o common/arm/cpu-a.o common/a common/a common.a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common/a common.
runlib libx264.a
gcc -o x264  x264.o input/input.o input/timecode.o input/raw.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o output/flv.o output/flv_bytestream.o filters/filters.o filters/video/video.o filters/video/source.o filters/video/internal.o filters/video/resize.o filters/video/cache.o filters/video/fix_vfr_pts.o filters/video/select_every.o filters/video/crop.ofilters/video/depth.o input/avs.o input/thread.o input/lavf.olibx264.a-ldl-L.-pthread-L/usr/local/lib-lavformat-lavcodec-lxcb-lX11-lasound-lSDL-lz-lswresample-luvr-luvr-luvr-luvrull/luvrull/luvrull

raspberry-pi ffmpeg raspbian

2022-09-30 14:23

1 Answers

I tried configure, make, and make install.

However, this was not found in /usr/lib/ and only added x264 to /usr/local/bin/.

The configure option does not have --enable-shared so only the execution commands are built.
Specify --prefix=/usr if you want to change the installation location.

Also, even if I can install libx264, can I use ffmpeg right away?
Do I need to compile ffmpeg again after I put it in?

It's a shared library, so I think it's okay.
However, you can't try it, so please check it yourself.

How to verify the configure option

configure has options, so check the options you need as follows:

$./configure --help

Is there an option around here?

--prefix=PREFIX install architecture-independent files in PREFIX [/usr/local]

  -- enable-shared build shared library

In my environment, I also needed the following options:

 --disable-asm disable platform-specific assembly optimizations

configure Example

$./configure--prefix=/usr/local--enable-shared--disable-asm
Warning:libavformat is not supported without swscale support
platform —X86_64
byte order —Little-endian
system:LINUX
cli —Yes
libx264—internal
shared —Yes
static —no
asm —no
interlaced —Yes
avs —avxsynth
lavf —no
ffms —no
mp4 —no
gpl:yes
thread —posix
opencl:yes
filters —crop select_every
debug: no
gprof —no
strip —no
PIC:yes
bit depth —8
chroma format —all

You can run 'make' or 'make fprofiled' now.

make&make install Example

$make
cat common/opencl/x264-cl.h common/opencl/bidir.cl common/opencl/downscale.cl common/opencl/intra.cl common/opencl/motionsearch.cl common/opencl/weightp.cl common/opencl/subpel.cl |./tools/cltostr.sh common/oclobj.h
dependency file generation...
(omitted)

$ sudo make install
install-d/usr/local/bin
install x264/usr/local/bin
install-d/usr/local/include
install-d/usr/local/lib
install-d/usr/local/lib/pkgconfig
install-m644./x264.h/usr/local/include
install-m644 x264_config.h/usr/local/include
install-m644 x264.pc/usr/local/lib/pkgconfig
ln-f-s libx264.so.148/usr/local/lib/libx264.so
install-m755 libx264.so.148/usr/local/lib

Verifying installation destinations

$ls-l/usr/local/lib
1052 in total
lrwxrwxrwx.1 root root14 October 5 12:23 2015 libx264.so ->libx264.so.148
-rwxr-x.1 root root 1071160 October 5 12:23 2015 libx264.so.148
drwxr-xr-x.2 root root 4096 October 5 12:34 2015 pkgconfig


2022-09-30 14:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.