Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for libswresample as we have libavresample #321

Closed
rgonnering opened this issue Nov 19, 2015 · 30 comments
Closed

Remove support for libswresample as we have libavresample #321

rgonnering opened this issue Nov 19, 2015 · 30 comments
Labels
Milestone

Comments

@rgonnering
Copy link

I've installed all of the dependencies that I can uncover, and when I do:
$ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptest

I get:
Setting top to : /home/roger/AudioSignalProcessing/essentia-2.0.1
Setting out to : /home/roger/AudioSignalProcessing/essentia-2.0.1/build
→ configuring the project in /home/roger/AudioSignalProcessing/essentia-2.0.1
→ Building in release mode
Checking for 'g++' (c++ compiler) : /usr/bin/g++
Checking for 'gcc' (c compiler) : /usr/bin/gcc
Checking for program pkg-config : /usr/bin/pkg-config
Checking for 'libavcodec' : yes
Checking for 'libavformat' : yes
Checking for 'libavutil' : yes
Checking for 'libswresample' : yes
Checking for 'taglib' : yes
Checking for 'yaml-0.1' : yes
Checking for 'fftw3f' : yes
Checking for 'samplerate' : yes
Checking for 'gaia2' : yes
Checking for program python : /usr/bin/python
Checking for python version : (2, 7, 6, 'final', 0)
Checking for library python2.7 in LIBDIR : yes
Checking for program /usr/bin/python-config,python2.7-config,python-config-2.7,python2.7m-config : /usr/bin/python-config
Checking for header Python.h : yes
================================ CONFIGURATION SUMMARY

  • FFmpeg / libav detected!
    The following algorithms will be included: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']
  • libsamplerate (SRC) detected!
    The following algorithms will be included: ['Resample']
  • TagLib detected!
    The following algorithms will be included: ['MetadataReader']
  • Gaia2 detected!
    The following algorithms will be included: ['GaiaTransform']

    'configure' finished successfully (1.766s)

But when I do:
$ ./waf

I get a bunch of errors. Some are below and all seem to bee related:
../src/essentia/utils/audiocontext.cpp: In member function ‘int essentia::AudioContext::create(const string&, const string&, int, int, int)’:
../src/essentia/utils/audiocontext.cpp:107:10: error: ‘CODEC_ID_PCM_S16LE’ was not declared in this scope
case CODEC_ID_PCM_S16LE:
^
../src/essentia/utils/audiocontext.cpp:108:10: error: ‘CODEC_ID_PCM_S16BE’ was not declared in this scope
case CODEC_ID_PCM_S16BE:
^
../src/essentia/utils/audiocontext.cpp:109:10: error: ‘CODEC_ID_PCM_U16LE’ was not declared in this scope
case CODEC_ID_PCM_U16LE:
^
../src/essentia/utils/audiocontext.cpp:110:10: error: ‘CODEC_ID_PCM_U16BE’ was not declared in this scope
case CODEC_ID_PCM_U16BE:
^
and I end up with:
Build failed
-> task in 'essentia' failed (exit status 1): ...

Can anyone help? I am using Ubuntu 14.04.

@dbogdanov
Copy link
Member

There were some compatibility issues with Ubuntu 14.04 that were fixed in the 2.0.1 branch. It is written in the notes for the 2.0.1 release.

You can install from that branch, but for more updates use 2.1_beta2 release instead.

@rgonnering
Copy link
Author

Thanks for your help.
2.01 is the branch I am using, and is the one with the reported problems.
I'll try 2.1 beta2.

@rgonnering
Copy link
Author

I tried 2.1 beta 2. The results are the same as before.

$ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests
Again, shows that everything is present.

