# How to install libav devel packages properly?

There are no devel packages for avformat etc. I tried to install ffmpeg-devel, but that does not help. It installs all libav headers into /usr/include/ffmpeg/libavXXX/. But even the headers in there refer to the location /usr/include/libavXXX. Which is ridiculous and leads to compiling errors like

/usr/include/ffmpeg/libavformat/avformat.h:203:32: fatal error: libavcodec/avcodec.h: No such file or directory
#include "libavcodec/avcodec.h"


(I need it because I want to compile some software that needs libav headers. I changed the location of the include from #include <libavformat/avformat.h> to #include <ffmpeg/libavformat/avformat.h>, which gave me finally the error above)

edit retag close merge delete

Sort by » oldest newest most voted

@fast_rizwaan symlinks is a very poor idea.

As said FranciscoD, pkg-config is always the proper way to go.

$PKG_CONFIG_PATH=/usr/lib64/ffmpeg-compat/pkgconfig pkg-config --cflags libavcodec -I/usr/include/ffmpeg-compat  more I suspect you need ffmpeg-compat-devel $ rpm -qlp ffmpeg-compat-devel-0.6.6-9.fc19.x86_64.rpm /usr/include/ffmpeg-compat /usr/include/ffmpeg-compat/libavcodec /usr/include/ffmpeg-compat/libavcodec/avcodec.h /usr/include/ffmpeg-compat/libavcodec/avfft.h 

Hope that helps.

more

i think this solution will not improve anything, because still the headers are not directly in /usr/include/libavXXX, but in /usr/include/ffmpeg-compat. This resembles the setup of ffmpeg-devel. Just in yet another folder

( 2013-09-06 04:33:21 -0500 )edit

Ideally, the includes should only have the last required part. So, if the headers are located in /usr/share/include/xxx/yyy, the include statement should be #include <xxx/yyy>. If the include statement just goes #include <yyy>, you'll have to append the compiler command line to include the /usr/share/include/xxx/ directory to the list of directories to be searched for headers, using the -I flag that gcc provides, like this: CFLAGS+=-I/usr/share/include/xxx or CFLAGS+=-I\$INCLUDE_DIR/xxx. It's just an example, you might have to make a different change in your case.

This stuff is supposed to be handled by pkg-config. pkg-config --cflags should give the correct location of headers, and pkg-config should be used in the build system.

Compiling from source is not meant to be simple. More often than not tiny tweaks to the build parameters must be made, since different upstreams follow different standards and conventions.

more

Oh, and the packages are installed correctly. Your build parameters need modification as I've written above.

( 2013-09-05 20:09:22 -0500 )edit

sudo ln -sf /usr/include/ffmpeg-compat/* /usr/include/

Update: ./configure CPPFLAGS='-I/usr/include/ffmpeg'

**better use ffmpeg 2 than ffmpeg-compat unless really needed

rpm -ql ffmpeg-devel /usr/include/ffmpeg /usr/include/ffmpeg/libavcodec /usr/include/ffmpeg/libavcodec/avcodec.h

more