0

Recently I'm try to

pip3 install av

but got an error: command 'x86_64-linux-gnu-gcc' failed with exit status 1. How can I resolve this problem? Thank you!

src/av/codec/codec.c: In function ‘__pyx_f_2av_5codec_5codec_get_codec_names’:
src/av/codec/codec.c:4014:19: warning: implicit declaration of function ‘av_codec_iterate’; did you mean ‘av_codec_next’? [-Wimplicit-function-declaration]
     __pyx_v_ptr = av_codec_iterate((&__pyx_v_opaque));
                   ^~~~~~~~~~~~~~~~
                   av_codec_next
src/av/codec/codec.c:4014:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     __pyx_v_ptr = av_codec_iterate((&__pyx_v_opaque));
                 ^
src/av/codec/codec.c: In function ‘__pyx_pymod_exec_codec’:
src/av/codec/codec.c:6125: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, 121, __pyx_L1_error)
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    AV_CODEC_CAP_DR1
src/av/codec/codec.c:6125:36: note: each undeclared identifier is reported only once for each function it appears in
src/av/codec/codec.c:6146: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, 125, __pyx_L1_error)
                                    ^~~~~~~~~~~~~~~~~~~
                                    AV_CODEC_CAP_DR1
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qywqltd2/av/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xf05xm57-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-qywqltd2/av/
Ajay
  • 5,267
  • 2
  • 23
  • 30
Frank.D
  • 11
  • 1
  • Does this answer your question? [setup script exited with error: command 'x86\_64-linux-gnu-gcc' failed with exit status 1](https://stackoverflow.com/questions/26053982/setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-with-exit) – Ajay Feb 17 '21 at 03:51
  • 1
    These issues ([one](https://github.com/aiortc/aiortc/issues/326), [two](https://github.com/PyAV-Org/PyAV/issues/619)) suggest that you are trying to build against an old version of FFMPEG. You need version 4+ apparently. – that other guy Feb 17 '21 at 03:56

2 Answers2

1

Please try this

sudo add-apt-repository ppa:jonathonf/ffmpeg-4
sudo apt upgrade

The above suggestion is based on the information given git

raghu
  • 335
  • 4
  • 11
  • Thank you so much for your help. The problem has been solved by installed the dependency library – Frank.D Feb 18 '21 at 03:25
0

The problem has been solved by installing the dependency

apt install libavdevice-dev libavfilter-dev libopus-dev libvpx-dev pkg-config

apt install libsrtp2-dev

Frank.D
  • 11
  • 1