Skip to content

Commit

Permalink
Modify default value for --min-scene-len from 15 frames to 0.6 seconds.
Browse files Browse the repository at this point in the history
Update documentation for PR #128.

Ref. #131 for future work on this option (to be merged).
  • Loading branch information
Breakthrough committed Nov 24, 2019
1 parent 2d462e3 commit 86975ea
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 30 deletions.
54 changes: 29 additions & 25 deletions manual/cli/detectors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ Detector Options

The ``detect-content`` detector takes the following options:

-t, --threshold VAL Threshold value (float) that the content_val frame
metric must exceed to trigger a new scene.
Refers to frame metric content_val in stats
file. [default: 30.0]
-m, --min-scene-len FRAMES Minimum size/length of any scene, in number of
frames. [default: 15]
-t, --threshold VAL Threshold value (float) that the content_val frame
metric must exceed to trigger a new scene.
Refers to frame metric content_val in stats
file. [default: 30.0]
-m, --min-scene-len TIMECODE Minimum size/length of any scene. 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 [default: 0.6s]



Expand All @@ -60,25 +62,27 @@ Detector Options

The ``detect-threshold`` detector takes the following options:

-t, --threshold VAL Threshold value (integer) that the delta_rgb
frame metric must exceed to trigger a new scene.
Refers to frame metric delta_rgb in stats file.
[default: 12]
-m, --min-scene-len FRAMES Minimum size/length of any scene, in number of
frames. [default: 15]
-f, --fade-bias PERCENT Percent (%) from -100 to 100 of timecode skew
for where cuts should be placed. -100 indicates
the start frame, +100 indicates the end frame,
and 0 is the middle of both. [default: 0]
-l, --add-last-scene If set, if the video ends on a fade-out, an
additional scene will be generated for the last
fade out position.
-p, --min-percent PERCENT Percent (%) from 0 to 100 of amount of pixels
that must meet the threshold value in orderto
trigger a scene change. [default: 95]
-b, --block-size N Number of rows in image to sum per iteration
(can be tuned for performance in some cases).
[default: 8]
-t, --threshold VAL Threshold value (integer) that the delta_rgb
frame metric must exceed to trigger a new scene.
Refers to frame metric delta_rgb in stats file.
[default: 12]
-m, --min-scene-len TIMECODE Minimum size/length of any scene. 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 [default: 0.6s]
-f, --fade-bias PERCENT Percent (%) from -100 to 100 of timecode skew
for where cuts should be placed. -100 indicates
the start frame, +100 indicates the end frame,
and 0 is the middle of both. [default: 0]
-l, --add-last-scene If set, if the video ends on a fade-out, an
additional scene will be generated for the last
fade out position.
-p, --min-percent PERCENT Percent (%) from 0 to 100 of amount of pixels
that must meet the threshold value in orderto
trigger a scene change. [default: 95]
-b, --block-size N Number of rows in image to sum per iteration
(can be tuned for performance in some cases).
[default: 8]


Usage Examples
Expand Down
2 changes: 1 addition & 1 deletion manual/cli/global_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ are any other commands to be performed, and their own options (e.g.
denote things that may be optional):

``scenedetect (global options) (command-A [command-A options]) (...)``

This is because once a command is specified, all options/arguments afterwards
will be parsed assuming they belong to *that* command.

Expand Down
4 changes: 2 additions & 2 deletions scenedetect/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def time_command(ctx, start, duration, end):
# ' scene changes triggered by flashes. Refers to frame metric delta_lum in stats file.')
@click.option(
'--min-scene-len', '-m', metavar='TIMECODE',
type=click.STRING, default="0", help=
type=click.STRING, default="0.6s", show_default=True, help=
'Minimum size/length of any scene. 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')
Expand Down Expand Up @@ -452,7 +452,7 @@ def detect_content_command(ctx, threshold, min_scene_len): #, intensity_cutoff):
' Refers to frame metric delta_rgb in stats file.')
@click.option(
'--min-scene-len', '-m', metavar='TIMECODE',
type=click.STRING, default="0", help=
type=click.STRING, show_default=True, default="0.6s", help=
'Minimum size/length of any scene. 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')
Expand Down
2 changes: 1 addition & 1 deletion scenedetect/detectors/content_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ContentDetector(SceneDetector):
def __init__(self, threshold=30.0, min_scene_len=15):
super(ContentDetector, self).__init__()
self.threshold = threshold
self.min_scene_len = min_scene_len # minimum length of any given scene, in frames
self.min_scene_len = min_scene_len # minimum length of any given scene, in frames (int) or FrameTimecode
self.last_frame = None
self.last_scene_cut = None
self.last_hsv = None
Expand Down
2 changes: 1 addition & 1 deletion scenedetect/detectors/threshold_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ThresholdDetector(SceneDetector):
min_percent: Float between 0.0 and 1.0 which represents the minimum
percent of pixels in a frame that must meet the threshold value in
order to trigger a fade in/out.
min_scene_len: Unsigned integer greater than 0 representing the
min_scene_len: FrameTimecode object or integer greater than 0 of the
minimum length, in frames, of a scene (or subsequent scene cut).
fade_bias: Float between -1.0 and +1.0 representing the percentage of
timecode skew for the start of a scene (-1.0 causing a cut at the
Expand Down

0 comments on commit 86975ea

Please sign in to comment.