Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ on:
types: [published]
workflow_dispatch:
jobs:
package-source:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build source package
run: |
pip install setuptools cython
python scripts/fetch-vendor.py --config-file scripts/ffmpeg-7.1.json /tmp/vendor
PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig python setup.py sdist
- name: Upload source package
uses: actions/upload-artifact@v4
with:
name: dist-source
path: dist/

package-wheel:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -64,7 +82,7 @@ jobs:

publish:
runs-on: ubuntu-latest
needs: [package-wheel]
needs: [package-source, package-wheel]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand Down
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include *.txt *.md
recursive-include av *.pyx *.pxd
recursive-include docs *.rst *.py
recursive-include examples *.py
recursive-include include *.pxd *.h
recursive-include src/av *.c *.h
recursive-include tests *.py
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,23 @@ conda install av -c conda-forge
See the [Conda install][conda-install] docs to get started with (mini)Conda.


Alternative installation methods
--------------------------------

Due to the complexity of the dependencies, PyAV is not always the easiest Python package to install from source. If you want to use your existing ffmpeg (must be the correct major version), the source version of PyAV is on [PyPI][pypi]:

> [!WARNING]
> You must be in a posix env, and have the correct version of ffmpeg installed on your system.

```bash
pip install av --no-binary av
```


Installing From Source
----------------------

Here's how to build PyAV from source source. You must use [MSYS2](https://www.msys2.org/) when using Windows.
Here's how to build PyAV from source. You must use [MSYS2](https://www.msys2.org/) when using Windows.

```bash
git clone https://github.com/PyAV-Org/PyAV.git
Expand Down
55 changes: 55 additions & 0 deletions docs/overview/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,61 @@ Another way to install PyAV is via `conda-forge <https://conda-forge.github.io>`
See the `Conda quick install <https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html>`_ docs to get started with (mini)Conda.


Bring your own FFmpeg
---------------------

PyAV can also be compiled against your own build of FFmpeg (version ``7.0`` or higher). You can force installing PyAV from source by running:

.. code-block:: bash
pip install av --no-binary av
PyAV depends upon several libraries from FFmpeg:

- ``libavcodec``
- ``libavdevice``
- ``libavfilter``
- ``libavformat``
- ``libavutil``
- ``libswresample``
- ``libswscale``

and a few other tools in general:

- ``pkg-config``
- Python's development headers


MacOS
^^^^^

On **MacOS**, Homebrew_ saves the day::

brew install ffmpeg pkg-config

.. _homebrew: http://brew.sh/


Ubuntu >= 18.04 LTS
^^^^^^^^^^^^^^^^^^^

On **Ubuntu 18.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 libswresample-dev libavfilter-dev


Windows
^^^^^^^

It is possible to build PyAV on Windows without Conda by installing FFmpeg yourself, e.g. from the `shared and dev packages <https://ffmpeg.zeranoe.com/builds/>`_.

Unpack them somewhere (like ``C:\ffmpeg``), and then :ref:`tell PyAV where they are located <build_on_windows>`.


Building from the latest source
-------------------------------

Expand Down
Loading