$ ./waf
Again, fails the same way:
[ 24/316] cxx: src/essentia/utils/audiocontext.cpp -> build/src/essentia/utils/audiocontext.cpp.1.o
../src/essentia/utils/audiocontext.cpp: In member function ‘int essentia::AudioContext::create(const string&, const string&, int, int, int)’:
../src/essentia/utils/audiocontext.cpp:107:10: error: ‘CODEC_ID_PCM_S16LE’ was not declared in this scope
case CODEC_ID_PCM_S16LE:
^
../src/essentia/utils/audiocontext.cpp:108:10: error: ‘CODEC_ID_PCM_S16BE’ was not declared in this scope
case CODEC_ID_PCM_S16BE:
^
../src/essentia/utils/audiocontext.cpp:109:10: error: ‘CODEC_ID_PCM_U16LE’ was not declared in this scope
case CODEC_ID_PCM_U16LE:
^
../src/essentia/utils/audiocontext.cpp:110:10: error: ‘CODEC_ID_PCM_U16BE’ was not declared in this scope
case CODEC_ID_PCM_U16BE:
^
../src/essentia/utils/audiocontext.cpp:116:10: error: ‘CODEC_ID_FLAC’ was not declared in this scope
case CODEC_ID_FLAC:
^
../src/essentia/utils/audiocontext.cpp:117:10: error: ‘CODEC_ID_VORBIS’ was not declared in this scope
case CODEC_ID_VORBIS:
^
../src/essentia/utils/audiocontext.cpp: In member function ‘void essentia::AudioContext::encodePacket(int)’:
../src/essentia/utils/audiocontext.cpp:278:97: error: ‘avcodec_encode_audio’ was not declared in this scope
packet.size = avcodec_encode_audio(_codecCtx, outputBuffer, frame_bytes, (short)_inputBuffer);
^
../src/essentia/utils/audiocontext.cpp:293:18: warning: ‘AVCodecContext::coded_frame’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:2892) [-Wdeprecated-declarations]
if (_codecCtx->coded_frame->pts != (int)AV_NOPTS_VALUE) {
^
../src/essentia/utils/audiocontext.cpp:293:18: warning: ‘AVCodecContext::coded_frame’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:2892) [-Wdeprecated-declarations]
../src/essentia/utils/audiocontext.cpp:294:42: warning: ‘AVCodecContext::coded_frame’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:2892) [-Wdeprecated-declarations]
packet.pts = av_rescale_q(_codecCtx->coded_frame->pts, _codecCtx->time_base, _avStream->time_base);
^
../src/essentia/utils/audiocontext.cpp:294:42: warning: ‘AVCodecContext::coded_frame’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:2892) [-Wdeprecated-declarations]
../src/essentia/utils/audiocontext.cpp: In member function ‘void essentia::AudioContext::writeEOF()’:
../src/essentia/utils/audiocontext.cpp:323:94: error: ‘avcodec_encode_audio’ was not declared in this scope
size = avcodec_encode_audio(_codecCtx, outputBuffer, frame_bytes, (short)_inputBuffer); // outputs remaining samples
^
../src/essentia/utils/audiocontext.cpp:327:78: error: ‘avcodec_encode_audio’ was not declared in this scope
size = avcodec_encode_audio(_codecCtx, _outputBuffer, frame_bytes, NULL); // sets EOF
^
Waf: Leaving directory `/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build'
Build failed
-> task in 'essentia' failed (exit status 1):
{task 139742794557904: cxx audiocontext.cpp -> audiocontext.cpp.1.o}
['/usr/bin/g++', '-pipe', '-Wall', '-msse', '-msse2', '-mfpmath=sse', '-O2', '-fPIC', '-pthread', '-pthread', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/essentia', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/essentia', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/essentia/scheduler', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/essentia/scheduler', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/essentia/streaming', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/essentia/streaming', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/essentia/streaming/algorithms', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/essentia/streaming/algorithms', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/essentia/utils', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/essentia/utils', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/3rdparty', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/3rdparty', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/build/src/3rdparty/vamp-plugin-sdk-2.4', '-I/home/roger/AudioSignalProcessing/essentia-2.1_beta2/src/3rdparty/vamp-plugin-sdk-2.4', '-I/usr/local/include', '-I/usr/include/taglib', '-DHAVE_AVCODEC=1', '-DHAVE_AVFORMAT=1', '-DHAVE_AVUTIL=1', '-DHAVE_SWRESAMPLE=1', '-DHAVE_FFTW=1', '-DHAVE_SAMPLERATE=1', '-DHAVE_TAGLIB=1', '-D__STDC_CONSTANT_MACROS', '-DHAVE_YAML=1', '-DPYTHONDIR="/usr/local/lib/python2.7/dist-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/dist-packages"', '-DHAVE_PYTHON_H=1', '../src/essentia/utils/audiocontext.cpp', '-c', '-o', 'src/essentia/utils/audiocontext.cpp.1.o']

Do you have any other suggestions?

@rgonnering
Copy link
Author

I have now tried essentia-master.

With $ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests
Now there is a new dependency and it says not found
Checking for 'libavresample' : not found

but it is installed:
$ whereis libavresample
libavresample: /usr/include/libavresample

Now when I do $./waf
There is a new set of errors

[ 26/343] cxx: src/essentia/utils/audiocontext.cpp -> build/src/essentia/utils/audiocontext.cpp.1.o
../src/essentia/utils/audiocontext.cpp: In member function ‘void essentia::AudioContext::encodePacket(int)’:
../src/essentia/utils/audiocontext.cpp:337:34: error: ‘_bufferFmt’ was not declared in this scope
(uint8_t**) &_bufferFmt, outputBufferSamples,
^
../src/essentia/utils/audiocontext.cpp:337:46: error: ‘outputBufferSamples’ was not declared in this scope
(uint8_t**) &_bufferFmt, outputBufferSamples,
^
../src/essentia/utils/audiocontext.cpp:338:52: error: expected ‘;’ before ‘)’ token
(const uint8_t**) _buffer, size) < 0) {
^
Waf: Leaving directory `/home/roger/AudioSignalProcessing/essentia-master/build'
Build failed
-> task in 'essentia' failed (exit status 1):
{task 140262966716432: cxx audiocontext.cpp -> audiocontext.cpp.1.o}
['/usr/bin/g++', '-pipe', '-Wall', '-msse', '-msse2', '-mfpmath=sse', '-O2', '-fPIC', '-pthread', '-w', '-fPIC', '-pthread', '-pthread', '-fPIC', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src', '-I/home/roger/AudioSignalProcessing/essentia-master/src', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/essentia', '-I/home/roger/AudioSignalProcessing/essentia-master/src/essentia', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/essentia/scheduler', '-I/home/roger/AudioSignalProcessing/essentia-master/src/essentia/scheduler', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/essentia/streaming', '-I/home/roger/AudioSignalProcessing/essentia-master/src/essentia/streaming', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/essentia/streaming/algorithms', '-I/home/roger/AudioSignalProcessing/essentia-master/src/essentia/streaming/algorithms', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/essentia/utils', '-I/home/roger/AudioSignalProcessing/essentia-master/src/essentia/utils', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/3rdparty', '-I/home/roger/AudioSignalProcessing/essentia-master/src/3rdparty', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/3rdparty/spline', '-I/home/roger/AudioSignalProcessing/essentia-master/src/3rdparty/spline', '-I/home/roger/AudioSignalProcessing/essentia-master/build/src/3rdparty/vamp-plugin-sdk-2.4', '-I/home/roger/AudioSignalProcessing/essentia-master/src/3rdparty/vamp-plugin-sdk-2.4', '-I/usr/local/include', '-I/usr/include/taglib', '-DHAVE_AVCODEC=1', '-DHAVE_AVFORMAT=1', '-DHAVE_AVUTIL=1', '-DHAVE_SWRESAMPLE=1', '-DHAVE_SAMPLERATE=1', '-DHAVE_TAGLIB=1', '-DHAVE_YAML=1', '-DHAVE_FFTW=1', '-D__STDC_CONSTANT_MACROS', '-DPYTHONDIR="/usr/local/lib/python2.7/dist-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/dist-packages"', '-DHAVE_PYTHON_H=1', '../src/essentia/utils/audiocontext.cpp', '-c', '-o', 'src/essentia/utils/audiocontext.cpp.1.o']

