facebookresearch / SlowFast

PySlowFast: video understanding codebase from FAIR for reproducing state-of-the-art video models.
Apache License 2.0
6.52k stars 1.21k forks source link

set up error about "av" #168

Open ChenJunjie2019 opened 4 years ago

ChenJunjie2019 commented 4 years ago

I have followed the instruction of the INSTALL.md, and have installed all required library. But when I built pyslowfast, I met this error as follow:

(PySlowFast) cjj@cjj-hp:~/PycharmProjects/PySlowFast/slowfast$ python setup.py build develop running build running build_py running develop running egg_info writing slowfast.egg-info/PKG-INFO writing dependency_links to slowfast.egg-info/dependency_links.txt writing requirements to slowfast.egg-info/requires.txt writing top-level names to slowfast.egg-info/top_level.txt reading manifest file 'slowfast.egg-info/SOURCES.txt' writing manifest file 'slowfast.egg-info/SOURCES.txt' running build_ext Creating /home/cjj/anaconda3/lib/python3.7/site-packages/slowfast.egg-link (link to .) Adding slowfast 1.0 to easy-install.pth file

Installed /home/cjj/PycharmProjects/PySlowFast/slowfast Processing dependencies for slowfast==1.0 Searching for av Reading https://pypi.org/simple/av/ Downloading https://files.pythonhosted.org/packages/8e/7a/be91247d5d1613ce3a77d2a2d85211017536558c055b6f904eb38f21e2dc/av-7.0.1.tar.gz#sha256=fb13afa8967d112f3f78ee6ded1082546c32462dfdfa8dac81c9539f5bda0a83 Best match: av 7.0.1 Processing av-7.0.1.tar.gz Writing /tmp/easy_install-2ogmb6kk/av-7.0.1/setup.cfg Running av-7.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2ogmb6kk/av-7.0.1/egg-dist-tmp-fjjwaqb4 writing build/temp.linux-x86_64-3.7/include/pyav/config.h src/av/stream.c: In function ‘pyx_f_2av_6stream_6Streaminit’: src/av/stream.c:3012:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] pyx_t_7 = pyx_v_self->_codec_context->codec; ^ src/av/stream.c: In function ‘pyx_f_2av_6stream_6Streamfinalize_for_output’: src/av/stream.c:3698:44: warning: implicit declaration of function ‘avcodec_parameters_from_context’; did you mean ‘avcodec_free_context’? [-Wimplicit-function-declaration] pyx_t_8 = pyx_f_2av_5error_err_check(avcodec_parameters_from_context(pyx_v_self->_stream->codecpar, __pyx_v_self->_stream->codec), 0, NULL); if (unlikely(pyx_t_8 == ((int)-1))) PYX_ERR(0, 142, pyx_L1_error) ^~~~~~~ avcodec_free_context src/av/stream.c:3698:99: error: ‘struct AVStream’ has no member named ‘codecpar’; did you mean ‘codec’? pyx_t_8 = pyx_f_2av_5error_err_check(avcodec_parameters_from_context(pyx_v_self->_stream->codecpar, pyx_v_self->_stream->codec), 0, NULL); if (unlikely(pyx_t_8 == ((int)-1))) PYX_ERR(0, 142, __pyx_L1_error) ^~~~ codec error: Setup script exited with error: command 'gcc' failed with exit status 1

But I have installed 'av' by conda install av -c conda-forge.Could you please give some advices?

VanillaChelle commented 4 years ago

Hi Did you solve it? I met the same issue when trying to install pyav (version 7.0.1). I have tried different ffmpeg versions (version 4.2.2, 4.1.5 and 4.0.5) but no one works.

AlexanderMelde commented 4 years ago

For me the following combination works:

$ python -m av --version
PyAV v7.0.1
git origin: git@github.com:mikeboers/PyAV
git commit: unknown-commit
library configuration: --prefix=/opt/conda --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1566210161358/_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
library license: GPL version 3 or later
libavcodec     58. 54.100
libavdevice    58.  8.100
libavfilter     7. 57.100
libavformat    58. 29.100
libavutil      56. 31.100
libswresample   3.  5.100
libswscale      5.  5.100

and

$ ffmpeg -version
ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
configuration: --prefix=/opt/conda --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1566210161358/_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. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100
malarsaravanan1991 commented 4 years ago

I guess you missed activating the conda environment . MAy be try doing the dollowing:

  1. conda activate 2.python setup.py build develop
jlaine commented 4 years ago

As of version 8.0.0 (released yesterday) PyAV comes in the form of binary wheels which greatly simplifies installation. You no longer need the FFmpeg libraries and can just install it using:

pip install av