Skip to content

Commit

Permalink
Change PyPI project from "PySceneDetect" to "scenedetect".
Browse files Browse the repository at this point in the history
Release v0.5.
Fix bug with incompatibility and Python 2.7 from makedirs.
  • Loading branch information
Breakthrough committed Aug 31, 2018
1 parent f7b126e commit 901cf5c
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 40 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

----------------------------------------------------------

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
PySceneDetect
==========================================================

For extended usage information, see [the PySceneDetect manual (manual.scenedetect.com)](http://manual.scenedetect.com).


Usage (Command Line)
----------------------------------------------------------

Expand Down
17 changes: 10 additions & 7 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) &nbsp;<span class="fa fa-tags"></span>

* **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) &nbsp;<span class="fa fa-tags"></span>
## 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`
Expand Down
16 changes: 11 additions & 5 deletions docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,22 @@ The Windows distribution of PySceneDetect is bundled with all required dependenc

### Python Installer (All Platforms, Requires Python) &nbsp; <span class="wy-text-neutral"><span class="fa fa-windows"></span> &nbsp; <span class="fa fa-linux"></span> &nbsp; <span class="fa fa-apple"></span></span></h3>


<div class="important">
<h3 class="wy-text-neutral"><span class="fa fa-forward wy-text-info"></span> Latest Release: <b class="wy-text-neutral">v0.5-beta-1</b></h3>
<h4 class="wy-text-neutral"><span class="fa fa-calendar wy-text-info"></span>&nbsp; Release Date:&nbsp; <b>August 6, 2018</b></h4>
<a href="https://github.com/Breakthrough/PySceneDetect/archive/v0.5-beta-1.zip" class="btn btn-info" style="margin-bottom:8px;" role="button"><span class="fa fa-download"></span>&nbsp; <b>Source</b>&nbsp;&nbsp;.zip</a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="https://github.com/Breakthrough/PySceneDetect/archive/v0.5-beta-1.tar.gz" class="btn btn-info" style="margin-bottom:8px;" role="button"><span class="fa fa-download"></span>&nbsp; <b>Source</b>&nbsp;&nbsp;.tar.gz</a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="#installation" class="btn btn-warning" style="margin-bottom:8px;" role="button"><span class="fa fa-gear"></span>&nbsp; <b>Installation</b></a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="../examples/usage/" class="btn btn-danger" style="margin-bottom:8px;" role="button"><span class="fa fa-book"></span>&nbsp; <b>Getting Started</b></a>
<h3 class="wy-text-neutral"><span class="fa fa-forward wy-text-info"></span> Latest Release: <b class="wy-text-neutral">v0.5</b></h3>
<h4 class="wy-text-neutral"><span class="fa fa-calendar wy-text-info"></span>&nbsp; Release Date:&nbsp; <b>August 31, 2018</b></h4>
<a href="https://github.com/Breakthrough/PySceneDetect/archive/v0.5.zip" class="btn btn-info" style="margin-bottom:8px;" role="button"><span class="fa fa-download"></span>&nbsp; <b>Source</b>&nbsp;&nbsp;.zip</a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="https://github.com/Breakthrough/PySceneDetect/archive/v0.5.tar.gz" class="btn btn-info" style="margin-bottom:8px;" role="button"><span class="fa fa-download"></span>&nbsp; <b>Source</b>&nbsp;&nbsp;.tar.gz</a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="#installation" class="btn btn-warning" style="margin-bottom:8px;" role="button"><span class="fa fa-gear"></span>&nbsp; <b>Installation</b></a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="../examples/usage/" class="btn btn-danger" style="margin-bottom:8px;" role="button"><span class="fa fa-book"></span>&nbsp; <b>Getting Started</b></a>
</div>

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).
Expand Down
7 changes: 1 addition & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h4 class="wy-text-info">Intelligent scene cut detection and video splitting tool.</h4>

<div class="important">
<h3 class="wy-text-neutral"><span class="fa fa-info-circle wy-text-info"></span>&nbsp; Latest Release: <b>v0.5-beta-1</b> (August 6, 2018)</h3>
<h3 class="wy-text-neutral"><span class="fa fa-info-circle wy-text-info"></span>&nbsp; Latest Release: <b>v0.5</b> (August 31, 2018)</h3>
<a href="download/" class="btn btn-success" style="margin-bottom:8px;" role="button"><span class="fa fa-download"></span>&nbsp; <b>Download</b></a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="changelog/" class="btn btn-info" style="margin-bottom:8px;" role="button"><span class="fa fa-reorder"></span>&nbsp; <b>Changelog</b></a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="download/#installation" class="btn btn-warning" style="margin-bottom:8px;" role="button"><span class="fa fa-gear"></span>&nbsp; <b>Installation</b></a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="examples/usage/" class="btn btn-danger" style="margin-bottom:8px;" role="button"><span class="fa fa-book"></span>&nbsp; <b>Getting Started</b></a>
</div>

Expand All @@ -13,12 +13,7 @@ This documentation refers to PySceneDetect v0.5, which has a new-and-improved co
<br/>
<a href="http://man.scenedetect.com">http://man.scenedetect.com/</a>
<br/>

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.
<br/>
Users still using the latest stable release (v0.4) can find the <a href="https://pyscenedetect.readthedocs.io/en/v0.4/">existing documentation for v0.4 here</a>.


</div>

**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.
Expand Down
6 changes: 4 additions & 2 deletions package-info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scenedetect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
6 changes: 3 additions & 3 deletions scenedetect/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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'
Expand Down
5 changes: 4 additions & 1 deletion scenedetect/cli/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 901cf5c

Please sign in to comment.