Repository navigation
Closed
Description
Overview
While installing the PyAV package via. PYPI (pip install av), the build breaks. And it does not install.
Expected behavior
It was expected that the package will install after ffmpeg version > 4 was installed.
Actual behavior
The build/install fails with the following error
Build report:
building 'av.sidedata.motionvectors' extension
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/sidedata/motionvectors.c -o build/temp.linux-x86_64-3.7/src/av/sidedata/motionvectors.o
src/av/sidedata/motionvectors.c: In function ‘__pyx_pf_2av_8sidedata_13motionvectors_14_MotionVectors_2__repr__’:
src/av/sidedata/motionvectors.c:2345:46: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
__pyx_t_4 = __Pyx_PyInt_From_unsigned_int(((unsigned int)__pyx_v_self->__pyx_base.ptr->data)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error)
^
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/sidedata/motionvectors.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/sidedata/motionvectors.cpython-37m-x86_64-linux-gnu.so
building 'av.data.stream' extension
creating build/temp.linux-x86_64-3.7/src/av/data
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/data/stream.c -o build/temp.linux-x86_64-3.7/src/av/data/stream.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/data/stream.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/data/stream.cpython-37m-x86_64-linux-gnu.so
building 'av.filter.filter' extension
creating build/temp.linux-x86_64-3.7/src/av/filter
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/filter/filter.c -o build/temp.linux-x86_64-3.7/src/av/filter/filter.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/filter/filter.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/filter/filter.cpython-37m-x86_64-linux-gnu.so
building 'av.filter.link' extension
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/filter/link.c -o build/temp.linux-x86_64-3.7/src/av/filter/link.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/filter/link.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/filter/link.cpython-37m-x86_64-linux-gnu.so
building 'av.filter.context' extension
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/filter/context.c -o build/temp.linux-x86_64-3.7/src/av/filter/context.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/filter/context.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/filter/context.cpython-37m-x86_64-linux-gnu.so
building 'av.filter.pad' extension
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/filter/pad.c -o build/temp.linux-x86_64-3.7/src/av/filter/pad.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/filter/pad.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/filter/pad.cpython-37m-x86_64-linux-gnu.so
building 'av.filter.graph' extension
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/filter/graph.c -o build/temp.linux-x86_64-3.7/src/av/filter/graph.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/filter/graph.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/filter/graph.cpython-37m-x86_64-linux-gnu.so
building 'av.codec.context' extension
creating build/temp.linux-x86_64-3.7/src/av/codec
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/codec/context.c -o build/temp.linux-x86_64-3.7/src/av/codec/context.o
gcc -pthread -shared -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -L/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,-rpath=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/src/av/codec/context.o -lswresample -lavutil -lavcodec -lavformat -lswscale -lavdevice -lavfilter -o build/lib.linux-x86_64-3.7/av/codec/context.cpython-37m-x86_64-linux-gnu.so
building 'av.codec.codec' extension
gcc -pthread -B /home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Ibuild/temp.linux-x86_64-3.7/include -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -I/usr/include/x86_64-linux-gnu -I/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env/include/python3.7m -Ibuild/temp.linux-x86_64-3.7/include -c src/av/codec/codec.c -o build/temp.linux-x86_64-3.7/src/av/codec/codec.o
src/av/codec/codec.c: In function ‘__pyx_pymod_exec_codec’:
src/av/codec/codec.c:6061:36: error: ‘AV_CODEC_CAP_HARDWARE’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_DR1’?
__pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_HARDWARE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~~~
AV_CODEC_CAP_DR1
src/av/codec/codec.c:6061:36: note: each undeclared identifier is reported only once for each function it appears in
src/av/codec/codec.c:6082:36: error: ‘AV_CODEC_CAP_HYBRID’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_DR1’?
__pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_HYBRID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
^~~~~~~~~~~~~~~~~~~
AV_CODEC_CAP_DR1
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for av
Investigation
I tried to compile download the av package and compile it using setup.py and the --ffmpeg-dir flag pointing to the ffmpeg directory. Installation fails.
Reproduction
Have not tried on any other system.
Versions
- OS: Ubuntu 18.04
- PyAV runtime:
{{ Complete output of `python -m av --version` if you can run it. }}
- PyAV build:
PyAV: 7.0.1 (unknown commit)
Python: 3.7.6 (default, Jan 8 2020, 19:59:22) \n[GCC 7.3.0]
platform: Linux-5.3.0-40-generic-x86_64-with-debian-buster-sid
extension_extra:
include_dirs: [b'include', b'/usr/include/x86_64-linux-gnu']
libraries: [b'avformat', b'avcodec', b'avdevice', b'avutil', b'avfilter', b'swscale', b'swresample']
library_dirs: []
define_macros: []
runtime_library_dirs: []
config_macros:
PYAV_COMMIT_STR="unknown-commit"
PYAV_VERSION=7.0.1
PYAV_VERSION_STR="7.0.1"
- FFmpeg:
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
configuration: --prefix=/home/dartnixtrix/anaconda3/envs/kyc_webrtc_env --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1556785800657/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-libx264 --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Research
I have done the following:
- Checked the PyAV documentation
- Searched on Google
- Searched on Stack Overflow
- Looked through old GitHub issues
- Asked on PyAV Gitter
- ... and waited 72 hours for a response.
Additional context
I want to use "aiortc", this is a dependency. I have read an issue on PyAV repo. in which it was said "it is broken since 7.0.0". Tried installing 6.2.0 with success. But 7.0.1 is what is needed.
Reacted by Andy Jones, Joshua Carter, Igor Rendulic and Yuri Nishikawa
Metadata
Metadata
Assignees
Labels
No labels
Activity
mikeboers commentedon Apr 7, 2020
This looks like PyAV is building against FFmpeg 3.x.
You have an FFmpeg 4.1.3 from anaconda. Is there an FFmpeg 3.x from the OS as well?
necronomican commentedon Apr 7, 2020
Yes there was a ffmpeg 3.x but uninstalled it and installed 4.1.3. I uninstalled it and installed the latest ffmpeg
still fails with the same error while installing
necronomican commentedon Apr 7, 2020
Here is the error file and environment.yml after a fresh environment creation using anaconda.
Error While Installing
Env File
mikeboers commentedon Apr 7, 2020
Okay. Thanks. I'm gonna go make a note in #605
necronomican commentedon Apr 7, 2020
Alright. Thanks. I will try to do something to resolve this on my system. Will share it here if it's somehow a fault on my end.
necronomican commentedon Apr 7, 2020
Oh and thank you for the prompt response mate!
ReuvenSwirsky commentedon Apr 16, 2020
I've been trying to install aiortc==0.9.27 for the past several days here with little luck. aiortc has a dependency on PyAV. For some reason there's no "official" repo that has a built ffmpeg for centos 7 so I had to build one by hand.
I tried these instructions from #510
with little success. Now I'm getting errors like this when linking against the shared ffpmeg libraries that got built:
Not sure what next step should be. I'm going to try forcing in that -fPIC option but I think I'm down a rathole!
jlaine commentedon Apr 22, 2020
You are linking against a static FFmpeg (see:
libswscale.a, notlibswscale.so.X) which is not supported as stated in #510jlaine commentedon Apr 26, 2020
As of PyAV 8.0.0, binary wheels are provided which will greatly simplify installation and should solve your issue.
youben11 commentedon Jun 25, 2020
@jlaine the binary wheels are unfortunately note compatible with all linux distribution (needs manylinux2014 and manylinux1 maybe?). I'm running ubuntu 18.04 with python 3.7 and I can't install it
bd-thmiller commentedon Sep 2, 2020
@youben11 try installing the latest pip. Ubuntu's packaged version of pip (9.0.1) is too old for anything labeled manylinux2010 or later.
https://pip.pypa.io/en/stable/installing/
genekogan commentedon Nov 3, 2020
I am also having this issue on the latest pip3 with the binary for PyAV 8.0.2. Trying to install
avon Jetson Nano (aarch64).I gather it may be connected to where ffmpeg is installed (I just used
sudo apt get ffmpeg).tushar-semwal commentedon Nov 10, 2020
same issue as @genekogan. Were you able to solve @genekogan ?
genekogan commentedon Nov 10, 2020
@tushar-semwal I ended up installing it from source and that worked for me.
AbdallahAlhaddad commentedon Jan 22, 2021
Same issue as @genekogan & @tushar-semwal
I've solved the issue by installing ffmpeg version
4.2.4-1by following these steps:1. install from pip:
2. install from apt package manager:
3. download & install
ffmpegfrom source as follows:4.2.4-1tar -xf ffmpeg*4. verify
ffmpegversion:5. now you can install
PyAV 8.0.2using thewheel6. now check if
PyAVis installed correctly:cartovarc commentedon Feb 12, 2021
Thanks!
neilyoung commentedon Apr 1, 2024
Did not work for me, unfortunately. Looked good anyway...