diff --git a/README.md b/README.md index 0da8ecdb..8115391c 100644 --- a/README.md +++ b/README.md @@ -4,33 +4,34 @@ Video Scene Cut Detection and Analysis Tool ---------------------------------------------------------- -[![Documentation Status](https://readthedocs.org/projects/pyscenedetect/badge/?version=latest)](http://pyscenedetect.readthedocs.org/en/latest/?badge=latest) [![PyPI Status](https://img.shields.io/pypi/status/PySceneDetect.svg)](https://pypi.python.org/pypi/PySceneDetect/) [![PyPI Version](https://img.shields.io/pypi/v/PySceneDetect.svg)](https://pypi.python.org/pypi/PySceneDetect/) [![PyPI License](https://img.shields.io/pypi/l/PySceneDetect.svg)](http://pyscenedetect.readthedocs.org/en/latest/copyright/) +[![Documentation Status](https://readthedocs.org/projects/pyscenedetect/badge/?version=latest)](http://pyscenedetect.readthedocs.org/en/latest/?badge=latest) [![PyPI Status](https://img.shields.io/pypi/status/scenedetect.svg)](https://pypi.python.org/pypi/scenedetect/) [![PyPI Version](https://img.shields.io/pypi/v/scenedetect.svg)](https://pypi.python.org/pypi/scenedetect/) [![PyPI License](https://img.shields.io/pypi/l/scenedetect.svg)](http://pyscenedetect.readthedocs.org/en/latest/copyright/) -### Latest Release: v0.5 (August ?, 2018) +### Latest Release: v0.5 (August 31, 2018) -**New**: The latest release of PySceneDetect adds precise splitting support via `ffmpeg`, an improved CLI interface, and a significantly improved and refactored Python API. Note that this release (v0.5) may break existing scripts and code using PySceneDetect. Those who install `v0.5-beta` can check out [the updated usage document](https://github.com/Breakthrough/PySceneDetect/blob/master/USAGE.md), or call `scenedetect help` from a terminal/console (`scenedetect.py help` if running the beta distribution locally). +**Main Webpage**: [py.scenedetect.com](http://py.scenedetect.com) -There is also newly created API documentation manual (CLI coming soon) for the `scenedetect` module, available at: +**Documentation**: [manual.scenedetect.com](http://manual.scenedetect.com) -[man.scenedetect.com](http://man.scenedetect.com/) +**Download/Install**: https://pyscenedetect.readthedocs.io/en/latest/download/ -There is an installer for Windows users that automatically installs all dependencies and the `scenedetect` command system wide (64-bit only currently) - **Latest Windows build is v0.4, Windows users who wish to upgrade can install from source in the meantime to get v0.5-beta-1**. This is the recommended installation method for Windows users now, and it can be found on [the Releases page](https://github.com/Breakthrough/PySceneDetect/releases). The Windows builds do not require an existing Python environment, nor any other prerequisites, but downloading `mkvmerge`/`ffmpeg` manually is still required for video splitting support. There is also a portable .zip version available. - -It is still recommended that both Linux and Mac users download the source distribution, following the Quick Install instructions below. +---------------------------------------------------------- -**Quick Install**: Requires Python modules `numpy`, OpenCV `cv2`, and (optional) `tqdm` for displaying progress. See [getting started guide](http://pyscenedetect.readthedocs.org/en/latest/examples/usage/) after install. After installing the prerequisites, download the latest source distribution from [the Releases page](https://github.com/Breakthrough/PySceneDetect/releases), extract the archive, and in a terminal/command prompt in the location of the extracted files, run: +**Quick Install**: Requires Python modules `numpy`, OpenCV `cv2`, and (optional) `tqdm` for displaying progress. To install PySceneDetect via `pip`: - sudo python setup.py install + pip install scenedetect To test if you have the required prerequisites, open a `python` prompt, and run the following: import numpy import cv2 -If both of those commands execute without any problems, you should be able to install PySceneDetect without any issues. To enable video splitting support, you will also need to have `mkvmerge` or `ffmpeg` installed on your system. +If both of those commands execute without any problems, you should be able to install PySceneDetect without any issues. To enable video splitting support, you will also need to have `mkvmerge` or `ffmpeg` installed on your system. See [getting started guide](http://pyscenedetect.readthedocs.org/en/latest/examples/usage/) after installation for details. + +Also see [the `USAGE.md` file](https://github.com/Breakthrough/PySceneDetect/blob/master/USAGE.md) for details on detection modes, default values/thresholds to try, and how to effectively choose the optimal detection parameters. Full documentation for PySceneDetect can be found [on Readthedocs](http://pyscenedetect.readthedocs.org/), or by visiting [py.scenedetect.com](http://py.scenedetect.com/). + +To install from source instead, download the latest release and call `python setup.py install` (see [the download page](https://pyscenedetect.readthedocs.io/en/latest/download/) for details. -See [the `USAGE.md` file](https://github.com/Breakthrough/PySceneDetect/blob/master/USAGE.md) for details on detection modes, default values/thresholds to try, and how to effectively choose the optimal detection parameters. Full documentation for PySceneDetect can be found [on Readthedocs](http://pyscenedetect.readthedocs.org/), or by visiting [py.scenedetect.com](http://py.scenedetect.com/). ---------------------------------------------------------- @@ -68,7 +69,7 @@ To ensure you have all the system requirements installed, open a `python` interp After installation, you can use PySceneDetect as the `scenedetect` command from any terminal/command prompt. To verify the installation, run the following command to display what version of PySceneDetect you have installed: - scenedetect --version + scenedetect version Usage diff --git a/USAGE.md b/USAGE.md index b4ef1469..f4662b74 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,6 +2,9 @@ PySceneDetect ========================================================== +For extended usage information, see [the PySceneDetect manual (manual.scenedetect.com)](http://manual.scenedetect.com). + + Usage (Command Line) ---------------------------------------------------------- diff --git a/docs/changelog.md b/docs/changelog.md index 66557d65..3cf724d7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,21 +2,24 @@ PySceneDetect Changelog ========================================================== -## 0.5 (In Development) - * under development currently, release planned for August 2018, v0.5-beta-1 available now - * major release, includes stable Python API with examples and updated documentation +## 0.5 (August 31, 2017)   + + * **major** release, includes stable Python API with examples and updated documentation + * numerous changes to command-line interface with addition of sub-commands (see [the new manual](http://manual.scenedetect.com) for updated usage information) + * [feature] videos are now split using `ffmpeg` by default, resulting in frame-perfect cuts (can still use `mkvmerge` by specifying the `-c`/`--copy` argument to the `split-video` command) * [enhance] image filename numbers are now consistent with those of split video scenes (PR #39, thanks [@e271828-](https://github.com/Breakthrough/PySceneDetect/pull/39)) * [enhance] 5-10% improvement in processing performance due to reduced memory copy operations (PR #40, thanks [@elcombato] (https://github.com/Breakthrough/PySceneDetect/pull/40)) - * [internal] updated exception handling to raise proper standard exceptions (PR #37, thanks [@talkain](https://github.com/Breakthrough/PySceneDetect/pull/37)) + * [enhance] updated exception handling to raise proper standard exceptions (PR #37, thanks [@talkain](https://github.com/Breakthrough/PySceneDetect/pull/37)) * several fixes to the documentation, including improper dates and outdated CLI arguments (PR #26 and #, thanks [@elcombato] (https://github.com/Breakthrough/PySceneDetect/pull/26), and [@colelawrence](https://github.com/Breakthrough/PySceneDetect/pull/33)) - * [other] move from BSD 2-clause to 3-clause license - * [enhance] add Sphinx-generated API documentation (available at: ) + * *numerous* other PRs and issues/bug reports that have been fixed - there are too many to list individually here, so I want to extend a big thank you to **everyone** who contributed to making this release better + * [enhance] add Sphinx-generated API documentation (available at: http://manual.scenedetect.com) + * [project] move from BSD 2-clause to 3-clause license -## 0.4 (January 14, 2017)   +## 0.4 (January 14, 2017) * major release, includes integrated scene splitting via mkvmerge, changes meaning of `-o` / `--output` option * [feature] specifying `-o OUTPUT_FILE.mkv` will now automatically split the input video, generating a new video clip for each detected scene in sequence, starting with `OUTPUT_FILE-001.mkv` diff --git a/docs/download.md b/docs/download.md index bc4dcf53..b64ec7ec 100644 --- a/docs/download.md +++ b/docs/download.md @@ -19,16 +19,22 @@ The Windows distribution of PySceneDetect is bundled with all required dependenc ### Python Installer (All Platforms, Requires Python)       +
-

Latest Release: v0.5-beta-1

-

  Release Date:  August 6, 2018

-  Source  .zip        Source  .tar.gz        Installation        Getting Started +

Latest Release: v0.5

+

  Release Date:  August 31, 2018

+  Source  .zip        Source  .tar.gz        Installation        Getting Started
-Once you've downloaded the source archive, extract it to a location of your choice, and make sure you have the appropriate [system requirements](#installing-dependencies) installed before continuing. PySceneDetect can be installed by running the following command in the location of the extracted files: +To install PySceneDetect using `pip`, make sure you have the appropriate [system requirements](#installing-dependencies) installed **before** installing the `scenedetect` package: +```md +pip install scenedetect +``` + +Otherwise, if installing from source, download and extract the latest release to a location of your choice, and make sure you have the appropriate [system requirements](#installing-dependencies) installed before continuing. PySceneDetect can be installed by running the following command in the location of the extracted files (don't forget `sudo`): ```md -sudo python setup.py install +python setup.py install ``` After installation, you can call PySceneDetect from any terminal/command prompt by typing `scenedetect` (try running `scenedetect version`, or `scenedetect --version` in v0.4 and prior, to verify that everything was installed correctly). diff --git a/docs/index.md b/docs/index.md index 8a8ba373..39e3a97a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,7 @@

Intelligent scene cut detection and video splitting tool.

-

  Latest Release: v0.5-beta-1 (August 6, 2018)

+

  Latest Release: v0.5 (August 31, 2018)

  Download        Changelog        Installation        Getting Started
@@ -13,12 +13,7 @@ This documentation refers to PySceneDetect v0.5, which has a new-and-improved co
http://man.scenedetect.com/
- -The beta version, PySceneDetect v0.5-beta-1 is now available as a source-only release. Users are encouraged to update to v0.5-beta-1 as soon as possible. When it is released, upgrading from the beta to the stable release of v0.5 will be seamless. -
Users still using the latest stable release (v0.4) can find the existing documentation for v0.4 here. - - **PySceneDetect** is a command-line application and a Python library for **detecting scene changes in videos**, and **automatically splitting the video into separate clips**. Not only is it free and open-source software (FOSS), but there are several detection methods available ([see Features](features.md)), from simple threshold-based fade in/out detection, to advanced content aware fast-cut detection of each shot. diff --git a/package-info.rst b/package-info.rst index 43d1615d..cd047121 100644 --- a/package-info.rst +++ b/package-info.rst @@ -4,7 +4,9 @@ PySceneDetect Video Scene Cut Detection and Analysis Tool ---------------------------------------------------------- -Documentation: http://pyscenedetect.readthedocs.org/ +Website: http://py.scenedetect.com/ + +Documentation: http://manual.scenedetect.com/ Github Repo: https://github.com/Breakthrough/PySceneDetect/ @@ -32,7 +34,7 @@ PySceneDetect is a command-line tool, written in Python and using OpenCV, which There are two main detection methods PySceneDetect uses: `detect-threshold` (comparing each frame to a set black level, useful for detecting cuts and fades to/from black), and `detect-content` (compares each frame sequentially looking for changes in content, useful for detecting fast cuts between video scenes, although slower to process). Each mode has slightly different parameters, and is described in detail in the documentation. -In general, use `detect-threshold` mode if you want to detect scene boundaries using fades/cuts in/out to black. If the video uses a lot of fast cuts between content, and has no well-defined scene boundaries, you should use the `detect-content` mode. Once you know what detection mode to use, you can try the parameters recommended below, or generate a statistics file (using the `-s` / `--statsfile` flag) in order to determine the correct paramters - specifically, the proper threshold value. +In general, use `detect-threshold` mode if you want to detect scene boundaries using fades/cuts in/out to black. If the video uses a lot of fast cuts between content, and has no well-defined scene boundaries, you should use the `detect-content` mode. Once you know what detection mode to use, you can try the parameters recommended below, or generate a statistics file (using the `-s` / `--stats` argument) in order to determine the correct paramters - specifically, the proper threshold value. For help or other issues, feel free to submit any bugs or feature requests to Github: https://github.com/Breakthrough/PySceneDetect/issues diff --git a/scenedetect/__init__.py b/scenedetect/__init__.py index 51346788..bc42c58f 100644 --- a/scenedetect/__init__.py +++ b/scenedetect/__init__.py @@ -59,7 +59,7 @@ # Used for module identification and when printing version & about info. # (scenedetect version and scenedetect about) -__version__ = 'v0.5-beta-1' +__version__ = 'v0.5' # About & copyright message string shown for the 'about' CLI command (scenedetect about). diff --git a/scenedetect/cli/__init__.py b/scenedetect/cli/__init__.py index d3695a8d..baee29e5 100644 --- a/scenedetect/cli/__init__.py +++ b/scenedetect/cli/__init__.py @@ -229,7 +229,7 @@ def duplicate_command(ctx, param_hint): is_flag=True, flag_value=True, help= 'Suppresses all output of PySceneDetect except for those from the specified' ' commands. Equivalent to setting `--verbosity none`. Overrides the current verbosity' - ' level, even if `-v`/`--verbosity` is specified.') + ' level, even if `-v`/`--verbosity` is set.') @click.pass_context def scenedetect_cli(ctx, input, output, framerate, downscale, frame_skip, stats, verbosity, logfile, quiet): @@ -578,7 +578,7 @@ def list_scenes_command(ctx, output, filename, no_output_file, quiet): 'Video compression quality preset (x264 preset). Can be one of: ultrafast, superfast,' ' veryfast, faster, fast, medium, slow, slower, and veryslow. Faster modes take less' ' time to run, but the output files may be larger.' - ' [default: veryfast, if -h/--high quality is set: slow]') + ' [default: veryfast, if -hq/--high quality is set: slow]') @click.pass_context def split_video_command(ctx, output, filename, high_quality, override_args, quiet, copy, rate_factor, preset): @@ -646,7 +646,7 @@ def split_video_command(ctx, output, filename, high_quality, override_args, quie 'Filename format, *without* extension, to use when saving image files. You can use the' ' $VIDEO_NAME, $SCENE_NUMBER, and $IMAGE_NUMBER macros in the file name.') @click.option( - '--num-images', '-n', metavar='N', default=2, #4, + '--num-images', '-n', metavar='N', default=3, type=click.INT, help= 'Number of images to generate. Will always include start/end frame,' ' unless N = 1, in which case the image will be the frame at the mid-point' diff --git a/scenedetect/cli/context.py b/scenedetect/cli/context.py index 01640c75..cce431e3 100644 --- a/scenedetect/cli/context.py +++ b/scenedetect/cli/context.py @@ -256,7 +256,10 @@ def get_output_file_path(self, file_path, output_dir=None): file_path = os.path.join(output_dir, file_path) # Now that file_path is an absolute path, let's make sure all the directories # exist for us to start writing files there. - os.makedirs(os.path.split(os.path.abspath(file_path))[0], exist_ok=True) + try: + os.makedirs(os.path.split(os.path.abspath(file_path))[0]) + except OSError: + pass return file_path def _open_stats_file(self): diff --git a/setup.py b/setup.py index d9fece63..c04ba9e4 100644 --- a/setup.py +++ b/setup.py @@ -55,8 +55,8 @@ def get_requires(include_opencv=False): setup( - name='PySceneDetect', - version='0.4.1', + name='scenedetect', + version='0.5', description="A cross-platform, OpenCV-based video scene detection program and Python library. ", long_description=open('package-info.rst').read(), author='Brandon Castellano',