Do you have any other suggestions?

Thanks

@dbogdanov
Copy link
Member

What is the version of libavformat/livavcodec/libavutil packages? You can check that in build/config.logfile.
For building from master branch you will need more recent LibAv packages from Ubuntu 14.10.

@dbogdanov dbogdanov reopened this Nov 22, 2015
@rgonnering
Copy link
Author

Hi,
Thanks for the follow-up. Here is the build/config.log relative to libavformat/livavcodec/libavutil packages for all 3 builds.

essentia-master

Checking for 'libavcodec' >= 55.34.1
['/usr/bin/pkg-config', 'libavcodec >= 55.34.1', '--cflags', '--libs', '--modversion', 'libavcodec']
out: 57.15.100
57.15.100
-I/usr/local/include  -pthread -L/usr/local/lib -lavcodec -lz -lswresample -lavutil -lm  
yes
----------------------------------------
Checking for 'libavformat'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavformat']
out: 57.15.100
-I/usr/local/include  -pthread -L/usr/local/lib -lavformat -lavcodec -lz -lswresample -lavutil -lm  
yes
----------------------------------------
Checking for 'libavutil'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavutil']
out: 55.6.100
-I/usr/local/include  -L/usr/local/lib -lavutil -lm  
yes

essentia-2.1_beta2

