Skip to content

Latest commit

 

History

History
132 lines (80 loc) · 2.78 KB

File metadata and controls

132 lines (80 loc) · 2.78 KB

Installation

Dependencies

PyAV depends upon the following components of the underlying libraries:

  • libavformat
  • libavcodec
  • libavdevice
  • libavutil
  • libswscale
  • libswresample or libavresample

and a few other tools in general:

  • pkg-config
  • Python's development headers

Mac OS X

On Mac OS X, Homebrew saves the day:

brew install ffmpeg pkg-config

Ubuntu 14.04 LTS

On Ubuntu 14.04 LTS everything can come from the default sources:

# General dependencies
sudo apt-get install -y python-dev pkg-config

# Library components
sudo apt-get install -y \
    libavformat-dev libavcodec-dev libavdevice-dev \
    libavutil-dev libswscale-dev libavresample-dev

Ubuntu 12.04 LTS

On Ubuntu 12.04 LTS you will be unable to satisfy these requirements with the default package sources. We recomment compiling and installing FFmpeg or Libav from source. For FFmpeg:

wget http://ffmpeg.org/releases/ffmpeg-2.7.tar.bz2
tar -xjf ffmpeg-2.7.tar.bz2
cd ffmpeg-2.7

./configure --disable-static --enable-shared --disable-doc
make
sudo make install

See this script for a very detailed installation of all dependencies.

PyAV

Via PyPI/CheeseShop

$ pip install av

Via Source

$ git clone git@github.com:mikeboers/PyAV.git
$ cd PyAV
$ virtualenv venv
$ . venv/bin/activate
$ pip install cython
$ python setup.py build_ext --inplace

On Mac OS X you may have issues with regards to Python expecting gcc but finding clang. Try to export the following before installation:

export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

On Windows

  1. Compile FFmpeg using the mingw64 compiler with shared libraries enabled.

  2. Make sure MinGW's GCC compiler is the first gcc found on the path. Important if you have Cygwin on the system as well.

  3. Set %PKG_CONFIG_PATH% to the location of FFmpeg's pkg-config files, e.g.:

    set PKG_CONFIG_PATH=c:\ffmpeg_build\lib\pkgconfig
    
  4. Copy the following ffmpeg libraries to the project's av folder:

    • avcodec-56.dll
    • avdevice-56.dll
    • avfilter-5.dll
    • avformat-56.dll
    • avutil-54.dll
    • postproc-53.dll
    • swresample-1.dll
    • swscale-3.dll

    Also copy the two dependent DLLs from mingw to the same folder:

    • libgcc_s_dw2-1.dll
    • libwinpthread-1.dll
  5. Build the project:

    make build-mingw32
    
  6. Create a self contained wheel archive that you can install on any machine:

    make wheel
    
  7. Install the package:

    pip install dist/av-0.2.3-cp27-none-win32.whl