ffpyplayer icon indicating copy to clipboard operation
ffpyplayer copied to clipboard

ffpyplayer is not compiling

Open matthiasharrer opened this issue 2 years ago • 7 comments
trafficstars

Hi,

when I tried building an ffpyplayer wheel yesterday I faced issues while compiling.
I am not sure what changed. Probably there were some updates of python / compiler / dependencies or similar.

The same issues occured in previously working github workflows (in dependent projects) as well as when trying to just build the wheel locally (checking out your current master and running pip wheel .).

Error compiling Cython file:
------------------------------------------------------------
...
    old_callback = _log_callback
    if callback is None:
        av_log_set_callback(&av_log_default_callback)
        _log_callback = None
    elif not default_only or old_callback is None:
        av_log_set_callback(&_log_callback_func)
                            ^
------------------------------------------------------------

ffpyplayer/tools.pyx:182:28: Cannot assign type 'void (*)(void *, int, const char *, va_list) except * nogil' to 'void (*)(void *, int, const char *, va_list) noexcept nogil'

I can make it compile by adding "noexcept" to 3 different places shown in the compiler errors, but I am not sure if that is a proper fix or if it will cause other issues.

matthiasharrer avatar Jul 26 '23 07:07 matthiasharrer

Thanks for the report. This is probably because cython 3 was released which has some breaking changes. You'd need to pin to cython < 3 in pyproject.toml for now to get it to work, until I can fix the issues.

matham avatar Jul 26 '23 16:07 matham

Thanks for responding so quickly! Pinning the version works for me for the moment.

matthiasharrer avatar Jul 27 '23 11:07 matthiasharrer

I've downgraded to Cython 0.29.36 and still have the same error when trying to install it on Raspberry Pi OS Lite (64-bit). Here is the full output as a reference.

https://gist.github.com/COValhalla/f6e2fb8eac95b491e24d2e324bb0a9c0

Edit: I tried building from the source and had the same issue.

COValhalla avatar Aug 30 '23 20:08 COValhalla

Did you try to pin the cython version in pyproject.toml?

[build-system]
requires = [
    "setuptools", "wheel", "cython<3.0",
]

matthiasharrer avatar Aug 31 '23 07:08 matthiasharrer

It would be great if this issue could be resolved by supporting cypthon3. I started some weeks back with Kivy on a RPi 4 using Ubuntu 22.04 64bit. Because there is only a pre-build of ffpyplayer for Linux x64 but not Linux arm64 available, it's kind of blocking me to extend the Kivy installation from [base] to [base,media] on the RPi 4.

srolf avatar Sep 03 '23 06:09 srolf

Did you try to pin the cython version in pyproject.toml?

[build-system]
requires = [
    "setuptools", "wheel", "cython<3.0",
]

Yeah, that is already done for us with installing Kivy. I'm in a similar boat as srolf. This is a dependency for Kivy and I'm trying to run it on an RPI using Raspberry PI OS Lite 32-bit OR 64-bit and can't build the wheel.

COValhalla avatar Sep 08 '23 16:09 COValhalla

THANK YOU !

I had to install ffpyplayer 4.3.5 and I was having the error.

What I did:

wget https://github.com/matham/ffpyplayer/releases/download/v4.3.5/ffpyplayer-4.3.5.tar.gz
tar xf ffpyplayer-4.3.5.tar.gz
cd ffpyplayer-4.3.5
EDIT pyproject.toml and replace "cython" by "cython<3"
pip3 install .

and it worked !

gbouthenot avatar Sep 26 '23 09:09 gbouthenot