diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index d1eea8a2..39d8eabb 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -30,6 +30,9 @@ jobs: matrix: python-version: ["3.9"] + env: + ffmpeg-version: "7.0" + steps: - uses: actions/checkout@v4 @@ -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 @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c12e41de..ba9aefc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 @@ -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 @@ -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: | diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 1ceac1e5..c3adbc9d 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -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) diff --git a/.github/workflows/generate-website.yml b/.github/workflows/generate-website.yml index a3221de4..328ac2cc 100644 --- a/.github/workflows/generate-website.yml +++ b/.github/workflows/generate-website.yml @@ -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 diff --git a/tests/test_detectors.py b/tests/test_detectors.py index 42f46cbf..38152b01 100644 --- a/tests/test_detectors.py +++ b/tests/test_detectors.py @@ -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, ), diff --git a/website/pages/changelog.md b/website/pages/changelog.md index 3b66ce36..45b27215 100644 --- a/website/pages/changelog.md +++ b/website/pages/changelog.md @@ -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