Ask Your Question
3

How to install libav devel packages properly?

asked 2013-09-05 08:35:12 -0500

groakat gravatar image

updated 2013-09-05 20:00:48 -0500

FranciscoD_ gravatar image

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 flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2013-10-17 08:58:57 -0500

remi gravatar image

updated 2013-10-17 09:01:02 -0500

@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
edit flag offensive delete link more
0

answered 2013-09-05 12:17:36 -0500

nonamedotc gravatar image

updated 2013-09-05 12:19:49 -0500

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.

edit flag offensive delete link more

Comments

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

groakat gravatar imagegroakat ( 2013-09-06 04:33:21 -0500 )edit
0

answered 2013-09-05 20:07:12 -0500

FranciscoD_ gravatar image

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.

edit flag offensive delete link more

Comments

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

FranciscoD_ gravatar imageFranciscoD_ ( 2013-09-05 20:09:22 -0500 )edit
0

answered 2013-10-17 00:33:56 -0500

fast_rizwaan gravatar image

updated 2013-11-24 02:24:53 -0500

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

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-05 08:35:12 -0500

Seen: 18,098 times

Last updated: Nov 24 '13