Checking for 'libavcodec' >= 53.25.0
['/usr/bin/pkg-config', 'libavcodec >= 53.25.0', '--cflags', '--libs', '--modver
sion', 'libavcodec']
out: 57.15.100
57.15.100
-I/usr/local/include  -pthread -L/usr/local/lib -lavcodec -lz -lswresample -lavutil -lm  
yes
----------------------------------------
Checking for 'libavformat'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavformat']
out: 57.15.100
-I/usr/local/include  -pthread -L/usr/local/lib -lavformat -lavcodec -lz -lswresample -lavutil -lm  
yes
----------------------------------------
Checking for 'libavutil'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavutil']
out: 55.6.100
-I/usr/local/include  -L/usr/local/lib -lavutil -lm  
yes

essentia-2.0.1

Checking for 'libavcodec'
['/usr/bin/pkg-config', '--cflags', '--libs', 'libavcodec']
out: -I/usr/local/include  -pthread -L/usr/local/lib -lavcodec -lz -lswresample -lavutil -lm  
yes
----------------------------------------
Checking for 'libavformat'
['/usr/bin/pkg-config', '--cflags', '--libs', 'libavformat']
out: -I/usr/local/include  -pthread -L/usr/local/lib -lavformat -lavcodec -lz -lswresample -lavutil -lm  
yes
----------------------------------------
Checking for 'libavutil'
['/usr/bin/pkg-config', '--cflags', '--libs', 'libavutil']
out: -I/usr/local/include  -L/usr/local/lib -lavutil -lm  
yes

@rgonnering
Copy link
Author

Does anyone have any ideas on how to proceed. Essentia still doesn't build.

@dbogdanov
Copy link
Member

You are missing another library, if you are building the master branch or 2.1beta2. Install libavresample-dev package.

I've checked the code and there is an error in the case libswresample is detected. Libavresample is a replacement for this library and we would probably get rid of supporting libswresample.

Thank you for your report!

@dbogdanov dbogdanov added this to the 2.1 milestone Nov 29, 2015
@dbogdanov dbogdanov added the bug label Nov 29, 2015
@dbogdanov dbogdanov changed the title Build failed Remove support for libswresample as we have libavresample Nov 29, 2015
@rgonnering
Copy link
Author

Thanks again for responding. I already have libavresample-dev installed.

$ sudo apt-get install libavresample-dev
[sudo] password for roger:
Sorry, try again.
[sudo] password for roger:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libavresample-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Should I get rid of libavresample or libswresample?

Thanks, again.

@dbogdanov
Copy link
Member

Remove the libswresample

@dbogdanov
Copy link
Member

Btw, if you are building master branch, and you have libavresample installed and detected by Essentia (check in log), the error should not appear.

@rgonnering
Copy link
Author

We might get this yet.

I removed libswresample. (Actually, I did
$ sudo mv /usr/local/lib/pkgconfig/libswresample.pc /usr/local/lib/pkgconfig/libswresample.pc.sav
so libswresample couldn't be found.)

I also downloaded and extracted essentia-2.1_beta2 for this go.

$ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests
now shows:
Checking for 'libavcodec' >= 53.25.0 : not found
Checking for 'libavformat' : not found
Checking for 'libswresample' : not found
'configure' finished successfully (0.448s)

$ ./waf
'build' finished successfully (1m29.240s)

$ sudo ./waf install
'install' finished successfully (0.744s)

$ ipython
[1]: import essentia

SUCCESS!

Dmitry, YOU ARE THE MAN!

Thank you for all of your help. I'll share this success. Thanks, again.

@dbogdanov
Copy link
Member

It is strange however, that is reports you that

Checking for 'libavcodec' >= 53.25.0 : not found
Checking for 'libavformat' : not found 

Before you did not have this problem, according to your log copy-paste.
We'll keep this ticket open until the libswresample issue is fixed.

@dbogdanov dbogdanov reopened this Nov 30, 2015
@rgonnering
Copy link
Author

Dimitry,
Back when my essentia adventure started, "Checking for 'libavcodec' >= 53.25.0 : not found" was an indicator the ffmpeg was missing. It is beyond me, especially since
$ whereis libavcodec
libavcodec: /usr/local/lib/libavcodec.a /usr/include/libavcodec

This shows that libavcodec is installed.

At any rate, I really appreciate all of the help you provided.

Thanks,
Roger

@dbogdanov
Copy link
Member

Check the config.logagain. Before it was reporting that 57.15.100version was detected

@rgonnering
Copy link
Author

I have essentia (2.1-beta2)

The build/config.log shows:
----------------------------------------
Checking for 'libavcodec' >= 53.25.0
['/usr/bin/pkg-config', 'libavcodec >= 53.25.0', '--cflags', '--libs', '--modversion', 'libavcodec']
err: Package 'libswresample' requires 'libavutil >= 55.9.100' but version of libavutil is 55.7.100

not found
from /home/roger/bin/essentia-2.1_beta2/src: The configuration failed
----------------------------------------
Checking for 'libavformat'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavformat']
err: Package 'libswresample' requires 'libavutil >= 55.9.100' but version of libavutil is 55.7.100

not found
from /home/roger/bin/essentia-2.1_beta2/src: The configuration failed
----------------------------------------
Checking for 'libavutil'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavutil']
out: 55.7.100
-I/usr/local/include  -L/usr/local/lib -lavutil -lm  

yes
----------------------------------------
Checking for 'libswresample'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libswresample']
err: Package 'libswresample' requires 'libavutil >= 55.9.100' but version of libavutil is 55.7.100

not found
from /home/roger/bin/essentia-2.1_beta2/src: The configuration failed
----------------------------------------

@rgonnering
Copy link
Author

Just to add to the confusion a bit, I also have a Windows computer with VirturalBox and a Ubuntu 14.04 Guest OS.

I ran all of the same steps, except with --with-gaia
./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests
I built, and I was able to import essentia into ipython, but I got this:

In [7]: dir(essentia.standard)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-d247de7ac92f> in <module>()
----> 1 dir(essentia.standard)
AttributeError: 'module' object has no attribute 'standard'

I went back to the config.log, and got

----------------------------------------
Checking for 'libavcodec' >= 53.25.0
['/usr/bin/pkg-config', 'libavcodec >= 53.25.0', '--cflags', '--libs', '--modversion', 'libavcodec']
err: Package libswresample was not found in the pkg-config search path.
Perhaps you should add the directory containing `libswresample.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libswresample', required by 'libavcodec', not found

not found
from /home/roger/AudioSignalProcessing/essentia-2.1_beta2/src: The configuration failed
----------------------------------------
Checking for 'libavformat'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavformat']
err: Package libswresample was not found in the pkg-config search path.
Perhaps you should add the directory containing `libswresample.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libswresample', required by 'libavcodec', not found

not found
from /home/roger/AudioSignalProcessing/essentia-2.1_beta2/src: The configuration failed
----------------------------------------
Checking for 'libswresample'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libswresample']
err: Package libswresample was not found in the pkg-config search path.
Perhaps you should add the directory containing `libswresample.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libswresample' found

not found
from /home/roger/AudioSignalProcessing/essentia-2.1_beta2/src: The configuration failed
----------------------------------------

This is different.

@dbogdanov
Copy link
Member

You got some mess with your libav installation. In your case libavcodec depends on libswresample and this is probably because you've built libav/ffmpeg from source.

Your libav is installed in /usr/local/lib. Remove all that installation and start from scratch. If you are ok with that, the best way would be to use apt-get:

sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libavresample-dev

@dbogdanov dbogdanov reopened this Dec 1, 2015
@rgonnering
Copy link
Author

Dimitry,

As I understand it, ffmpeg is needed and the only way to get it is to build
it on Ubuntu 14.04. Please let me know if there is another way.

Thanks,
Roger

On Tue, Dec 1, 2015 at 10:35 AM, Dmitry Bogdanov notifications@github.com
wrote:

You got some mess with your libav installation. In your case libavcodec
depends on libswresample and this is probably because you've built
libav/ffmpeg from source.

Your libav is installed in /usr/local/lib. Remove all that installation
and start from scratch. If you are ok with that, the best way would be to
use apt-get:

sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libavresample-dev


Reply to this email directly or view it on GitHub
#321 (comment).

@dbogdanov
Copy link
Member

No, only some parts of ffmpeg are required, and that are present in Ubuntu. You can install all required packages via apt-get as suggested in documentation:

sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libavresample-dev

@dbogdanov
Copy link
Member

I have fixed the issue with libswresample. You can restore the pc file from /usr/local/lib/pkgconfig/libswresample.pc.sav and check if it works.

@rgonnering
Copy link
Author

I originally did that, only to find that I needed to install ffmpeg.

On Tue, Dec 1, 2015 at 12:41 PM, Dmitry Bogdanov notifications@github.com
wrote:

No, only some parts of ffmpeg are required, and that are present in
Ubuntu. You can install all required packages via apt-get as suggested in
documentation:

sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libavresample-dev


Reply to this email directly or view it on GitHub
#321 (comment).

@rgonnering
Copy link
Author

OK. I'll try. I assume I have to start over, by downloading the source then
run through the steps.

On Tue, Dec 1, 2015 at 12:42 PM, Dmitry Bogdanov notifications@github.com
wrote:

I have fixed the issue with libswresample. You can restore the pc file
from /usr/local/lib/pkgconfig/libswresample.pc.sav and check if it works.


Reply to this email directly or view it on GitHub
#321 (comment).

@rgonnering
Copy link
Author

I restored libswresample.

$ cd ~/gitlocal
$ git clone https://github.com/MTG/essentia.git
$ sudo apt-get install build-essential libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev libtag1-dev
$ cd essentia
$ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests --with-gaia

Got these messages:
Checking for 'libavresample' : not found
Ignoring the following algorithms: MonoLoader, EasyLoader, AudioWriter, EqloudLoader, AudioLoader, IFFTA, MonoWriter, FFTK, IFFTK, FFTA
'configure' finished successfully (43.544s)

$ ./waf

Building all the algorithms
Ignoring the following algorithms: MonoLoader, IFFTA, AudioWriter, FFTK, AudioLoader, EasyLoader, MonoWriter, EqloudLoader, IFFTK, FFTA
'build' finished successfully (13m56.569s)

$ sudo ./waf install

Ignoring the following algorithms: MonoLoader, IFFTA, AudioWriter, FFTK, AudioLoader, EasyLoader, MonoWriter, EqloudLoader, IFFTK, FFTA
Waf: Leaving directory `/home/roger/github/essentia/build'
'install' finished successfully (2.395s)

$ ./waf run_tests

$ ./waf run_tests
build/basetest: error while loading shared libraries: libessentia.so: cannot open shared object file: No such file or directory
'run_tests' finished successfully (0.001s)

$ whereis libessentia.so
libessentia: /usr/local/lib/libessentia.a /usr/local/lib/libessentia.so

$ ls -al /usr/local/lib/libessentia.so
-rwxr-xr-x 1 root root 7510027 Dec 2 09:35 /usr/local/lib/libessentia.so <--------- moments ago

$ ipython

In [1]: import essentia

ImportError Traceback (most recent call last)
in ()
----> 1 import essentia
/usr/local/lib/python2.7/dist-packages/essentia/init.py in ()
----> 1 import _essentia
2 import sys as _sys
3 from _essentia import reset
4 from common import Pool, array, ones, zeros
5 from progress import Progress
ImportError: libessentia.so: cannot open shared object file: No such file or directory

$ ls -al /usr/local/lib/pkgconfig
total 52
drwxr-xr-x 2 root root 4096 Dec 2 09:40 .
drwxr-xr-x 6 root root 4096 Dec 2 09:40 ..
-rw-r--r-- 1 root root 418 Dec 2 09:35 essentia.pc <--------- moments ago

Did I do something wrong or miss a step?

@rgonnering
Copy link
Author

Additionally, I forgot to add, from build/config.log:


Checking for 'libavresample'
['/usr/bin/pkg-config', '--cflags', '--libs', '--modversion', 'libavresample']
err: Package 'libavresample' requires 'libavutil = 52.3.0' but version of libavutil is 54.31.100
not found

from /home/roger/github/essentia/src: The configuration failed

$ whereis libavresample
libavresample: /usr/include/libavresample

@dbogdanov
Copy link
Member

Still there is a mess. Remove everything libav* related from /usr/local
It is where Essentia configure script first looks for libraries. And this produces all the mess.

If you are on Ubuntu 14.04 - use Essentia 2.1beta2.

@rgonnering
Copy link
Author

Should I

$ sudo apt-get remove libav-tools

or

$ cd /usr/lib
$ rm -r libav*

On Wed, Dec 2, 2015 at 10:33 AM, Dmitry Bogdanov notifications@github.com
wrote:

Still there is a mess. Remove everything libav* related from /usr/local
It is where Essentia configure script first looks for libraries. And this
produces all the mess.

If you are on Ubuntu 14.04 - use Essentia 2.1beta2.


Reply to this email directly or view it on GitHub
#321 (comment).

@dbogdanov
Copy link
Member

Remove libav* files from folders:

  • /usr/local/include/
  • /usr/local/lib/
  • /usr/local/lib/pkgconfig/

@rgonnering
Copy link
Author

Dimitry,
I'm happy, and I'm sure you'll be happy because I will no longer need to bother you. Your fix worked.

Get rid of libav*
$ cd /usr/local/include
$ sudo rm -r libav*
$ cd ../lib
$ sudo rm libav*
$ cd pkgconfig/
$ sudo rm libav*

I downloaded and extracted Essentia 2.1beta2 to $HOME/essentia-2.1_beta2.

$ sudo apt-get install build-essential libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev libtag1-dev

I had previously done this
$ sudo apt-get install python-numpy-dev python-numpy
$ sudo apt-get install python-pip
$ pip install pyyaml

libswresample is present:
$ ls /usr/local/lib/pkgconfig
essentia.pc fdk-aac.pc gaia2.pc libswresample.pc libswscale.pc vpx.pc

$ cd essentia-2.1_beta2/
$ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests --with-gaia

Here's the message:
Checking for 'libswresample' : not found
The following algorithms will be included: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']

  • Compiling 24 examples
    standard_beatsmarker, standard_mfcc, standard_onsetrate, standard_pitchyinfft, standard_fadedetection, standard_spectralcontrast, standard_rhythmtransform, streaming_extractor, streaming_extractor_short_sounds, streaming_extractor_music, streaming_beatsmarker, streaming_mfcc, streaming_gfcc, streaming_rhythmextractor_multifeature, streaming_beattracker_multifeature_mirex2013, streaming_onsetrate, streaming_panning, streaming_tuningfrequency, streaming_key, streaming_pitchyinfft, streaming_predominantmelody, streaming_md5, streaming_extractor_freesound, streaming_extractor_music_svm
    'configure' finished successfully (3.084s)

$ ./waf
Building all the algorithms
'install' finished successfully

$ sudo ./waf install
Building all the algorithms
'install' finished successfully (2.395s)


$ ./waf run_tests

All tests passed.

To run the python tests:
$ ./waf run_python_tests
Message:
testEmpty (standard.test_monomixer_streaming.TestMonoMixer_Streaming) ... ERROR
testEmpty (standard.test_stereodemuxer.TestStereoDemuxer_Streaming) ... ERROR
testEmpty (standard.test_stereodemuxer_streaming.TestStereoDemuxer_Streaming) ... ERROR
testRegression (standard.test_panning.TestPanning) ... FAIL
testShortAudioFilesNormalHopSize (standard.test_framecutter_streaming.TestFrameCutter_Streaming) ... Killed

'run_python_tests' finished successfully (6m56.767s)

$ ipython
import essentia
import essentia.standard
print essentia.version
2.1-beta2
dir(essentia.standard)
now includes
'MonoLoader',
run centroid <--------- this works!!!!!!!!

Again, Dmitry, thank you for all of your help.

1 similar comment
@rgonnering
Copy link
Author

Dimitry,
I'm happy, and I'm sure you'll be happy because I will no longer need to bother you. Your fix worked.

Get rid of libav*
$ cd /usr/local/include
$ sudo rm -r libav*
$ cd ../lib
$ sudo rm libav*
$ cd pkgconfig/
$ sudo rm libav*

I downloaded and extracted Essentia 2.1beta2 to $HOME/essentia-2.1_beta2.

$ sudo apt-get install build-essential libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev libtag1-dev

I had previously done this
$ sudo apt-get install python-numpy-dev python-numpy
$ sudo apt-get install python-pip
$ pip install pyyaml

libswresample is present:
$ ls /usr/local/lib/pkgconfig
essentia.pc fdk-aac.pc gaia2.pc libswresample.pc libswscale.pc vpx.pc

$ cd essentia-2.1_beta2/
$ ./waf configure --mode=release --with-python --with-examples --with-vamp --with-cpptests --with-gaia

Here's the message:
Checking for 'libswresample' : not found
The following algorithms will be included: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']

  • Compiling 24 examples
    standard_beatsmarker, standard_mfcc, standard_onsetrate, standard_pitchyinfft, standard_fadedetection, standard_spectralcontrast, standard_rhythmtransform, streaming_extractor, streaming_extractor_short_sounds, streaming_extractor_music, streaming_beatsmarker, streaming_mfcc, streaming_gfcc, streaming_rhythmextractor_multifeature, streaming_beattracker_multifeature_mirex2013, streaming_onsetrate, streaming_panning, streaming_tuningfrequency, streaming_key, streaming_pitchyinfft, streaming_predominantmelody, streaming_md5, streaming_extractor_freesound, streaming_extractor_music_svm
    'configure' finished successfully (3.084s)

$ ./waf
Building all the algorithms
'install' finished successfully

$ sudo ./waf install
Building all the algorithms
'install' finished successfully (2.395s)


$ ./waf run_tests

All tests passed.

To run the python tests:
$ ./waf run_python_tests
Message:
testEmpty (standard.test_monomixer_streaming.TestMonoMixer_Streaming) ... ERROR
testEmpty (standard.test_stereodemuxer.TestStereoDemuxer_Streaming) ... ERROR
testEmpty (standard.test_stereodemuxer_streaming.TestStereoDemuxer_Streaming) ... ERROR
testRegression (standard.test_panning.TestPanning) ... FAIL
testShortAudioFilesNormalHopSize (standard.test_framecutter_streaming.TestFrameCutter_Streaming) ... Killed

'run_python_tests' finished successfully (6m56.767s)

$ ipython
import essentia
import essentia.standard
print essentia.version
2.1-beta2
dir(essentia.standard)
now includes
'MonoLoader',
run centroid <--------- this works!!!!!!!!

Again, Dmitry, thank you for all of your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants