Skip to content

Commit

Permalink
Build our wheels against FFmpeg 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Nov 3, 2023
1 parent d892dcf commit ca1e7f9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, python: 3.8, ffmpeg: "6.0"}
- {os: windows-latest, python: 3.8, ffmpeg: "5.1"}
- {os: windows-latest, python: 3.8, ffmpeg: "5.0"}

Expand All @@ -136,21 +137,14 @@ jobs:
pillow \
python=${{ matrix.config.python }} \
setuptools
if [[ "${{ matrix.config.ffmpeg }}" == "5.1" ]]; then
curl -L -o ffmpeg.tar.gz https://github.com/PyAV-Org/pyav-ffmpeg/releases/download/5.1.3-1/ffmpeg-win_amd64.tar.gz
elif [[ "${{ matrix.config.ffmpeg }}" == "5.0" ]]; then
curl -L -o ffmpeg.tar.gz https://github.com/PyAV-Org/pyav-ffmpeg/releases/download/5.0.1-1/ffmpeg-win_amd64.tar.gz
else
exit 1
fi
- name: Build
shell: bash
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate pyav
tar -xf ffmpeg.tar.gz -C $CONDA_PREFIX/Library/
python setup.py build_ext --inplace --ffmpeg-dir=$CONDA_PREFIX/Library
python scripts\\fetch-vendor.py --config-file scripts\\ffmpeg-${{ matrix.config.ffmpeg }}.json $CONDA_PREFIX\\Library
python setup.py build_ext --inplace --ffmpeg-dir=$CONDA_PREFIX\\Library
- name: Test
shell: bash
Expand All @@ -169,7 +163,7 @@ jobs:
- name: Build source package
run: |
pip install cython
python scripts/fetch-vendor.py /tmp/vendor
python scripts/fetch-vendor.py --config-file scripts/ffmpeg-6.0.json /tmp/vendor
PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig python setup.py sdist
- name: Upload source package
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -212,8 +206,8 @@ jobs:
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BEFORE_ALL_LINUX: yum install -y alsa-lib libxcb
CIBW_BEFORE_BUILD: pip install cython && python scripts/fetch-vendor.py /tmp/vendor
CIBW_BEFORE_BUILD_WINDOWS: pip install cython && python scripts\fetch-vendor.py C:\cibw\vendor
CIBW_BEFORE_BUILD: python scripts/fetch-vendor.py --config-file scripts/ffmpeg-6.0.json /tmp/vendor
CIBW_BEFORE_BUILD_WINDOWS: python scripts\fetch-vendor.py --config-file scripts\ffmpeg-6.0.json C:\cibw\vendor
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig
CIBW_ENVIRONMENT_MACOS: PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig LDFLAGS=-headerpad_max_install_names
CIBW_ENVIRONMENT_WINDOWS: INCLUDE=C:\\cibw\\vendor\\include LIB=C:\\cibw\\vendor\\lib PYAV_SKIP_TESTS=unicode_filename
Expand Down
7 changes: 3 additions & 4 deletions scripts/fetch-vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ def get_platform():
with open(args.config_file, "r") as fp:
config = json.load(fp)

# create fresh destination directory
# ensure destination directory exists
logging.info("Creating directory %s" % args.destination_dir)
if os.path.exists(args.destination_dir):
shutil.rmtree(args.destination_dir)
os.makedirs(args.destination_dir)
if not os.path.exists(args.destination_dir):
os.makedirs(args.destination_dir)

for url_template in config["urls"]:
tarball_url = url_template.replace("{platform}", get_platform())
Expand Down
3 changes: 3 additions & 0 deletions scripts/ffmpeg-5.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"urls": ["https://github.com/PyAV-Org/pyav-ffmpeg/releases/download/5.0.1-1/ffmpeg-{platform}.tar.gz"]
}
File renamed without changes.
3 changes: 3 additions & 0 deletions scripts/ffmpeg-6.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"urls": ["https://github.com/PyAV-Org/pyav-ffmpeg/releases/download/6.0.0-1/ffmpeg-{platform}.tar.gz"]
}

0 comments on commit ca1e7f9

Please sign in to comment.