You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/pages/api.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Internally, this detector functions by converting the colorspace of each decoded
15
15
16
16
`detect-content` also has edge detection, which can be enabled by providing a set of 4 numbers in the form (*delta_hue*, *delta_sat*, *delta_lum*, *delta_edges*). Changes in edges are typically larger than the other components, so threshold may need to be increased accordingly. For example, `-w 1.0 0.5 1.0 0.2 -t 32` is a good starting point to use with edge detection. The default weights are `--weights 1.0 1.0 1.0 0.0` which does not include edges, but this may change in the future.
17
17
18
-
See [the documentation for detect-content](http://scenedetect.com/projects/Manual/en/latest/cli/detectors.html#detect-content) for details.
18
+
See [the documentation for detect-content](../docs/latest/cli/detectors.html#detect-content) for details.
19
19
20
20
## Adaptive Content Detector
21
21
@@ -36,7 +36,7 @@ The perceptual hash detector (`detect-hash`) calculates a hash for a frame and c
36
36
37
37
# Creating New Detection Algorithms
38
38
39
-
All scene detection algorithms must inherit from [the base `SceneDetector` class](https://scenedetect.com/projects/Manual/en/latest/api/detector.html). Note that the current SceneDetector API is under development and expected to change somewhat before v1.0 is released, so make sure to pin your `scenedetect` dependency to the correct API version (e.g. `scenedetect < 0.6`, `scenedetect < 0.7`, etc...).
39
+
All scene detection algorithms must inherit from [the base `SceneDetector` class](../docs/latest/api/detector.html). Note that the current SceneDetector API is under development and expected to change somewhat before v1.0 is released, so make sure to pin your `scenedetect` dependency to the correct API version (e.g. `scenedetect < 0.6`, `scenedetect < 0.7`, etc...).
40
40
41
41
Creating a new scene detection method can be as simple as implementing the `process_frame` function, and optionally `post_process`:
42
42
@@ -63,7 +63,7 @@ class CustomDetector(SceneDetector):
63
63
64
64
`process_frame` is called on every frame in the input video, which will be called after the final frame of the video is passed to `process_frame`. This may be useful for multi-pass algorithms, or detectors which are waiting on some condition but still wish to output an event on the final frame.
65
65
66
-
For example, a detector may output at most 1 cuts for every call to `process_frame`, it may output the entire scene list in `post_process`, or a combination of both. Note that the latter will not work in cases where a live video stream or camera input device is being used. See the [API documentation for the `SceneDetector` class](https://scenedetect.com/projects/Manual/en/latest/api/detector.html#scenedetect.scene_detector.SceneDetector) for details. Alternatively, you can call `help(SceneDetector)` from a Python REPL. For examples of actual detection algorithm implementations, see the source files in the `scenedetect/detectors/` directory (e.g. `threshold_detector.py`, `content_detector.py`).
66
+
For example, a detector may output at most 1 cuts for every call to `process_frame`, it may output the entire scene list in `post_process`, or a combination of both. Note that the latter will not work in cases where a live video stream or camera input device is being used. See the [API documentation for the `SceneDetector` class](../docs/latest/api/detector.html#scenedetect.scene_detector.SceneDetector) for details. Alternatively, you can call `help(SceneDetector)` from a Python REPL. For examples of actual detection algorithm implementations, see the source files in the `scenedetect/detectors/` directory (e.g. `threshold_detector.py`, `content_detector.py`).
67
67
68
68
Processing is done by calling the `process_frame(...)` function for all frames in the video, followed by `post_process(...)` (optional) after the final frame. Scene cuts are detected and added to the passed list object in both cases.
69
69
@@ -76,5 +76,5 @@ Processing is done by calling the `process_frame(...)` function for all frames i
76
76
77
77
`post_process(...)` is called **after** the final frame has been processed, to allow for any stored scene cuts to be written *if required* (e.g. in the case of the `ThresholdDetector`).
78
78
79
-
You may also want to look into the implementation of current detectors to understand how frame metrics are saved/loaded to/from a [`StatsManager`](https://www.scenedetect.com/docs/latest/api/stats_manager.html) for caching and allowing values to be written to a stats file for users to graph and find trends in to tweak detector options. Also see the documentation for the [`SceneManager`](https://www.scenedetect.com/docs/latest/api/scene_manager.html) for details.
79
+
You may also want to look into the implementation of current detectors to understand how frame metrics are saved/loaded to/from a [`StatsManager`](../docs/latest/api/stats_manager.html) for caching and allowing values to be written to a stats file for users to graph and find trends in to tweak detector options. Also see the documentation for the [`SceneManager`](../docs/latest/api/scene_manager.html) for details.
Copy file name to clipboardExpand all lines: website/pages/changelog.md
-26Lines changed: 0 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,6 @@ Releases
7
7
8
8
### 0.7 (May 3, 2026)
9
9
10
-
#### Release Notes
11
-
12
10
PySceneDetect 0.7 is a **major breaking release** which overhauls how timestamps are handled. This allows PySceneDetect to properly process variable framerate (VFR) videos. A significant amount of technical debt has been addressed, including removal of deprecated or overly complicated APIs.
13
11
14
12
Care was taken to minimize changes for most common API uses, however more advanced use cases may run into breaking changes. Please review [the Migration Guide](https://www.scenedetect.com/docs/0.7/api/migration_guide.html) when updating from v0.6. Minimum supported Python version is now **Python 3.10**.
@@ -120,8 +118,6 @@ Re-release of the Python package that fixes dependency version pinning.
120
118
121
119
### PySceneDetect 0.6.7 (August 24, 2025)
122
120
123
-
#### Release Notes
124
-
125
121
Minor update to fix issues with importing EDL files into DaVinci Resolve and other editors.
126
122
127
123
#### Changelog
@@ -133,8 +129,6 @@ Minor update to fix issues with importing EDL files into DaVinci Resolve and oth
133
129
134
130
### PySceneDetect 0.6.6 (March 9, 2025)
135
131
136
-
#### Release Notes
137
-
138
132
PySceneDetect v0.6.6 introduces new output formats, which improve compatibility with popular video editors (e.g. DaVinci Resolve).
139
133
140
134
#### Changelog
@@ -159,8 +153,6 @@ PySceneDetect v0.6.6 introduces new output formats, which improve compatibility
159
153
160
154
### PySceneDetect 0.6.5 (November 24, 2024)
161
155
162
-
#### Release Notes
163
-
164
156
This release brings crop support, performance improvements to save-images, lots of bugfixes, and improved compatibility with MoviePy 2.0+.
165
157
166
158
#### Changelog
@@ -200,8 +192,6 @@ This release brings crop support, performance improvements to save-images, lots
200
192
201
193
### 0.6.4 (June 10, 2024)
202
194
203
-
#### Release Notes
204
-
205
195
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:
206
196
207
197
<ahref="https://raw.githubusercontent.com/Breakthrough/PySceneDetect/v0.6.4-release/website/pages/img/0.6.4-score-comparison.png"><imgsrc="https://raw.githubusercontent.com/Breakthrough/PySceneDetect/v0.6.4-release/website/pages/img/0.6.4-score-comparison.png"width="480"alt="comparison of new detector scores"/></a>
@@ -227,8 +217,6 @@ Feedback on the new detection methods and their default values is most welcome.
227
217
228
218
### 0.6.3 (March 9, 2024)
229
219
230
-
#### Release Notes
231
-
232
220
In addition to some perfromance improvements with the `load-scenes` command, this release of PySceneDetect includes a significant amount of bugfixes. Thanks to everyone who contributed to the release, including those who filed bug reports and helped with debugging!
233
221
234
222
**Program Changes:**
@@ -271,8 +259,6 @@ In addition to some perfromance improvements with the `load-scenes` command, thi
271
259
272
260
### 0.6.2 (July 23, 2023)
273
261
274
-
#### Release Notes
275
-
276
262
Includes new [`load-scenes` command](https://www.scenedetect.com/docs/0.6.2/cli.html#load-scenes), ability to specify a default detector, PyAV 10 support, and several bugfixes. Minimum supported Python version is now **Python 3.7**.
277
263
278
264
**Command-Line Changes:**
@@ -318,8 +304,6 @@ Includes new [`load-scenes` command](https://www.scenedetect.com/docs/0.6.2/cli.
318
304
319
305
### 0.6.1 (November 28, 2022)
320
306
321
-
#### Release Notes
322
-
323
307
Includes [MoviePy support](https://github.com/Zulko/moviepy), edge detection capability for fast cuts, and several enhancements/bugfixes.
324
308
325
309
#### Changelog
@@ -368,8 +352,6 @@ Includes [MoviePy support](https://github.com/Zulko/moviepy), edge detection cap
368
352
369
353
### 0.6 (May 29, 2022)
370
354
371
-
#### Release Notes
372
-
373
355
PySceneDetect v0.6 is a **major breaking change** including better performance, configuration file support, and a more ergonomic API. The new **minimum Python version is now 3.6**. See the [Migration Guide](https://scenedetect.com/projects/Manual/en/latest/api/migration_guide.html) for information on how to port existing applications to the new API. Most users will see performance improvements after updating, and changes to the command-line are not expected to break most workflows.
374
356
375
357
The main goals of v0.6 are reliability and performance. To achieve this required several breaking changes. The video input API was refactored, and *many* technical debt items were addressed. This should help the eventual transition to the first planned stable release (v1.0) where the goal is an improved scene detection API.
@@ -482,8 +464,6 @@ Both the Windows installer and portable distributions now include signed executa
482
464
483
465
### 0.5.6 (August 15, 2021)
484
466
485
-
#### Release Notes
486
-
487
467
***New detection algorithm**: `detect-adaptive` which works similar to `detect-content`, but with reduced false negatives during fast camera movement (thanks @scarwire and @wjs018)
488
468
* Images generated by `save-images` can now be resized via the command line
489
469
* Statsfiles now work properly with `detect-threshold`
@@ -514,8 +494,6 @@ Both the Windows installer and portable distributions now include signed executa
514
494
515
495
### 0.5.5 (January 17, 2021)
516
496
517
-
#### Release Notes
518
-
519
497
* One of the last major updates before transitioning to the new v0.6.x API
520
498
* The `--min-scene-len`/`-m` option is now global rather than per-detector
521
499
* There is a new global option `--drop-short-scenes` to go along with `-m`
@@ -557,8 +535,6 @@ Both the Windows installer and portable distributions now include signed executa
557
535
558
536
### 0.5.4 (September 14, 2020)
559
537
560
-
#### Release Notes
561
-
562
538
* Improved performance when using `time` and `save-images` commands
563
539
* Improved performance of `detect-threshold` when using a small minimum percent
564
540
* Fix crash when using `detect-threshold` with a statsfile
@@ -583,8 +559,6 @@ Both the Windows installer and portable distributions now include signed executa
583
559
584
560
### 0.5.3 (July 12, 2020)
585
561
586
-
#### Release Notes
587
-
588
562
* Resolved long-standing bug where `split-video` command would duplicate certain frames at the beginning/end of the output ([#93](https://github.com/Breakthrough/PySceneDetect/issues/93))
589
563
* This was determined to be caused by copying (instead of re-encoding) the audio track, causing extra frames to be brought in when the audio samples did not line up on a frame boundary (thank you @joshcoales for your assistance)
590
564
* Default behavior is to now re-encode audio tracks using the `aac` codec when using `split-video` (it can be overridden in both the command line and Python interface)
Copy file name to clipboardExpand all lines: website/pages/cli.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,19 @@ See [the documentation](../docs/latest/) for a complete reference to the `scened
7
7
8
8
Split input video on each fast cut using `ffmpeg`:
9
9
10
-
```rst
10
+
```bash
11
11
scenedetect -i video.mp4 split-video
12
12
```
13
13
14
14
Save some frames from each cut:
15
15
16
-
```rst
16
+
```bash
17
17
scenedetect -i video.mp4 save-images
18
18
```
19
19
20
20
Skip the first 10 seconds of the input video:
21
21
22
-
```rst
22
+
```bash
23
23
scenedetect -i video.mp4 time -s 10s
24
24
```
25
25
@@ -31,11 +31,11 @@ As a concrete example to become familiar with PySceneDetect, let's use the follo
31
31
32
32
You can [download the clip from here](https://github.com/Breakthrough/PySceneDetect/raw/refs/heads/resources/tests/resources/goldeneye.mp4) (right-click and save the video in your working directory as `goldeneye.mp4`).
33
33
34
-
Let's split this scene into clips on each fast cut. This means we need to use content-aware detecton mode (`detect-content`) or adaptive mode (`detect-adaptive`). If the video instead contains fade-in/fade-out transitions you want to find, you can use `detect-threshold` instead. If no detector is specified, `detect-adaptive` will be used by default.
34
+
Let's split this scene into clips on each fast cut. This means we need to use content-aware detection mode (`detect-content`) or adaptive mode (`detect-adaptive`). If the video instead contains fade-in/fade-out transitions you want to find, you can use `detect-threshold` instead. If no detector is specified, `detect-adaptive` will be used by default.
35
35
36
36
Let's first save a scene list in CSV format and generate some images of each scene to check the output:
@@ -64,7 +64,7 @@ Running the above command, in the working directory, you should see a file `gold
64
64
65
65
The `split-video` command can be used to automatically split the input video using `ffmpeg` or `mkvmerge`. For example:
66
66
67
-
```rst
67
+
```bash
68
68
scenedetect -i goldeneye.mp4 split-video
69
69
```
70
70
@@ -77,7 +77,7 @@ You can also specify `-h` / `--high-quality` to produces near lossless results,
77
77
78
78
PySceneDetect can look for fades in/out using `detect-threshold` (comparing each frame to a set black level) or find fast cuts using `detect-content` (compares each frame looking for changes in content). There also is `detect-adaptive`, which uses the same scoring as `detect-content`, but compares the ratio of each frame score to its neighbors.
79
79
80
-
Each mode has slightly different parameters, and is described in detail below. Most detector parameters can also be [set with a config file](http://scenedetect.com/projects/Manual/en/latest/cli/config_file.html).
80
+
Each mode has slightly different parameters, and is described in detail below. Most detector parameters can also be [set with a config file](../docs/latest/cli/config_file.html).
81
81
82
82
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-adaptive` or `detect-content` modes. Once you know what detection mode to use, you can try the parameters recommended below, or generate a statistics file (using the `-s` / `--stats` flag) in order to determine the correct parameters - specifically, the proper threshold value.
83
83
@@ -93,11 +93,11 @@ The optimal threshold can be determined by generating a stats file (`-s`), openi
93
93
94
94
Threshold-based mode is what most traditional scene detection programs use, which looks at the average intensity of the *current* frame, triggering a scene break when the intensity falls below the threshold (or crosses back upwards). The default threshold when using the `detect-threshold` is `12` (e.g. `detect-threshold` is the same as `detect-threshold --threshold 12` when the `-t` / `--threshold` option is not supplied), which is a good value to try when detecting fade outs to black on most videos.
@@ -113,11 +113,11 @@ The `detect-adaptive` mode compares each frame's score as calculated by `detect-
113
113
114
114
## Detection Parameters
115
115
116
-
Detectors take a variety of parameters, which can be [configured via command-line](http://scenedetect.com/projects/Manual/en/latest/cli/detectors.html) or by [using a config file](http://scenedetect.com/projects/Manual/en/latest/cli/config_file.html). If the default parameters do not produce correct results, you can generate a stats file using the `-s` / `--stats` option.
116
+
Detectors take a variety of parameters, which can be [configured via command-line](../docs/latest/cli/detectors.html) or by [using a config file](../docs/latest/cli/config_file.html). If the default parameters do not produce correct results, you can generate a stats file using the `-s` / `--stats` option.
117
117
118
118
For example, with `detect-content`, if the default threshold of `27` does not produce correct results, we can determine the proper threshold by first generating a stats file:
@@ -159,19 +159,19 @@ Specifying the `time` command allows control over what portion of the video PySc
159
159
160
160
For example, let's say we have a video shot at 30 FPS, and want to analyze only the segment from the 5 to the 6.5 minute mark in the video (we want to analyze the 90 seconds [2700 frames] between 00:05:00 and 00:06:30). The following commands are all thus equivalent in this regard (assuming we are using the content detector):
161
161
162
-
```rst
162
+
```bash
163
163
scenedetect -i my_video.mp4 time --start 00:05:00 --end 00:06:30
164
164
```
165
165
166
-
```rst
166
+
```bash
167
167
scenedetect -i my_video.mp4 time --start 300s --end 390s
168
168
```
169
169
170
-
```rst
170
+
```bash
171
171
scenedetect -i my_video.mp4 time --start 300s --duration 90s
172
172
```
173
173
174
-
```rst
174
+
```bash
175
175
scenedetect -i my_video.mp4 time --start 300s --duration 2700
176
176
```
177
177
@@ -198,7 +198,7 @@ Specifying a config file path using -c/--config overrides the user config file.
Copy file name to clipboardExpand all lines: website/pages/faq.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,21 @@
6
6
7
7
As of PySceneDetect 0.7, the OpenCV dependency is bundled with the install. The standard `scenedetect` package depends on `opencv-python`:
8
8
9
-
```md
9
+
```bash
10
10
pip install scenedetect
11
11
```
12
12
13
13
For server environments without GUI libraries, install the headless variant instead, which depends on `opencv-python-headless`:
14
14
15
-
```md
15
+
```bash
16
16
pip install scenedetect-headless
17
17
```
18
18
19
19
Both packages ship the same `scenedetect` Python module -- you only need one.
20
20
21
21
#### How can I enable video splitting support?
22
22
23
-
Video splitting is performed by `ffmpeg` ([https://ffmpeg.org/download.html](https://ffmpeg.org/download.html)) or `mkvmerge` (https://mkvtoolnix.download/downloads.html) depending on which command line arguments are used. Ensure the tool is available and somewhere in your system's PATH folder.
23
+
Video splitting is performed by `ffmpeg` ([https://ffmpeg.org/download.html](https://ffmpeg.org/download.html)) or `mkvmerge` ([https://mkvtoolnix.download/downloads.html](https://mkvtoolnix.download/downloads.html)) depending on which command line arguments are used. Ensure the tool is available and somewhere in your system's PATH folder.
24
24
25
25
#### How can I fix the error `Cannot split video due to too many scenes`?
26
26
@@ -36,12 +36,12 @@ Unfortunately, the underlying library used to perform video I/O was unable to op
36
36
37
37
This can also happen due to videos having multiple audio tracks (as per [#179](https://github.com/Breakthrough/PySceneDetect/issues/179)). If the PyAV backend does not succeed in processing the video, as a workaround you can remove the audio track using either `ffmpeg` or `mkvmerge`:
0 commit comments