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

Can not install PyAV on Win10 #310

Closed
FreemanZ opened this issue Apr 13, 2018 · 7 comments
Closed

Can not install PyAV on Win10 #310

FreemanZ opened this issue Apr 13, 2018 · 7 comments

Comments

@FreemanZ
Copy link

FreemanZ commented Apr 13, 2018

 We didn't find `avformat_open_input` in the libraries.
    We look for it only as a sanity check to make sure the build
    process is working as expected. It is not, so we must abort.

    Please open a ticket at https://github.com/mikeboers/PyAV/issues
    with the folowing information:

    PyAV: 0.4.0 (unknown commit)
    Python: b'3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)]'
    platform: Windows-10-10.0.16299-SP0
    extension_extra:
        library_dirs: [b'c:\\python35\\libs', b'c:\\python35\\PCbuild\\amd64']
        include_dirs: [b'include', b'c:\\python35\\include', b'c:\\python35\\include']
        extra_link_args: [b'/OPT:NOREF']
        libraries: [b'avformat', b'avcodec', b'avdevice', b'avutil', b'avfilter', b'swscale', b'swresample']
    config_macros:
        PYAV_COMMIT_STR="unknown-commit"
        PYAV_HAVE_AVCODEC_SEND_PACKET=0
        PYAV_HAVE_AVFORMAT_ALLOC_OUTPUT_CONTEXT2=0
        PYAV_HAVE_AVFORMAT_CLOSE_INPUT=0
        PYAV_HAVE_AVFRAME__MB_TYPE=0
        PYAV_HAVE_AV_CALLOC=0
        PYAV_HAVE_AV_FRAME_GET_BEST_EFFORT_TIMESTAMP=0
        PYAV_HAVE_AV_OPT_TYPE_BOOL=0
        PYAV_HAVE_LIBAVRESAMPLE=0
        PYAV_HAVE_LIBSWRESAMPLE=1
        PYAV_VERSION=0.4.0
        PYAV_VERSION_STR="0.4.0"
        inline=__inline

    ----------------------------------------
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\axros\\AppData\\Local\\Temp\\pip-install-u8t4vvk5\\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 C:\Users\axros\AppData\Local\Temp\pip-record-sp93945n\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\axros\AppData\Local\Temp\pip-install-u8t4vvk5\av\

@FreemanZ
Copy link
Author

FreemanZ commented Apr 13, 2018

ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100

@mikeboers
Copy link
Member

If this were Linux, I'd say that it was very likely that PyAV was trying to link against the static libraries instead of dynamic.

I'm not familiar with Windows build problems. You closed the issue, which I hope means you solved it. What was it?

@joshferns
Copy link

@FreemanZ how did you eventually solve this?
I'm stuck at the same error.

@kesaroid
Copy link

kesaroid commented Feb 5, 2019

libraries: [b'avformat', b'avcodec', b'avdevice', b'avutil', b'avfilter', b'swscale', b'swresample']

I am getting LINK : fatal error LNK1181: cannot open input file 'swscale.lib' of most of these. How did @FreemanZ solve this?

@tschoepflin
Copy link

I was able to get past this by downloading the correct version of FFMPEG ("dev"), which has folders "include" and "lib". These are necessary to do the build.

I got this error when I was pointing to a folder containing the static executable and looking back, of course that won't work.

@Res260
Copy link

Res260 commented Apr 23, 2020

With @tschoepflin 's comment, I was able to install av with pip install av. It can be downloaded here: https://ffmpeg.zeranoe.com/builds/

I needed to put the content of the include directory in <PYTHON_DIRECTORY>/include and the content of the lib directory in <PYTHON_DIRECTORY>/libs (don't forget the s). The build was then successful.

@quentin-dietz
Copy link

The zeranoe website appears to be offline, however archive.org has a copy which allows you to download the builds:

https://web.archive.org/web/20200918191847/https://ffmpeg.zeranoe.com/builds/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants