diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9e4003b9..a6c5232b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..b87a010d3 --- /dev/null +++ b/MANIFEST.in @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 232fd6743..59e291c74 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/overview/installation.rst b/docs/overview/installation.rst index 8eb5ce553..5fa7fc860 100644 --- a/docs/overview/installation.rst +++ b/docs/overview/installation.rst @@ -21,6 +21,61 @@ Another way to install PyAV is via `conda-forge ` See the `Conda quick install `_ 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 `_. + +Unpack them somewhere (like ``C:\ffmpeg``), and then :ref:`tell PyAV where they are located `. + + Building from the latest source -------------------------------