Skip to content

Commit

Permalink
[dist] Update Windows Python/deps + Include MoviePy (#446)
Browse files Browse the repository at this point in the history
* [dist] Bump Windows build dependency versions

* [dist] Use Python 3.13 for Windows builds and include MoviePy.

* [cli] Add more info to version command

* [dist] Remove duplicate copy of ffmpeg in distribution.
  • Loading branch information
Breakthrough authored Nov 11, 2024
1 parent 770d514 commit 5bf97d7
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 14 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.13"]

env:
ffmpeg-version: "7.0"
IMAGEIO_FFMPEG_EXE: ""

steps:
- uses: actions/checkout@v4
Expand All @@ -44,8 +45,8 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip build wheel virtualenv setuptools
pip install -r dist/requirements_windows.txt
pip install -r docs/requirements.txt
pip install --upgrade -r dist/requirements_windows.txt --no-binary imageio-ffmpeg
- name: Download Resources
run: |
Expand All @@ -60,13 +61,15 @@ jobs:
file: 'ffmpeg-${{ env.ffmpeg-version }}-full_build.7z'

- name: Unit Test
shell: bash
run: |
7z e ffmpeg-${{ env.ffmpeg-version }}-full_build.7z ffmpeg.exe -r
echo "IMAGEIO_FFMPEG_EXE=`realpath ffmpeg.exe`" >> "$GITHUB_ENV"
python -m pytest -vv
- name: Build PySceneDetect
run: |
python dist/pre_release.py --ignore-installer
python dist/pre_release.py
pyinstaller dist/scenedetect.spec
- name: Build Documentation
Expand Down Expand Up @@ -117,5 +120,7 @@ jobs:
./build/scenedetect -i tests/resources/goldeneye.mp4 -b opencv detect-content time --end 10s
echo Test PyAV
./build/scenedetect -i tests/resources/goldeneye.mp4 -b pyav detect-content time --end 10s
echo Test moviepy
./build/scenedetect -i tests/resources/goldeneye.mp4 -b moviepy detect-content time --end 10s
echo Test split-video + ffmpeg
./build/scenedetect -i tests/resources/goldeneye.mp4 detect-content time --end 10s split-video
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ install:
- echo * * BUILDING WINDOWS EXE * *
- echo * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# Build Windows .EXE and create portable .ZIP
- python dist/pre_release.py
- python dist/pre_release.py --release
- pyinstaller dist/scenedetect.spec
- sphinx-build -b singlehtml docs dist/scenedetect/docs
- mkdir dist\scenedetect\thirdparty
Expand Down
20 changes: 18 additions & 2 deletions dist/pre_release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# -*- coding: utf-8 -*-
#
# PySceneDetect: Python-Based Video Scene Detector
# -------------------------------------------------------------------
# [ Site: https://scenedetect.com ]
# [ Docs: https://scenedetect.com/docs/ ]
# [ Github: https://github.com/Breakthrough/PySceneDetect/ ]
#
# Copyright (C) 2014-2024 Brandon Castellano <http://www.bcastell.com>.
# PySceneDetect is licensed under the BSD 3-Clause License; see the
# included LICENSE file, or visit one of the above pages for details.
#

# Pre-release script to run before invoking `pyinstaller`:
#
# python dist/pre_release.py
# pyinstaller dist/scenedetect.spec
#
import os
import sys
sys.path.append(os.path.abspath("."))
Expand All @@ -8,7 +24,7 @@

VERSION = scenedetect.__version__

run_version_check = ("--ignore-installer" not in sys.argv)
run_version_check = ("--release" in sys.argv)

if run_version_check:
installer_aip = ''
Expand Down
9 changes: 6 additions & 3 deletions dist/requirements_windows.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# PySceneDetect Requirements for Windows Build
av==10.0
av==13.1.0
click>=8.0
opencv-python-headless==4.10.0.84

imageio-ffmpeg
moviepy
numpy
opencv-python-headless==4.10.0.82
platformdirs
pyinstaller
pytest
tqdm
tqdm
4 changes: 1 addition & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# These are requirements only for the docs.
Sphinx == 7.0.1
opencv-python
numpy
av
8 changes: 6 additions & 2 deletions scenedetect/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,20 @@ def get_system_version_info() -> str:
Used for the `scenedetect version -a` command.
"""
output_template = "{:<12} {}"
output_template = "{:<16} {}"
line_separator = "-" * 60
not_found_str = "Not Installed"
out_lines = []

# System (Python, OS)
output_template = "{:<16} {}"
out_lines += ["System Info", line_separator]
out_lines += [
output_template.format(name, version)
for name, version in (
("OS", "%s" % platform.platform()),
("Python", "%d.%d.%d" % sys.version_info[0:3]),
("Python", "%s %s" % (platform.python_implementation(), platform.python_version())),
("Architecture", " + ".join(platform.architecture())),
)
]

Expand All @@ -317,6 +319,8 @@ def get_system_version_info() -> str:
"av",
"click",
"cv2",
"imageio",
"imageio_ffmpeg",
"moviepy",
"numpy",
"platformdirs",
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Topic :: Multimedia :: Video
Topic :: Multimedia :: Video :: Conversion
Topic :: Multimedia :: Video :: Non-Linear Editor
Expand Down
4 changes: 4 additions & 0 deletions website/pages/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,3 +589,7 @@ Development
- [bugfix] Fix `ContentDetector` crash when using callbacks [#416](https://github.com/Breakthrough/PySceneDetect/issues/416) [#420](https://github.com/Breakthrough/PySceneDetect/issues/420)
- [general] Timecodes of the form `MM:SS[.nnn]` are now processed correctly [#443](https://github.com/Breakthrough/PySceneDetect/issues/443)
- [api] The `save_to_csv` function now works correctly with paths from the `pathlib` module
- [general] Updates to Windows distributions:
- The MoviePy backend is now included with Windows distributions
- Bundled Python interpreter is now Python 3.13
- Updated PyAV 10 -> 13.1.0 and OpenCV 4.10.0.82 -> 4.10.0.84

0 comments on commit 5bf97d7

Please sign in to comment.