Necktwi
Necktwi

Reputation: 2625

How to install libavcodec and libavutil from its source in linux

FFMPEG is providing libavutil and libavcodec libraries. While compiling and installing ffmpeg as described at https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu I can find libavcodec and libavutil folders in the ffmpeg source folder. I want to install these libraries to use them in my c++ programs. But there are no Makefiles in these folders. How can I install them?

Upvotes: 1

Views: 17362

Answers (2)

Chris Slycord
Chris Slycord

Reputation: 13

Using that guide, ffmpeg is built and installed with

PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"
--prefix="$HOME/ffmpeg_build"
--extra-cflags="-I$HOME/ffmpeg_build/include"
--extra-ldflags="-L$HOME/ffmpeg_build/lib"

So, all of ffmpeg libraries get installed, but they're installed inside /home/username/ffmpeg_build/lib and /home/username/ffmpeg_build/include. As well, if you compiled this as root, I believe they would be inside /root and inaccessible to users and other programs.

And those directories are not normally included in any PATH or LD_LIBRARY_PATH, so when you try to build something that uses those libraries, it'll be unlikely to find them, unless you set LD_LIBRARY_PATH.

Upvotes: 1

Ronald S. Bultje
Ronald S. Bultje

Reputation: 11184

You simply type make install in the root (top-level) folder, which contains the install target.

Upvotes: 1

Related Questions