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

Support ffmpeg version 5 #1248

Open
mguentner opened this issue Apr 10, 2022 · 4 comments
Open

Support ffmpeg version 5 #1248

mguentner opened this issue Apr 10, 2022 · 4 comments
Labels
Milestone

Comments

@mguentner
Copy link

mguentner commented Apr 10, 2022

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.

@CartoonFan
Copy link

Just wanted to add that #1243 is also somewhat related to ffmpeg5 😀.

@dbogdanov
Copy link
Member

libavresample has been replaced in #811, the rest is pending.

@dbogdanov dbogdanov added this to the 2.1 milestone Jul 26, 2022
@dbogdanov
Copy link
Member

dbogdanov commented Jul 26, 2022

In addition to avcodec_decode_audio4, avcodec_encode_audio2 used in MonoWriter need to be replaced by avcodec_send_frame()/avcodec_receive_packet().

@dbogdanov
Copy link
Member

Also relevant: #1154

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

3 participants