Skip to content

Support ffmpeg version 5 #1248

Open
Open
@mguentner

Description

@mguentner

While essentia is built using ffmpeg version 2, the dynamically linked library will point to something like /usr/lib/libavcodec.so.59.
On recent ArchLinux and soon, a lot of of other distributions, ffmpeg is shipped in version 5.

libavcodec

When importing essentia in python, a linker error is thrown:

❯ python
Python 3.9.10 (main, Mar 12 2022, 17:44:28) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import essentia
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.cache/pypoetry/virtualenvs/essentia-pulse-m4Vcd7y0-py3.9/lib/python3.9/site-packages/essentia/__init__.py", line 1, in <module>
    from . import _essentia
ImportError: /home/user/.cache/pypoetry/virtualenvs/essentia-pulse-m4Vcd7y0-py3.9/lib/python3.9/site-packages/essentia/_essentia.cpython-39-x86_64-linux-gnu.so: undefined symbol: avcodec_decode_audio4
>>> 

avcodec_decode_audio4 among other functions was deprecated for a long time and has been dropped in 5.0 so it needs to be replaced.

There are several other projects affected by this which have the details already documented:

Relevant code in essentia, at least for avcodec_decode_audio4:

int len = avcodec_decode_audio4(audioCtx, _decodedFrame, &gotFrame, packet);

libavresample

libavresample is also used which needs to be replaced as it has also been removed from ffmpeg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions