Skip to content

Commit 8382632

Browse files
committed
Merge branch 'v0.5.5'
2 parents 72bd55e + 178cf9d commit 8382632

45 files changed

Lines changed: 755 additions & 556 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ or any other material included in in distribution.
99
PySceneDetect License (BSD 3-Clause)
1010
< http://www.bcastell.com/projects/PySceneDetect >
1111

12-
Copyright (C) 2014-2020, Brandon Castellano.
12+
Copyright (C) 2014-2021, Brandon Castellano.
1313
All rights reserved.
1414

1515
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Video Scene Cut Detection and Analysis Tool
77
[![Build Status](https://img.shields.io/travis/com/Breakthrough/PySceneDetect)](https://travis-ci.com/github/Breakthrough/PySceneDetect) [![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?color=blue)](https://pypi.python.org/pypi/scenedetect/) [![PyPI License](https://img.shields.io/pypi/l/scenedetect.svg)](http://pyscenedetect.readthedocs.org/en/latest/copyright/)
88

99

10-
### Latest Release: v0.5.4 (September 14, 2020)
10+
### Latest Release: v0.5.5 (January 17, 2021)
1111

1212
**Main Webpage**: [py.scenedetect.com](http://py.scenedetect.com)
1313

@@ -65,9 +65,6 @@ def find_scenes(video_path, threshold=30.0):
6565
scene_manager.add_detector(
6666
ContentDetector(threshold=threshold))
6767

68-
# Base timestamp at frame 0 (required to obtain the scene list).
69-
base_timecode = video_manager.get_base_timecode()
70-
7168
# Improve processing speed by downscaling before processing.
7269
video_manager.set_downscale_factor()
7370

@@ -76,7 +73,7 @@ def find_scenes(video_path, threshold=30.0):
7673
scene_manager.detect_scenes(frame_source=video_manager)
7774

7875
# Each returned scene is a tuple of the (start, end) timecode.
79-
return scene_manager.get_scene_list(base_timecode)
76+
return scene_manager.get_scene_list()
8077
```
8178

8279
To get started, try printing the result from calling `find_scenes` on a small video clip:
@@ -120,6 +117,6 @@ Additional features being planned or in development can be found [here (tagged a
120117

121118
Licensed under BSD 3-Clause (see the `LICENSE` file for details).
122119

123-
Copyright (C) 2014-2020 Brandon Castellano.
120+
Copyright (C) 2014-2021 Brandon Castellano.
124121
All rights reserved.
125122

docs/changelog.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,49 @@ PySceneDetect Releases
44

55
## PySceneDetect 0.5
66

7-
### 0.5.4 (September 14, 2020) &nbsp;<span class="fa fa-tags"></span>
7+
### 0.5.5 (January 17, 2021) &nbsp;<span class="fa fa-tags"></span>
8+
9+
#### Release Notes
10+
11+
* One of the last major updates before transitioning to the new v0.6.x API
12+
* The `--min-scene-len`/`-m` option is now global rather than per-detector
13+
* There is a new global option `--drop-short-scenes` to go along with `-m`
14+
* Removed first row from statsfiles so it is a valid CSV file
15+
* The progress bar now correctly resizes when the terminal is resized
16+
* Image sequences and URLs are now supported for input via the CLI/API
17+
* Images exported using the `save-images` command are now resized to match the display aspect ratio
18+
* A new flag `-s`/`--skip-cuts` has been added to the `list-scenes` command to allow standardized processing
19+
* The functionality of `save-images` is now accessible via the Python API through the `save_images()` function in `scenedetect.scene_manager`
20+
* Under the `save-images` command, renamed `--image-frame-margin` to `--frame-margin`, added short option `-m`, and increased the default value from 0 to 1 due to instances of the last frame of a video being occasionally missed (set `-m 0` to restore original behaviour)
21+
22+
#### Changelog
23+
24+
* [bugfix] Allow image sequences and URLs to be used as inputs ([#152](https://github.com/Breakthrough/PySceneDetect/issues/171) and [#188](https://github.com/Breakthrough/PySceneDetect/issues/188))
25+
* [bugfix] Pixel aspect ratio is now applied when using `save-images` ([#195](https://github.com/Breakthrough/PySceneDetect/issues/195))
26+
* [cli] Renamed `--image-frame-margin` to `--frame-margin` in `save-images` command, added short option `-m` as alias
27+
* [bugfix] Fix `save-images` command not saving the last frame by modifying seeking, as well as increasing default of `--frame-margin` from 0 to 1
28+
* [cli] Make `--min-scene-len` a global option rather than per-detector ([#131](https://github.com/Breakthrough/PySceneDetect/issues/131), thanks @tonycpsu)
29+
* [feature] Added `--drop-short-scenes` option to remove all scenes smaller than `--min-scene-len`, instead of merging them
30+
* [cli] Add `-s`/`--skip-cuts` option to `list-scenes` command to allow outputting a scene list CSV file as compliant with RFC 4180 ([#136](https://github.com/Breakthrough/PySceneDetect/issues/136))
31+
* [enhancement] Removed first row from statsfile to comply with RFC 4180, includes backwards compatibility so existing statsfiles can still be loaded ([#136](https://github.com/Breakthrough/PySceneDetect/issues/136))
32+
* [api] Add argument `include_cut_list` to `write_scene_list` method in `SceneManager` to support [#136](https://github.com/Breakthrough/PySceneDetect/issues/136)
33+
* [api] Removed unused argument base_timecode from `StatsManager.load_from_csv()` method
34+
* [api] Make the `base_timecode` argument optional on the `SceneManager` methods `get_scene_list()`, `get_cut_list()`, and `get_event_list()` ([#173](https://github.com/Breakthrough/PySceneDetect/issues/173))
35+
* [api] Support for live video stream callbacks by adding new `callback` argument to the `detect_scenes()` method of `SceneManager` ([#5](https://github.com/Breakthrough/PySceneDetect/issues/5), thanks @mhashim6)
36+
* [bugfix] Fix unhandled exception causing improper error message when a video fails to load on non-Windows platforms ([#192](https://github.com/Breakthrough/PySceneDetect/issues/192))
37+
* [enhancement] Enabled dynamic resizing for progress bar ([#193](https://github.com/Breakthrough/PySceneDetect/issues/193))
38+
* [enhancement] Always ouptut version number via logger to assist with debugging ([#171](https://github.com/Breakthrough/PySceneDetect/issues/171))
39+
* [bugfix] Resolve RuntimeWarning when running as module ([#181](https://github.com/Breakthrough/PySceneDetect/issues/181))
40+
* [api] Add `save_images()` function to `scenedetect.scene_manager` module which exposes the same functionality as the CLI `save-images` command ([#88](https://github.com/Breakthrough/PySceneDetect/issues/88))
41+
* [api] Removed `close_captures()` and `release_captures()` functions from `scenedetect.video_manager` module
42+
43+
#### Known Issues
44+
45+
* Image sequences or URL inputs are not supported by the `save-images` or `split-video` commands
46+
* Variable framerate videos (VFR) are not fully supported, and will yield incorrect timestamps ([#168](https://github.com/Breakthrough/PySceneDetect/issues/168))
47+
48+
49+
### 0.5.4 (September 14, 2020)
850

951
#### Release Notes
1052

@@ -21,13 +63,13 @@ PySceneDetect Releases
2163
* [bugfix] gracefully exit and show link to FAQ when number of scenes is too large to split with mkvmerge on Windows (see [#164](https://github.com/Breakthrough/PySceneDetect/issues/164, thanks @alexboydray)
2264
* [enhancement] Improved seeking performance, greatly improves performance of the `time` and `save-images` commands ([#98](https://github.com/Breakthrough/PySceneDetect/issues/98) and [PR #163](https://github.com/Breakthrough/PySceneDetect/pull/163) - thanks @obroomhall)
2365
* [enhancement] improve `detect-threshold` performance when min-percent is less than 50%
66+
* [bugfix] Fixed issue where video loading would fail silently due to multiple audio tracks ([#179](https://github.com/Breakthrough/PySceneDetect/issues/179))
2467
* [general] Made `tqdm` a regular requirement and not an extra ([#180](https://github.com/Breakthrough/PySceneDetect/issues/180))
2568
* [general] Support for Python 3.3 and 3.4 has been deprecated. Newer builds may still work on these Python versions, but future releases are not tested against these versions. This decision was made as part of [#180](https://github.com/Breakthrough/PySceneDetect/issues/180)
2669

2770
#### Known Issues
2871

2972
* Variable framerate videos are not supported properly currently (#168), a warning may be added in the next release to indicate when a VFR video is detected, until this can be properly resolved ([#168](https://github.com/Breakthrough/PySceneDetect/issues/168))
30-
* In certain cases, video files which will not load will fail silently, with PySceneDetect reporting that it processed 0 frames. Better error handling/messaging is planned for these cases as part of [#179](https://github.com/Breakthrough/PySceneDetect/issues/179)
3173

3274

3375
### 0.5.3 (July 12, 2020)

docs/download.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ PySceneDetect is available via `pip` as [the `scenedetect` package](https://pypi
2121
### Python Installer (All Platforms) &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>
2222

2323
<div class="important">
24-
<h4 class="wy-text-neutral"><span class="fa fa-forward wy-text-info"></span> Latest Release: <b class="wy-text-neutral">v0.5.4</b></h4>
25-
<h4 class="wy-text-neutral"><span class="fa fa-calendar wy-text-info"></span>&nbsp; Release Date:&nbsp; <b>September 14, 2020</b></h4>
26-
<a href="https://github.com/Breakthrough/PySceneDetect/archive/v0.5.4.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.4.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="../examples/usage/" class="btn btn-success" style="margin-bottom:8px;" role="button"><span class="fa fa-book"></span>&nbsp; <b>Getting Started</b></a>
24+
<h4 class="wy-text-neutral"><span class="fa fa-forward wy-text-info"></span> Latest Release: <b class="wy-text-neutral">v0.5.5</b></h4>
25+
<h4 class="wy-text-neutral"><span class="fa fa-calendar wy-text-info"></span>&nbsp; Release Date:&nbsp; <b>January 17, 2021</b></h4>
26+
<a href="https://github.com/Breakthrough/PySceneDetect/archive/v0.5.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.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="../examples/usage/" class="btn btn-success" style="margin-bottom:8px;" role="button"><span class="fa fa-book"></span>&nbsp; <b>Getting Started</b></a>
2727
</div>
2828

2929
To install from source, download and extract the latest release to a location of your choice, and make sure you have the appropriate [system requirements](#dependencies) installed before continuing. PySceneDetect can be installed by running the following command in the location of the extracted files (don't forget `sudo` if you're installing system-wide):

docs/examples/usage-python.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ def find_scenes(video_path, threshold=30.0):
3030
scene_manager.add_detector(
3131
ContentDetector(threshold=threshold))
3232

33-
# Base timestamp at frame 0 (required to obtain the scene list).
34-
base_timecode = video_manager.get_base_timecode()
35-
3633
# Improve processing speed by downscaling before processing.
3734
video_manager.set_downscale_factor()
3835

@@ -41,7 +38,7 @@ def find_scenes(video_path, threshold=30.0):
4138
scene_manager.detect_scenes(frame_source=video_manager)
4239

4340
# Each returned scene is a tuple of the (start, end) timecode.
44-
return scene_manager.get_scene_list(base_timecode)
41+
return scene_manager.get_scene_list()
4542
```
4643

4744
To get started, try printing the return value of `find_scenes` on a small video clip:

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h4 class="wy-text-info">Intelligent scene cut detection and video splitting tool.</h4>
44

55
<div class="important">
6-
<h3 class="wy-text-neutral"><span class="fa fa-info-circle wy-text-info"></span>&nbsp; Latest Release: <b>v0.5.4</b> (September 14, 2020)</h3>
6+
<h3 class="wy-text-neutral"><span class="fa fa-info-circle wy-text-info"></span>&nbsp; Latest Release: <b>v0.5.5</b> (January 17, 2021)</h3>
77
<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="http://pyscenedetect-manual.readthedocs.io/" class="btn btn-warning" style="margin-bottom:8px;" role="button"><span class="fa fa-gear"></span>&nbsp; <b>Manual</b></a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="examples/usage-example/" class="btn btn-danger" style="margin-bottom:8px;" role="button"><span class="fa fa-book"></span>&nbsp; <b>Getting Started</b></a>
88
<br/>
99
See the changelog for the latest release notes and known issues.

docs/other/copyright.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
PySceneDetect License (BSD 3-Clause)
77
< http://www.bcastell.com/projects/PySceneDetect >
88

9-
Copyright (C) 2014-2020, Brandon Castellano.
9+
Copyright (C) 2014-2021, Brandon Castellano.
1010
All rights reserved.
1111

1212
Redistribution and use in source and binary forms, with or without

docs/reference/command-line-params.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Usage: scenedetect [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...
5959
Options:
6060
-i, --input VIDEO [Required] Input video file. May be specified
6161
multiple times to concatenate several videos
62-
together.
62+
together. Also supports image sequences and URLs.
6363
-o, --output DIR Output directory for all files (stats file, output
6464
videos, images, log files, etc...).
6565
-f, --framerate FPS Force framerate, in frames/sec (e.g. -f 29.97).
@@ -78,6 +78,13 @@ Options:
7878
processes 33% of the frames, -fs 3 processes 25%,
7979
etc...). Reduces processing speed at expense of
8080
accuracy. [default: 0]
81+
-m, --min-scene-len TIMECODE
82+
Minimum size/length of any scene. TIMECODE can
83+
be specified as exact number of frames, a time
84+
in seconds followed by s, or a timecode in the
85+
format HH:MM:SS or HH:MM:SS.nnn [default: 0.6s]
86+
--drop-short-scenes Drop scenes shorter than `--min-scene-len`
87+
instead of combining them with neighbors
8188
-s, --stats CSV Path to stats file (.csv) for writing frame metrics
8289
to. If the file exists, any metrics will be
8390
processed, otherwise a new file will be created. Can
@@ -174,8 +181,6 @@ Options:
174181
metric must exceed to trigger a new scene.
175182
Refers to frame metric delta_hsv_avg in stats
176183
file. [default: 30.0]
177-
-m, --min-scene-len FRAMES Minimum size/length of any scene, in number of
178-
frames. [default: 15]
179184
-h, --help Show this message and exit.
180185
```
181186

@@ -198,8 +203,6 @@ Options:
198203
frame metric must exceed to trigger a new scene.
199204
Refers to frame metric delta_rgb in stats file.
200205
[default: 12]
201-
-m, --min-scene-len FRAMES Minimum size/length of any scene, in number of
202-
frames. [default: 15]
203206
-f, --fade-bias PERCENT Percent (%) from -100 to 100 of timecode skew
204207
for where cuts should be placed. -100 indicates
205208
the start frame, +100 indicates the end frame,
@@ -232,11 +235,15 @@ Options:
232235
option -o/--output if set.
233236
-f, --filename NAME Filename format to use for the scene list CSV file.
234237
You can use the $VIDEO_NAME macro in the file name.
235-
Note that you may have to wrap the name using single quotes. [default: $VIDEO_NAME-Scenes.csv]
238+
Note that you may have to wrap the name using single
239+
quotes. [default: $VIDEO_NAME-Scenes.csv]
236240
-n, --no-output-file Disable writing scene list CSV file to disk. If set,
237241
-o/--output and -f/--filename are ignored.
238242
-q, --quiet Suppresses output of the table printed by the list-
239243
scenes command.
244+
-s, --skip-cuts Skips outputting the cutting list as the first row in
245+
the CSV file. Set this option if compliance with RFC
246+
4810 is required.
240247
```
241248

242249

@@ -250,27 +257,29 @@ Usage: scenedetect save-images [OPTIONS]
250257
Create images for each detected scene.
251258

252259
Options:
253-
-o, --output DIR Output directory to save images to. Overrides global
254-
option -o/--output if set.
255-
-f, --filename NAME Filename format, *without* extension, to use when
256-
saving image files. You can use the $VIDEO_NAME,
257-
$SCENE_NUMBER, and $IMAGE_NUMBER macros in the file
258-
name. Note that you may have to wrap the name using
259-
single quotes. [default: $VIDEO_NAME-
260-
Scene-$SCENE_NUMBER-$IMAGE_NUMBER]
261-
-n, --num-images N Number of images to generate. Will always include
262-
start/end frame, unless N = 1, in which case the image
263-
will be the frame at the mid-point in the scene.
264-
-j, --jpeg Set output format to JPEG. [default]
265-
-w, --webp Set output format to WebP.
266-
-q, --quality Q JPEG/WebP encoding quality, from 0-100 (higher
267-
indicates better quality). For WebP, 100 indicates
268-
lossless. [default: JPEG: 95, WebP: 100]
269-
-p, --png Set output format to PNG.
270-
-c, --compression C PNG compression rate, from 0-9. Higher values produce
271-
smaller files but result in longer compression time.
272-
This setting does not affect image quality, only file
273-
size. [default: 3]
260+
-o, --output DIR Output directory to save images to. Overrides global
261+
option -o/--output if set.
262+
-f, --filename NAME Filename format, *without* extension, to use when
263+
saving image files. You can use the $VIDEO_NAME,
264+
$SCENE_NUMBER, and $IMAGE_NUMBER macros in the file
265+
name. Note that you may have to wrap the format in
266+
single quotes. [default: $VIDEO_NAME-
267+
Scene-$SCENE_NUMBER-$IMAGE_NUMBER]
268+
-n, --num-images N Number of images to generate. Will always include
269+
start/end frame, unless N = 1, in which case the image
270+
will be the frame at the mid-point in the scene.
271+
-j, --jpeg Set output format to JPEG. [default]
272+
-w, --webp Set output format to WebP.
273+
-q, --quality Q JPEG/WebP encoding quality, from 0-100 (higher
274+
indicates better quality). For WebP, 100 indicates
275+
lossless. [default: JPEG: 95, WebP: 100] [0<=x<=100]
276+
-p, --png Set output format to PNG.
277+
-c, --compression C PNG compression rate, from 0-9. Higher values produce
278+
smaller files but result in longer compression time.
279+
This setting does not affect image quality, only file
280+
size. [default: 3] [0<=x<=9]
281+
-m, --frame-margin N Number of frames to ignore at the beginning and end of
282+
scenes when saving images [default: 1]
274283
```
275284

276285

0 commit comments

Comments
 (0)