ayyi / samplecat

SampleCat is a a program for cataloguing and auditioning audio samples.
http://ayyi.github.io/samplecat/
GNU General Public License v3.0
54 stars 5 forks source link

Add /usr/include/ffmpeg to gcc -I flags #57

Closed fpesari closed 3 years ago

fpesari commented 3 years ago

Hello,

I am trying to make a samplecat package for openSUSE but it fails to build because when libavformat/avformat.h is included, it is not found since on openSUSE the file is in /usr/include/ffmpeg/libavformat/avformat.h (source). Rather than change the #includes, which would affect all users, I think it's best to add -I/usr/include/ffmpeg so that samplecat compiles on openSUSE as well.

ayyi commented 3 years ago

Hi, thanks for taking the time to raise an issue.

I am not sure which version of Opensuse you are using. I just tried with the latest Leap and it looks like the version of libavfilter is too old.

On your machine, what is the output of

pkg-config libavfilter --modversion

Samplecat needs it to be > 7.0

Regards

fpesari commented 3 years ago

Hello,

apologies, it's openSUSE Tumbleweed, so a rolling distro which usually has the latest versions of everything.

$ pkg-config libavfilter --modversion
7.110.100

$ pkg-config libavformat --modversion
58.76.100
ayyi commented 3 years ago

Ok, great.

I am unable to test Tumbleweed as there seems to be some issue with the Opensuse Docker image.

Please can you give us the output of

cat config.log | grep -i ffmpeg

Also please could you post the build error.

Thanks

fpesari commented 3 years ago

This is the output you requested:

configure:18050: checking for FFMPEG
configure:22521: result:   ffmpeg decoder:             yes
ac_cv_env_FFMPEG_CFLAGS_set=
ac_cv_env_FFMPEG_CFLAGS_value=
ac_cv_env_FFMPEG_LIBS_set=
ac_cv_env_FFMPEG_LIBS_value=
pkg_cv_FFMPEG_CFLAGS='-I/usr/include/ffmpeg '
pkg_cv_FFMPEG_LIBS='-lavformat -lavcodec -lavutil -lavfilter '
ENABLE_FFMPEG_FALSE='#'
ENABLE_FFMPEG_TRUE=''
FFMPEG_CFLAGS='-I/usr/include/ffmpeg '
FFMPEG_LIBS='-lavformat -lavcodec -lavutil -lavfilter '
#define HAVE_FFMPEG 1

This is the build error:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Waveform\" -D_FILE_OFFSET_BITS=64 -DPACKAGE_DATA_DIR=\"/usr/local/share\" -I/usr/local/include -I.. -I../lib -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g -O2 -O2 -DNDEBUG -MT peakgen.lo -MD -MP -MF .deps/peakgen.Tpo -c peakgen.c  -fPIC -DPIC -o .libs/peakgen.o
peakgen.c:236:10: fatal error: libavformat/avformat.h: No such file or directory
  236 | #include "libavformat/avformat.h"
ayyi commented 3 years ago

Thanks for the info. The cause of the problem is now clear. We need to add $(FFMPEG_CFLAGS) to AM_CFLAGS for certain directories such as lib/waveform/wf/.

I will attempt again to get a Tumbleweed Docker image working in order to make sure all the missing instances are found.

Regards

ayyi commented 3 years ago

I believe compilation on Opensuse should be fixed now.

As you suggested, ffmpeg includes were added for two directories.

Please let us know if you are still seeing problems.

Thanks

fpesari commented 3 years ago

Hello,

thanks! It does work but it also installs a file in /etc/blah/All.yaml

ayyi commented 3 years ago

Thanks for pointing that out. It has now been removed.

ayyi commented 3 years ago

Please reopen the ticket if not resolved. Thanks for your help