-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into histogram-luma-detector
- Loading branch information
Showing
32 changed files
with
541 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: 'Setup FFmpeg' | ||
inputs: | ||
github-token: | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup FFmpeg (latest) | ||
id: latest | ||
continue-on-error: true | ||
uses: FedericoCarboni/setup-ffmpeg@v3 | ||
with: | ||
github-token: ${{ inputs.github-token }} | ||
|
||
- name: Setup FFmpeg (7.0.0) | ||
if: ${{ steps.latest.outcome == 'failure' }} | ||
id: v7-0-0 | ||
continue-on-error: true | ||
uses: FedericoCarboni/setup-ffmpeg@v3 | ||
with: | ||
github-token: ${{ inputs.github-token }} | ||
ffmpeg-version: "7.0.0" | ||
|
||
- name: Setup FFmpeg (6.1.1) | ||
if: ${{ steps.v7-0-0.outcome == 'failure' }} | ||
id: v6-1-1 | ||
continue-on-error: true | ||
uses: FedericoCarboni/setup-ffmpeg@v3 | ||
with: | ||
github-token: ${{ inputs.github-token }} | ||
ffmpeg-version: "6.1.1" | ||
|
||
# The oldest version we allow falling back to must not have `continue-on-error: true` | ||
- name: Setup FFmpeg (6.1.0) | ||
if: ${{ steps.v6-1-1.outcome == 'failure' }} | ||
id: v6-1-0 | ||
uses: FedericoCarboni/setup-ffmpeg@v3 | ||
with: | ||
github-token: ${{ inputs.github-token }} | ||
ffmpeg-version: "6.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,11 +30,14 @@ jobs: | |
matrix: | ||
python-version: ["3.9"] | ||
|
||
env: | ||
ffmpeg-version: "7.0" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
@@ -50,16 +53,16 @@ jobs: | |
git fetch --depth=1 https://github.com/Breakthrough/PySceneDetect.git refs/heads/resources:refs/remotes/origin/resources | ||
git checkout refs/remotes/origin/resources -- tests/resources/ | ||
- name: Download FFMPEG | ||
- name: Download FFMPEG ${{ env.ffmpeg-version }} | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'GyanD/codexffmpeg' | ||
version: 'tags/6.0' | ||
file: 'ffmpeg-6.0-full_build.7z' | ||
version: 'tags/${{ env.ffmpeg-version }}' | ||
file: 'ffmpeg-${{ env.ffmpeg-version }}-full_build.7z' | ||
|
||
- name: Unit Test | ||
run: | | ||
7z e ffmpeg-6.0-full_build.7z ffmpeg.exe -r | ||
7z e ffmpeg-${{ env.ffmpeg-version }}-full_build.7z ffmpeg.exe -r | ||
python -m pytest -vv | ||
- name: Build PySceneDetect | ||
|
@@ -77,7 +80,7 @@ jobs: | |
Move-Item -Path dist/windows/README* -Destination dist/scenedetect/ | ||
Move-Item -Path dist/windows/LICENSE* -Destination dist/scenedetect/thirdparty/ | ||
Move-Item -Path scenedetect/_thirdparty/LICENSE* -Destination dist/scenedetect/thirdparty/ | ||
7z e -odist/ffmpeg ffmpeg-6.0-full_build.7z LICENSE -r | ||
7z e -odist/ffmpeg ffmpeg-${{ env.ffmpeg-version }}-full_build.7z LICENSE -r | ||
Move-Item -Path ffmpeg.exe -Destination dist/scenedetect/ffmpeg.exe | ||
Move-Item -Path dist/ffmpeg/LICENSE -Destination dist/scenedetect/thirdparty/LICENSE-FFMPEG | ||
|
@@ -95,7 +98,7 @@ jobs: | |
runs-on: windows-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: resources | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,22 +27,39 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-20.04, ubuntu-latest, windows-latest] | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
os: [macos-13, macos-14, ubuntu-20.04, ubuntu-latest, windows-latest] | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
exclude: | ||
# macos-14 builders use M1 (ARM64) which does not have a Python 3.7 package available. | ||
- os: macos-14 | ||
python-version: "3.7" | ||
|
||
env: | ||
# Version is extracted below and used to find correct package install path. | ||
scenedetect_version: "" | ||
# Setuptools must be pinned for the Python 3.7 builders. | ||
setuptools_version: "${{ matrix.python-version == '3.7' && '==62.3.4' || '' }}" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup FFmpeg | ||
# TODO: This action currently does not work for non-x64 builders (e.g. macos-14): | ||
# https://github.com/federicocarboni/setup-ffmpeg/issues/21 | ||
if: ${{ runner.arch == 'X64' }} | ||
uses: ./.github/actions/setup-ffmpeg | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install Dependencies | ||
# TODO: `setuptools` is pinned for the Python 3.7 builder and can be unpinned when removed. | ||
run: | | ||
python -m pip install --upgrade pip build wheel virtualenv setuptools==62.3.4 | ||
python -m pip install --upgrade pip build wheel virtualenv setuptools${{ env.setuptools_version }} | ||
pip install av opencv-python-headless --only-binary :all: | ||
pip install -r requirements_headless.txt | ||
|
@@ -51,21 +68,6 @@ jobs: | |
git fetch --depth=1 https://github.com/Breakthrough/PySceneDetect.git refs/heads/resources:refs/remotes/origin/resources | ||
git checkout refs/remotes/origin/resources -- tests/resources/ | ||
# TODO: Cache this: https://github.com/actions/cache | ||
# TODO: Install ffmpeg/mkvtoolnix on all runners. | ||
- name: Download FFMPEG | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'GyanD/codexffmpeg' | ||
version: 'tags/6.0' | ||
file: 'ffmpeg-6.0-full_build.7z' | ||
|
||
- name: Extract FFMPEG | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
7z e ffmpeg-6.0-full_build.7z ffmpeg.exe -r | ||
- name: Unit Tests | ||
run: | | ||
python -m pytest -vv | ||
|
@@ -77,22 +79,13 @@ jobs: | |
python -m scenedetect -i tests/resources/testvideo.mp4 -b pyav time --end 2s | ||
python -m pip uninstall -y scenedetect | ||
- name: Build Documentation | ||
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
pip install -r docs/requirements.txt | ||
git mv docs docs_src | ||
sphinx-build -b singlehtml docs_src docs | ||
# TODO: Make the version extraction work on powershell so package smoke tests can run on Windows. | ||
- name: Build Package | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
shell: bash | ||
run: | | ||
python -m build | ||
echo "scenedetect_version=`python -c \"import scenedetect; print(scenedetect.__version__.replace('-', '.'))\"`" >> "$GITHUB_ENV" | ||
- name: Smoke Test Package (Source Dist) | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
run: | | ||
python -m pip install dist/scenedetect-${{ env.scenedetect_version }}.tar.gz | ||
scenedetect version | ||
|
@@ -101,7 +94,6 @@ jobs: | |
python -m pip uninstall -y scenedetect | ||
- name: Smoke Test Package (Wheel) | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
run: | | ||
python -m pip install dist/scenedetect-${{ env.scenedetect_version }}-py3-none-any.whl | ||
scenedetect version | ||
|
@@ -110,7 +102,7 @@ jobs: | |
python -m pip uninstall -y scenedetect | ||
- name: Upload Package | ||
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest' }} | ||
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: scenedetect-dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.