diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index b9305634..60bee42e 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -67,11 +67,13 @@ jobs: - name: Build PySceneDetect run: | + python dist/pre_release.py --ignore-installer pyinstaller dist/scenedetect.spec - name: Build Documentation run: | sphinx-build -b singlehtml docs dist/scenedetect/docs + rm -r dist/scenedetect/docs/.doctrees - name: Assemble Portable Distribution run: | diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index c3adbc9d..1f9d2590 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -16,7 +16,7 @@ jobs: env: # TODO: Figure out a better way to handle figuring out what version /latest should be, # e.g. add a latest version file in main. - scenedetect_docs_latest: '0.6.3' + scenedetect_docs_latest: '0.6.4' scenedetect_docs_dest: '' steps: diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..748d4dbf --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,12 @@ +cff-version: 1.2.0 +title: PySceneDetect +message: www.scenedetect.com +type: software +authors: + - given-names: Brandon + family-names: Castellano + affiliation: www.bcastell.com +repository-code: 'https://github.com/Breakthrough/PySceneDetect' +url: 'https://www.scenedetect.com' +abstract: Video Cut Detection and Analysis Tool +license: BSD-3-Clause diff --git a/LICENSE b/LICENSE index 59b46506..b8110e2f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,103 +1,28 @@ -By downloading, copying, installing, or using this software, you agree -to the terms of this license, and those contained in the "Ancillary -Software Licenses" section below. If you do not agree to any of these -terms or licenses, do not download, install, copy, or use the software -or any other material included in in distribution. +BSD 3-Clause License ------------------------------------------------------------------------ - - PySceneDetect License (BSD 3-Clause) - < http://www.bcastell.com/projects/PySceneDetect > - -Copyright (C) 2014-2024, Brandon Castellano. -All rights reserved. +Copyright (C) 2024, Brandon Castellano Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------ - - Ancillary Software Licenses - -This software uses the following third-party open source libraries and -are released under the terms detailed below. By downloading, copying, -installing or using this software/tutorial, you agree to these terms. - ------------------------------------------------------------------------ - - -> click [Copyright (C) 2017, Armin Ronacher]: - This software uses OpenCV; see thirdparty/LICENSE-CLICK or visit: - [ http://click.pocoo.org/license/ ] - -> NumPy [Copyright (C) 2005-2016, Numpy Developers]: - This software uses Numpy; see thirdparty/LICENSE-NUMPY or visit: - [ http://www.numpy.org/license.html ] - -> OpenCV [Copyright (C) 2017, Itseez]: - This software uses OpenCV; see thirdparty/LICENSE-OPENCV or visit: - [ http://opencv.org/license.html ] - -> PyAV [Copyright (C) 2017, Mike Boers and others]: - This software uses PyAV; see thirdparty/LICENSE-PYAV or visit: - [ https://github.com/PyAV-Org/PyAV/blob/main/LICENSE.txt ] - -> pytest [Copyright (C) 2004-2017, Holger Krekel and others]: - This software uses pytest; see thirdparty/LICENSE-PYTEST or visit: - [ https://docs.pytest.org/en/latest/license.html ] - -> simpletable [Copyright (C) 2014-2019, Matheus Vieira Portela and others]: - This software uses simpletable; see thirdparty/LICENSE-SIMPLETABLE or visit: - [ https://github.com/matheusportela/simpletable/blob/master/LICENSE ] - -> tqdm [Copyright (C) 2013-2018, Casper da Costa-Luis, - Google Inc., and Noam Yorav-Raphael]: - This software uses tqdm; see thirdparty/LICENSE-TQDM or visit: - [ https://github.com/tqdm/tqdm/blob/master/LICENCE ] - - ------------------------------------------------------------------------ - -This software may also invoke FFmpeg or mkvmerge, if available. If required, -these programs can be obtained from following URLs: - - FFmpeg: [ https://ffmpeg.org/download.html ] - mkvmerge: [ https://mkvtoolnix.download/downloads.html ] - -Once installed, ensure the program is in your PATH variable (i.e. you can -run the `ffmpeg` or `mkvmerge` command from any location). - -Certain distributions of PySceneDetect may include ffmpeg. See -thirdparty/LICENSE-FFMPEG file or visit [ https://ffmpeg.org ] - -FFmpeg is a trademark of Fabrice Bellard -mkvmerge is Copyright (C) 2005-2016, Matroska - -Windows distributions may include a compiled Python distribution. For license -information regarding the distributed version of Python, see the -thirdparty/LICENSE-PYTHON file, or visit [ https://docs.python.org/3/license.html ] diff --git a/README.md b/README.md index 7c928677..b47d7c86 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![PySceneDetect](https://raw.githubusercontent.com/Breakthrough/PySceneDetect/main/website/pages/img/pyscenedetect_logo_small.png) ========================================================== -Video Scene Cut Detection and Analysis Tool +Video Cut Detection and Analysis Tool ---------------------------------------------------------- [![Build Status](https://img.shields.io/github/actions/workflow/status/Breakthrough/PySceneDetect/build.yml)](https://github.com/Breakthrough/PySceneDetect/actions) @@ -11,7 +11,7 @@ Video Scene Cut Detection and Analysis Tool ---------------------------------------------------------- -### Latest Release: v0.6.3 (March 9, 2024) +### Latest Release: v0.6.4 (June 10, 2024) **Website**: [scenedetect.com](https://www.scenedetect.com) @@ -102,7 +102,7 @@ See [the documentation](https://www.scenedetect.com/docs/latest/api.html) for mo - [Documentation](https://www.scenedetect.com/docs/) (covers application and Python API) - [CLI Example](https://www.scenedetect.com/cli/) - - [Config File](https://www.scenedetect.com/docs/0.6.3/cli/config_file.html) + - [Config File](https://www.scenedetect.com/docs/0.6.4/cli/config_file.html) ## Help & Contributing @@ -117,7 +117,9 @@ This program uses free code signing provided by [SignPath.io](https://signpath.i ## License -Licensed under BSD 3-Clause (see the `LICENSE` file for details). +BSD-3-Clause; see [`LICENSE`](LICENSE) and [`THIRD-PARTY.md`](THIRD-PARTY.md) for details. + +---------------------------------------------------------- Copyright (C) 2014-2024 Brandon Castellano. All rights reserved. diff --git a/THIRD-PARTY.md b/THIRD-PARTY.md new file mode 100644 index 00000000..959c2e4f --- /dev/null +++ b/THIRD-PARTY.md @@ -0,0 +1,75 @@ +# Ancillary Software Licenses + +This file includes license information for various open-source projects +that are imported, derived into, or distributed with PySceneDetect. +See [LICENSE](LICENSE) for the main PySceneDetect license. + +Depending on the features being used, PySceneDetect uses the following +third-party software which are released under the terms detailed below. +By downloading, copying, installing or using this software, you agree +to these terms. + +In no particular order: + +----------------------------------------------------------------------- + +> click [Copyright (C) 2017, Armin Ronacher]: + This software uses OpenCV; see thirdparty/LICENSE-CLICK or visit: + [ http://click.pocoo.org/license/ ] + +> NumPy [Copyright (C) 2005-2016, Numpy Developers]: + This software uses Numpy; see thirdparty/LICENSE-NUMPY or visit: + [ http://www.numpy.org/license.html ] + +> OpenCV [Copyright (C) 2017, Itseez]: + This software uses OpenCV; see thirdparty/LICENSE-OPENCV or visit: + [ http://opencv.org/license.html ] + +> PyAV [Copyright (C) 2017, Mike Boers and others]: + This software uses PyAV; see thirdparty/LICENSE-PYAV or visit: + [ https://github.com/PyAV-Org/PyAV/blob/main/LICENSE.txt ] + +> pytest [Copyright (C) 2004-2017, Holger Krekel and others]: + This software uses pytest; see thirdparty/LICENSE-PYTEST or visit: + [ https://docs.pytest.org/en/latest/license.html ] + +> simpletable [Copyright (C) 2014-2019, Matheus Vieira Portela and others]: + This software uses simpletable; see thirdparty/LICENSE-SIMPLETABLE or visit: + [ https://github.com/matheusportela/simpletable/blob/master/LICENSE ] + +> tqdm [Copyright (C) 2013-2018, Casper da Costa-Luis, + Google Inc., and Noam Yorav-Raphael]: + This software uses tqdm; see thirdparty/LICENSE-TQDM or visit: + [ https://github.com/tqdm/tqdm/blob/master/LICENCE ] + +> MoviePy [ Copyright (C) 2015 Zulko ] + This software uses tqdm; see thirdparty/LICENSE-TQDM or visit: + [ https://github.com/Zulko/moviepy/blob/master/LICENCE.txt ] + +----------------------------------------------------------------------- + +This software may also invoke FFmpeg or mkvmerge, if available. If required, +these programs can be obtained from following URLs: + + FFmpeg: [ https://ffmpeg.org/download.html ] + mkvmerge: [ https://mkvtoolnix.download/downloads.html ] + +Once installed, ensure the program is in your PATH variable (i.e. you can +run the `ffmpeg` or `mkvmerge` command from any location). + +Certain distributions of PySceneDetect may include ffmpeg. See +thirdparty/LICENSE-FFMPEG file or visit [ https://ffmpeg.org ] + +FFmpeg is a trademark of Fabrice Bellard +mkvmerge is Copyright (C) 2005-2016, Matroska + +Windows distributions may include a compiled Python distribution. For license +information regarding the distributed version of Python, see the +thirdparty/LICENSE-PYTHON file, or visit [ https://docs.python.org/3/license.html ] + +----------------------------------------------------------------------- + +If any information above is incorrect, please let us know. +Visit [ https://www.scenedetect.com ] for contact information. + + diff --git a/appveyor.yml b/appveyor.yml index e7eb4c07..72c6a84f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,8 +35,8 @@ install: - 'SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%' - python --version - python -m pip install --upgrade pip - - python -m pip install -r dist/requirements_windows.txt - python -m pip install -r docs/requirements.txt + - python -m pip install --upgrade -r dist/requirements_windows.txt # Checkout build resources and third party software used for testing. - git checkout refs/remotes/origin/resources -- dist/ - appveyor DownloadFile https://github.com/GyanD/codexffmpeg/releases/download/6.0/ffmpeg-6.0-full_build.7z @@ -46,6 +46,7 @@ install: - echo * * BUILDING WINDOWS EXE * * - echo * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # Build Windows .EXE and create portable .ZIP + - python dist/pre_release.py - pyinstaller dist/scenedetect.spec - sphinx-build -b singlehtml docs dist/scenedetect/docs - mkdir dist\scenedetect\thirdparty @@ -68,7 +69,7 @@ install: - appveyor-tools\secure-file -decrypt license65.dat.enc -secret %ai_license_secret% -salt %ai_license_salt% - appveyor DownloadFile https://www.advancedinstaller.com/downloads/advinst.msi - msiexec /i advinst.msi /qn - - 'SET PATH=%PATH%;C:\\Program Files (x86)\\Caphyon\\Advanced Installer 21.5\\bin\\x86' + - 'SET PATH=%PATH%;C:\\Program Files (x86)\\Caphyon\\Advanced Installer 21.8.1\\bin\\x86' # License path must be absolute - AdvancedInstaller.com /RegisterOffline "%cd%\license65.dat" # Create MSI installer diff --git a/dist/installer/PySceneDetect.aip b/dist/installer/PySceneDetect.aip index 12a00714..00d73f4d 100644 --- a/dist/installer/PySceneDetect.aip +++ b/dist/installer/PySceneDetect.aip @@ -1,8 +1,5 @@ - - - - + @@ -26,10 +23,10 @@ - + - + @@ -50,11 +47,9 @@ - - @@ -62,11 +57,10 @@ - - + @@ -81,7 +75,7 @@ - + @@ -101,7 +95,7 @@ - + @@ -146,8 +140,8 @@ - - + + @@ -212,12 +206,12 @@ - + - + @@ -232,7 +226,6 @@ - @@ -277,8 +270,6 @@ - - @@ -328,8 +319,7 @@ - - + @@ -352,22 +342,6 @@ - - - - - - - - - - - - - - - - @@ -525,18 +499,10 @@ - - - - - - - - @@ -586,6 +552,13 @@ + + + + + + + @@ -601,7 +574,7 @@ - + @@ -629,9 +602,9 @@ - - - + + + @@ -736,9 +709,6 @@ - - - @@ -837,11 +807,8 @@ - - - @@ -856,6 +823,8 @@ + + @@ -961,7 +930,7 @@ - + diff --git a/dist/.version_info b/dist/pre_release.py similarity index 55% rename from dist/.version_info rename to dist/pre_release.py index 03778c42..d7fc6735 100644 --- a/dist/.version_info +++ b/dist/pre_release.py @@ -1,6 +1,30 @@ -# UTF-8 -# -# TODO: Generate this using Python. +# -*- coding: utf-8 -*- +import os +import sys +sys.path.append(os.path.abspath(".")) + +import scenedetect +VERSION = scenedetect.__version__ + +if len(sys.argv) <= 2 or not ("--ignore-installer" in sys.argv): + installer_aip = '' + with open("dist/installer/PySceneDetect.aip", "r") as f: + installer_aip = f.read() + +aip_version = f"" + +assert aip_version in installer_aip, f"Installer project version does not match {VERSION}." + +with open("dist/.version_info", "wb") as f: + v = VERSION.split(".") + assert 2 <= len(v) <= 3, f"Unrecognized version format: {VERSION}" + + if len(v) == 3: + (maj, min, pat) = int(v[0]), int(v[1]), int(v[2]) + else: + (maj, min, pat) = int(v[0]), int(v[1]), 0 + + f.write(f"""# UTF-8 # # For more details about fixed file info 'ffi' see: # http://msdn.microsoft.com/en-us/library/ms646997.aspx @@ -8,8 +32,8 @@ ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. -filevers=(0, 6, 3, 0), -prodvers=(0, 6, 3, 0), +filevers=(0, {maj}, {min}, {pat}), +prodvers=(0, {maj}, {min}, {pat}), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x3f, # Contains a bitmask that specifies the Boolean attributes of the file. @@ -33,13 +57,14 @@ u'040904B0', [StringStruct(u'CompanyName', u'github.com/Breakthrough'), StringStruct(u'FileDescription', u'www.scenedetect.com'), - StringStruct(u'FileVersion', u'v0.6.3'), + StringStruct(u'FileVersion', u'{VERSION}'), StringStruct(u'InternalName', u'PySceneDetect'), StringStruct(u'LegalCopyright', u'Copyright © 2024 Brandon Castellano'), StringStruct(u'OriginalFilename', u'scenedetect.exe'), StringStruct(u'ProductName', u'PySceneDetect'), - StringStruct(u'ProductVersion', u'v0.6.3')]) + StringStruct(u'ProductVersion', u'{VERSION}')]) ]), VarFileInfo([VarStruct(u'Translation', [1033, 1200])]) ] ) +""".encode()) diff --git a/dist/requirements_windows.txt b/dist/requirements_windows.txt index 644aea37..a4b1f675 100644 --- a/dist/requirements_windows.txt +++ b/dist/requirements_windows.txt @@ -2,7 +2,7 @@ av==10.0 click>=8.0 numpy -opencv-python-headless==4.8.0.74 +opencv-python-headless==4.10.0.82 platformdirs pyinstaller pytest diff --git a/docs/api.rst b/docs/api.rst index b08d1c7c..7271b42c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -85,7 +85,7 @@ Now that we know where each scene is, we can also :ref:`split the input video `_ file. +In the next example, we show how the library components can be used to create a more customizable scene cut/shot detection pipeline. Additional demonstrations/recipes can be found in the `tests/test_api.py `_ file. .. _scenedetect-detailed_example: @@ -115,7 +115,7 @@ Using a :class:`SceneManager ` directly For a more advanced example of using the PySceneDetect API to with a stats file (to save per-frame metrics to disk and/or speed up multiple passes of the same video), take a look at the :ref:`example in the SceneManager reference`. -In addition to module-level examples, demonstrations of some common use cases can be found in the `tests/test_api.py `_ file. +In addition to module-level examples, demonstrations of some common use cases can be found in the `tests/test_api.py `_ file. ======================================================================= @@ -156,4 +156,4 @@ PySceneDetect outputs messages to a logger named ``pyscenedetect`` which does no Migrating From 0.5 ======================================================================= -PySceneDetect 0.6 introduces several breaking changes which are incompatible with 0.5. See :ref:`Migration Guide ` for details on how to update your application. In addition, demonstrations of common use cases can be found in the `tests/test_api.py `_ file. +PySceneDetect 0.6 introduces several breaking changes which are incompatible with 0.5. See :ref:`Migration Guide ` for details on how to update your application. In addition, demonstrations of common use cases can be found in the `tests/test_api.py `_ file. diff --git a/docs/api/migration_guide.rst b/docs/api/migration_guide.rst index c4c51b0b..f24baefa 100644 --- a/docs/api/migration_guide.rst +++ b/docs/api/migration_guide.rst @@ -5,7 +5,7 @@ Migration Guide --------------------------------------------------------------- -This page details how to transition a program written using PySceneDetect 0.5 to the new 0.6 API. It is recommended to review the new :ref:`Quickstart ` and :ref:`Example ` sections first, as they should cover the majority of use cases. Also see `tests/test_api.py `_ for a set of demonstrations covering many high level use cases. +This page details how to transition a program written using PySceneDetect 0.5 to the new 0.6 API. It is recommended to review the new :ref:`Quickstart ` and :ref:`Example ` sections first, as they should cover the majority of use cases. Also see `tests/test_api.py `_ for a set of demonstrations covering many high level use cases. PySceneDetect v0.6 is a major step towards a more stable and simplified API. The biggest change to existing workflows is how video input is handled, and that Python 3.6 or above is now required. diff --git a/docs/cli/config_file.rst b/docs/cli/config_file.rst index ff354687..95fd9135 100644 --- a/docs/cli/config_file.rst +++ b/docs/cli/config_file.rst @@ -60,7 +60,7 @@ Example Template ======================================================================= -This template shows every possible configuration option and default values. It can be used as a ``scenedetect.cfg`` file. You can also `download it from Github `_. +This template shows every possible configuration option and default values. It can be used as a ``scenedetect.cfg`` file. You can also `download it from Github `_. .. literalinclude:: ../../scenedetect.cfg :language: ini diff --git a/scenedetect.cfg b/scenedetect.cfg index 248c37c5..bde791de 100644 --- a/scenedetect.cfg +++ b/scenedetect.cfg @@ -119,8 +119,8 @@ [detect-hash] -# Threshold value from 0.0 and 1.0 representing the normalized difference between -# perceptual hashes that is required to trigger a shot change. +# Threshold between 0.0 and 1.0 to set the relative difference between +# hashes required to trigger a shot change. Lower values are more sensitive. #threshold = 0.395 # The ratio between 1 and 256 of how much low frequency information to keep. @@ -137,11 +137,10 @@ [detect-hist] -# Threshold value from 0.0 to 1.0 representing the difference between Y channel -# histograms after frame is converted to YUV. Values closer to 1.0 require higher -# correlation (more similar to current frame), while lower values allow lower -# correlation (higher difference between current frame). -#threshold = 0.95 +# Threshold between 0.0 to 1.0 to set the relative difference between Y +# channel histograms (YUV) required to trigger a shot change. Lower values +# are more sensitive. +#threshold = 0.05 # Number of bins between 1 and 256 to use for the histogram. #bins = 256 diff --git a/scenedetect/__init__.py b/scenedetect/__init__.py index ad26d9c6..160bee61 100644 --- a/scenedetect/__init__.py +++ b/scenedetect/__init__.py @@ -47,7 +47,7 @@ # Used for module identification and when printing version & about info # (e.g. calling `scenedetect version` or `scenedetect about`). -__version__ = '0.7-dev0' +__version__ = '0.6.4' init_logger() logger = getLogger('pyscenedetect') diff --git a/scenedetect/_cli/__init__.py b/scenedetect/_cli/__init__.py index 95f3e88a..1890b9b5 100644 --- a/scenedetect/_cli/__init__.py +++ b/scenedetect/_cli/__init__.py @@ -45,50 +45,33 @@ # About & copyright message string shown for the 'about' CLI command (scenedetect about). _ABOUT_STRING = """ Site: http://scenedetect.com/ -Docs: http://manual.scenedetect.com/ +Docs: https://www.scenedetect.com/docs/ Code: https://github.com/Breakthrough/PySceneDetect/ Copyright (C) 2014-2024 Brandon Castellano. All rights reserved. PySceneDetect is released under the BSD 3-Clause license. See the -included LICENSE file or visit the PySceneDetect website for details. +LICENSE file or visit [ https://www.scenedetect.com/copyright/ ]. This software uses the following third-party components: > NumPy [Copyright (C) 2018, Numpy Developers] > OpenCV [Copyright (C) 2018, OpenCV Team] > click [Copyright (C) 2018, Armin Ronacher] > simpletable [Copyright (C) 2014 Matheus Vieira Portela] + > PyAV [Copyright (C) 2017, Mike Boers and others] + > MoviePy [Copyright (C) 2015 Zulko] This software may also invoke the following third-party executables: > FFmpeg [Copyright (C) 2018, Fabrice Bellard] > mkvmerge [Copyright (C) 2005-2016, Matroska] -If included with your distribution of PySceneDetect, see the included -LICENSE-FFMPEG and LICENSE-MKVMERGE or visit: - [ https://scenedetect.com/copyright/ ] +Certain distributions of PySceneDetect may include ffmpeg. See +the included LICENSE-FFMPEG or visit [ https://ffmpeg.org ]. -FFmpeg and mkvmerge are distributed only with certain PySceneDetect -releases, in order to allow for automatic video splitting capability. -If they were not included with your distribution, they can usually be -installed from your operating system's package manager, or downloaded -from the following URLs: - - FFmpeg: [ https://ffmpeg.org/download.html ] - mkvmerge: [ https://mkvtoolnix.download/downloads.html ] - (Note that mkvmerge is a part of the mkvtoolnix package.) - -Once installed, ensure the respective program can be accessed from the -same location running PySceneDetect by calling the `ffmpeg` or -`mkvmerge` command from a terminal/command prompt. - -PySceneDetect will automatically use whichever program is available on -the computer, depending on the specified command-line options. - -Additionally, certain Windows distributions may include a compiled -Python distribution. For license information regarding the distributed -version of Python, see the included LICENSE-PYTHON file for details, -or visit the following URL: [ https://docs.python.org/3/license.html ] +Binary distributions of PySceneDetect include a compiled Python +distribution. See the included LICENSE-PYTHON file, or visit +[ https://docs.python.org/3/license.html ]. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. """ @@ -155,8 +138,8 @@ def _print_command_help(ctx: click.Context, command: click.Command): invoke_without_command=True, epilog="""Type "scenedetect [command] --help" for command usage. See https://scenedetect.com/docs/ for online docs.""" ) -# We cannot make this a required argument otherwise we will reject commands of the form -# `scenedetect help detect-content` or `scenedetect detect-content --help`. +# *NOTE*: Although input is required, we cannot mark it as `required=True`, otherwise we will reject +# commands of the form `scenedetect detect-content --help`. @click.option( '--input', '-i', @@ -767,7 +750,7 @@ def detect_hist_command(ctx: click.Context, threshold: Optional[float], bins: Op {scenedetect_with_video} detect-hist - {scenedetect_with_video} detect-hist --threshold 0.8 --size 64 --lowpass 3 + {scenedetect_with_video} detect-hist --threshold 0.1 --bins 240 """ assert isinstance(ctx.obj, CliContext) @@ -800,13 +783,13 @@ def detect_hist_command(ctx: click.Context, threshold: Optional[float], bins: Op (USER_CONFIG.get_help_string("detect-hash", "size"))) @click.option( "--lowpass", - "-h", + "-l", metavar="FRAC", type=click.IntRange(CONFIG_MAP["detect-hash"]["lowpass"].min_val, CONFIG_MAP["detect-hash"]["lowpass"].max_val), default=None, help=("How much high frequency information to filter from the DCT. 2 means keep lower 1/2 of " - "the frequency data, 4 means only keep 1/4, etc....%s" % + "the frequency data, 4 means only keep 1/4, etc...%s" % (USER_CONFIG.get_help_string("detect-hash", "lowpass")))) @click.option( "--min-scene-len", @@ -817,7 +800,7 @@ def detect_hist_command(ctx: click.Context, threshold: Optional[float], bins: Op help="Minimum length of any scene. Overrides global min-scene-len (-m) setting." " TIMECODE can be specified as exact number of frames, a time in seconds followed by s," " or a timecode in the format HH:MM:SS or HH:MM:SS.nnn.%s" % - ("" if USER_CONFIG.is_default("detect-hist", "min-scene-len") else USER_CONFIG.get_help_string( + ("" if USER_CONFIG.is_default("detect-hash", "min-scene-len") else USER_CONFIG.get_help_string( "detect-hash", "min-scene-len"))) @click.pass_context def detect_hash_command(ctx: click.Context, threshold: Optional[float], size: Optional[int], diff --git a/scenedetect/_cli/config.py b/scenedetect/_cli/config.py index 3407b2a5..99bc77f4 100644 --- a/scenedetect/_cli/config.py +++ b/scenedetect/_cli/config.py @@ -357,7 +357,7 @@ def format(self, timecode: FrameTimecode) -> str: }, 'global': { 'backend': ['opencv', 'pyav', 'moviepy'], - 'default-detector': ['detect-adaptive', 'detect-content', 'detect-threshold'], + 'default-detector': ['detect-adaptive', 'detect-content', 'detect-threshold', 'detect-hash', 'detect-hist'], 'downscale-method': [value.name.lower() for value in Interpolation], 'verbosity': ['debug', 'info', 'warning', 'error', 'none'], }, diff --git a/scenedetect/_thirdparty/LICENSE-MOVIEPY b/scenedetect/_thirdparty/LICENSE-MOVIEPY new file mode 100644 index 00000000..1f7d430a --- /dev/null +++ b/scenedetect/_thirdparty/LICENSE-MOVIEPY @@ -0,0 +1,28 @@ +MoviePy license +Copyright (c) 2015 Zulko + +URL: https://github.com/Zulko/moviepy/blob/master/LICENCE.txt + +----------------------------------------------------------------------- + +The MIT License (MIT) + +Copyright (c) 2015 Zulko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/website/pages/changelog.md b/website/pages/changelog.md index 6e49fb7e..6e58c1a9 100644 --- a/website/pages/changelog.md +++ b/website/pages/changelog.md @@ -4,15 +4,15 @@ Releases ## PySceneDetect 0.6 -### 0.6.4 (In Development) +### 0.6.4 (June 10, 2024) #### Release Notes Includes new histogram and perceptual hash based detectors (thanks @wjs018 and @ash2703), adds flash filter to content detector, and includes various bugfixes. Below shows the scores of the new detectors normalized against `detect-content` for comparison on a difficult segment with 3 cuts: -comparison of new detector scores +comparison of new detector scores -Thanks to everyone who contributed for their help and support! +Feedback on the new detection methods and their default values is most welcome. Thanks to everyone who contributed for their help and support! #### Changelog diff --git a/website/pages/cli.md b/website/pages/cli.md index d7800feb..8816dc62 100644 --- a/website/pages/cli.md +++ b/website/pages/cli.md @@ -192,7 +192,7 @@ A configuration file path can be specified using the `-c`/`--config` argument. P * Mac: * `~/Library/Preferences/PySceneDetect/scenedetect.cfg` -Run `scenedetect --help` to see the exact path on your system which will be used (it will be listed under the help text for the -c/--config option). You can [click here to download a `scenedetect.cfg` config file](https://raw.githubusercontent.com/Breakthrough/PySceneDetect/v0.6.3-release/scenedetect.cfg) to use as a template. Note that lines starting with a `#` are comments and will be ignored. The `scenedetect.cfg` template file is also available in the folder where PySceneDetect is installed. +Run `scenedetect --help` to see the exact path on your system which will be used (it will be listed under the help text for the -c/--config option). You can [click here to download a `scenedetect.cfg` config file](https://raw.githubusercontent.com/Breakthrough/PySceneDetect/v0.6.4-release/scenedetect.cfg) to use as a template. Note that lines starting with a `#` are comments and will be ignored. The `scenedetect.cfg` template file is also available in the folder where PySceneDetect is installed. Specifying a config file path using -c/--config overrides the user config file. Specifying values on the command line will override those values in the config file. @@ -228,7 +228,7 @@ quality = 80 num-images = 3 ``` -See the `scenedetect.cfg` file in the location you installed PySceneDetect or [download it from Github](https://raw.githubusercontent.com/Breakthrough/PySceneDetect/v0.6.3-release/scenedetect.cfg) for a complete listing of all configuration options. +See the `scenedetect.cfg` file in the location you installed PySceneDetect or [download it from Github](https://raw.githubusercontent.com/Breakthrough/PySceneDetect/v0.6.4-release/scenedetect.cfg) for a complete listing of all configuration options. ##   Video Splitting Requirements diff --git a/website/pages/docs.md b/website/pages/docs.md index b270cafa..c45123ba 100644 --- a/website/pages/docs.md +++ b/website/pages/docs.md @@ -4,6 +4,7 @@ ## Stable * [latest](latest/) + * [v0.6.4](0.6.4/) * [v0.6.3](0.6.3/) * [v0.6.2](0.6.2/) * [v0.6.1](0.6.1/) diff --git a/website/pages/download.md b/website/pages/download.md index f05dddf2..4d016e4b 100644 --- a/website/pages/download.md +++ b/website/pages/download.md @@ -20,10 +20,10 @@ PySceneDetect is available via `pip` as [the `scenedetect` package](https://pypi ## Windows Build (64-bit Only)  
-

Latest Release: v0.6.3

-

  Release Date:  March 9, 2024

-  Installer  (recommended)      -  Portable .zip      +

Latest Release: v0.6.4

+

  Release Date:  June 10, 2024

+  Installer  (recommended)      +  Portable .zip        Getting Started
diff --git a/website/pages/index.md b/website/pages/index.md index 6d7e41e9..2b13d5f7 100644 --- a/website/pages/index.md +++ b/website/pages/index.md @@ -2,7 +2,7 @@ PySceneDetect
-

  Latest Release: v0.6.3 (March 9, 2024)

+

  Latest Release: v0.6.4 (June 10, 2024)

  Download        Changelog        Documentation        Getting Started
See the changelog for the latest release notes and known issues. diff --git a/website/requirements.txt b/website/requirements.txt index 3c69294b..cd132c7f 100644 --- a/website/requirements.txt +++ b/website/requirements.txt @@ -1,2 +1,2 @@ mkdocs==1.5.2 -jinja2==3.1.3 +jinja2==3.1.4