Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Breakthrough committed Apr 27, 2024
2 parents 5dbac1b + 954b732 commit dbd8455
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 34 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
matrix:
python-version: ["3.9"]

env:
ffmpeg-version: "7.0"

steps:
- uses: actions/checkout@v4

Expand All @@ -54,12 +57,12 @@ jobs:
uses: dsaltares/fetch-gh-release-asset@1.1.1
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
Expand All @@ -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
Expand Down
37 changes: 13 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,26 @@ jobs:
strategy:
matrix:
os: [macos-13, macos-14, ubuntu-20.04, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
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@v4

- uses: FedericoCarboni/setup-ffmpeg@v3
# 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' }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -45,7 +56,7 @@ jobs:

- name: Install Dependencies
run: |
python -m pip install --upgrade pip build wheel virtualenv setuptools
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
Expand All @@ -54,21 +65,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: ${{ runner.os == 'Windows' }}
uses: dsaltares/fetch-gh-release-asset@1.1.1
with:
repo: 'GyanD/codexffmpeg'
version: 'tags/6.0'
file: 'ffmpeg-6.0-full_build.7z'

- name: Extract FFMPEG
if: ${{ runner.os == 'Windows' }}
run: |
7z e ffmpeg-6.0-full_build.7z ffmpeg.exe -r
- name: Unit Tests
run: |
python -m pytest -vv
Expand All @@ -80,13 +76,6 @@ 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.12' && matrix.os == 'ubuntu-latest' }}
run: |
pip install -r docs/requirements.txt
git mv docs docs_src
sphinx-build -b singlehtml docs_src docs
- name: Build Package
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pip'

- name: Set Destination (Releases)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pip'

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion tests/test_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_fade_in_out_test_cases():
TestCase(
path=get_absolute_path("resources/fades.mp4"),
detector=ThresholdDetector(
threshold=12.0,
threshold=11.0,
method=ThresholdDetector.Method.FLOOR,
add_final_scene=True,
),
Expand Down
2 changes: 1 addition & 1 deletion website/pages/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Releases

#### Release Notes

Includes new histogram and perceptual hash based detectors (thanks @wjs018 and @ash2703), adds flash filter to content detector, and includes various bugfixes. Minimum supported Python version is now **Python 3.8**.
Includes new histogram and perceptual hash based detectors (thanks @wjs018 and @ash2703), adds flash filter to content detector, and includes various bugfixes.

#### Changelog

Expand Down

0 comments on commit dbd8455

Please sign in to comment.