MTG / essentia

C++ library for audio and music analysis, description and synthesis, including Python bindings
http://essentia.upf.edu
GNU Affero General Public License v3.0
2.8k stars 525 forks source link

Situation with ffmpeg libavresample->libswresample #808

Open i336 opened 5 years ago

i336 commented 5 years ago

Hi!

Currently trying to figure out a straightforward(-ish) way to do semi-automated beat tracking on Linux for a small project where I didn't want to manually sync each beat from a (very fast paced) song. (I'll probably have to fine tune the results, but "10 down, 329 to go" feels a bit less overwhelming then "120 down, ??? to go".)

Essentia seems to have a very rich set of functions to play with, and I'm glad I've discovered it. Unfortunately having a few issues getting it working; Arch Linux's obsession with always staying up to date is a bit of a hindrance at times.

Arch fairly closely tracked the deprecation of libavresample in favor of libswresample back in August of this year (it's just still 2018 as I type this :) ) - https://www.archlinux.org/todo/libavresample-drop/ - and of course its builds of ffmpeg haven't had avresample since from around that point.

So, of course, ./waf configure is going

Checking for 'libavresample'             : not found 

and then printing

- FFmpeg (or LibAv on debian/ubuntu) seems to be missing.
  The following algorithms will be ignored: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']

and if I'm understanding the Python beat tracking sample correctly, this is a tiny bit of a problem since I kind of need AudioLoader (and possibly EasyLoader).

While figuring out what to title this issue GitHub's new neat relevant-issue search found https://github.com/MTG/essentia/issues/321, which (half-amusingly, half-infuriatingly) tracked the exact opposite transition of what I describe here, ie swresample to avresample, back in July 2015. Wow, the avconv fiasco was such a debacle.

I have no idea if I could build ffmpeg from source with avresample at this point (literal translation: I haven't checked), but I I have limited motivation to do so due to a) the mild fiddliness of building ffmpeg then pointing essentia to the ffmpeg install (combined with this machine's sluggishness at compiling), and b) the fact that avresample is concretely deprecated and will eventually completely go away.

(Btw, I'm just on a tab-closing spree at the moment, this doesn't need a priority reply or anything.)

Martchus commented 5 years ago

I'm also using Arch Linux and have just noticed the same problem.

Here's a patch to make it work with libswresample: https://github.com/MTG/essentia/pull/807
Here's the latest version of the PKGBUILD which I'm using: https://github.com/Martchus/PKGBUILDs/tree/master/essentia/git

I haven't really tested it so far but at least it compiles and the basic test-suite passes.

dbogdanov commented 5 years ago

Indeed, at the times of libav/ffmpeg conflict we moved to libavresample following main linux distributions of our users. Now we definitely can add back the support for libswresample, which is not a big deal.

@i336 Alternatively, you can configure to build Essentia with static dependencies using the --static-dependencies flag. The packaging/build_3rdparty_static_debian.sh script takes care to build all required dependencies. This will include libavresample.