essentia
essentia copied to clipboard
Support ffmpeg version 5
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
>>>
There are several other projects affected by this which have the details already documented:
- https://github.com/osrf/gazebo/issues/3180
- https://github.com/pytorch/pytorch/issues/72254
Relevant code in essentia, at least for avcodec_decode_audio4:
https://github.com/MTG/essentia/blob/07d089fe0fea04cd654b24e2f518775322ff85bb/src/algorithms/io/audioloader.cpp#L264
libavresample
libavresample is also used which needs to be replaced as it has also been removed from ffmpeg.
Just wanted to add that #1243 is also somewhat related to ffmpeg5 :grinning:.
libavresample has been replaced in #811, the rest is pending.
In addition to avcodec_decode_audio4, avcodec_encode_audio2 used in MonoWriter need to be replaced by avcodec_send_frame()/avcodec_receive_packet().
Also relevant: #1154