Skip to content

Releases: Breakthrough/PySceneDetect

PySceneDetect v0.7

03 May 22:56

Choose a tag to compare

Release Notes

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.

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 when updating from v0.6. Minimum supported Python version is now Python 3.10.

CLI Changes

  • [feature] VFR videos are handled correctly by the OpenCV and PyAV backends, and should work correctly with default parameters
  • [feature] All CLI options which used to accept frame numbers only now accept seconds (e.g. 0.6s) and timecodes (e.g. 00:00:00.600) #531
  • [feature] New save-fcp command allows exporting in Final Cut Pro format (FCP7/FCPX) #156
  • [feature] New save-qp command writes a QP file with scene boundary frame numbers, suitable for forcing keyframes at scene cuts in x264/x265 #448
  • [feature] New save-html command replaces the deprecated export-html; the prior command remains as an alias and emits a deprecation warning #518
  • [feature] Add save-edl option --start-timecode/-s to providde a custom start timecode for generated EDLs, supports SMPTE HH:MM:SS:FF or 8-digit HHMMSSFF input #515
  • [bugfix] Fix floating-point precision error in save-otio output where frame values near integer boundaries (e.g. 90.00000000000001) were serialized with spurious precision
  • [bugfix] Add mitigation for transient OSError in the MoviePy backend as it is susceptible to subprocess pipe races on slow or heavily loaded systems #496
  • [feature] The MoviePy backend now supports overriding the source frame rate via -f/--frame-rate (and the VideoStreamMoviePy(frame_rate=...) API), bringing it in line with the OpenCV and PyAV backends
  • [bugfix] detect-threshold cut frame numbers are now backend-deterministic; previously the cut could differ by 1 frame between PyAV and OpenCV when the fade midpoint landed on a .5 rounding boundary (PyAV uses sub-microsecond PTS, OpenCV uses millisecond-truncated CAP_PROP_POS_MSEC)
  • [breaking] Remove deprecated -d/--min-delta-hsv option from detect-adaptive command (use -c/--min-content-val instead)
  • [breaking] Rename -f/--framerate to -f/--frame-rate as part of VFR overhaul (legacy --framerate form is preserved as a hidden alias but will be removed in v0.8)
  • [general] Support SCENEDETECT_DEBUG environment variable to control how exceptions and debugging are handled. Unhandled exceptions and Ctrl+C now produce a logger-formatted error message and exit cleanly with code 1 instead of dumping a raw Python traceback. Set SCENEDETECT_DEBUG=1 to ensure all exceptions are re-raised instead of being logged. In both cases, the program will exit with a non-zero exit code.

API Changes

VFR & Timestamp Overhaul:

  • Add write_scene_list_edl, write_scene_list_fcpx, write_scene_list_fcp7, and write_scene_list_otio to the scenedetect.output module so save-edl, save-fcp, and save-otio can be invoked directly from Python (previously CLI-only)
  • write_scene_list_edl accepts an optional start_timecode parameter (SMPTE HH:MM:SS:FF or 8-digit HHMMSSFF) that is added to every event's source and record columns #515
  • Add new Timecode type to represent frame timings in terms of the video's source timebase
  • Add time_base and pts properties to FrameTimecode for more accurate timing information
  • All backends (PyAV, OpenCV, MoviePy) now return PTS-backed timestamps from VideoStream.position
  • VideoStream.frame_rate now returns Fraction instead of float
  • Framerates are now stored as rational Fraction values (e.g. Fraction(24000, 1001) instead of 23.976) to avoid float precision loss
  • Common NTSC rates (23.976, 29.97, 59.94) are automatically detected from float values
  • FrameTimecode.frame_num is now approximate for VFR video (based on PTS-derived time)
  • Add frame_rate property (returns exact Fraction) as the canonical replacement for framerate (returns float) in FrameTimecode and VideoStream
    • For CFR sources, both properties represent the same rate, i.e. time_base equals 1 / frame_rate for CFR sources #548
  • Add frame_rate keyword argument to open_video() and the VideoStreamCv2, VideoCaptureAdapter, VideoStreamAv, and VideoStreamMoviePy constructors as the canonical replacement for framerate #548; accepts float | Fraction | None. The legacy framerate keyword is retained as a deprecated alias and is ignored when frame_rate is provided
  • Add equal_frame_rate(other) method as the canonical replacement for equal_framerate(fps)

General:

  • Type hints: audit and overhaul: first-party code is now clean with Pyright basic mode, migrated deprecated type hints to comply with PEP 585
  • Code quality: expand static analysis rules, audit and cleanup existing suppressions
  • Packaging: modernized to comply with PEP 621, make opencv-python a requirement, add separate scenedetect-headless variant instead

Detector Interface:

  • Replace frame_num parameter (int) with timecode (FrameTimecode) in SceneDetector interface #168:
    • The detector interface: SceneDetector.process_frame() and SceneDetector.post_process() (the post_process signature on the abstract base is now consistently typed as FrameTimecode to match its concrete-detector overrides; the prior int annotation did not reflect the actual runtime value)
    • Statistics: StatsManager.get_metrics(), StatsManager.set_metrics(), and StatsManager.metrics_exist() formally accept either FrameTimecode or int (the int form is retained for compatibility with the deprecated load_from_csv() path, which keys metrics by integer frame number)
  • StatsManager.load_from_csv() and save_images() output_dir now accept os.PathLike (e.g. pathlib.Path) in addition to str
  • SceneManager.detect_scenes() duration and end_time formally accept int (frames), float (seconds), str (timecode), or FrameTimecode - matching the documented and runtime-supported behavior
  • SceneDetector is now a Python abstract class
  • SceneDetector instances can now assume they always have frame data to process when process_frame is called
  • Remove SceneDetector.is_processing_required() method
  • Remove SceneDetector.stats_manager_required property, no longer required
  • Remove deprecated SparseSceneDetector interface
  • Detector min_scene_len and save_images() frame_margin arguments now accept seconds (float) and timecode strings (e.g. "0.6s", "00:00:00.600") in addition to a frame count (int); these are evaluated using the source video's timing for correct behavior on VFR videos #531

Module Reorganization:

  • scenedetect.scene_detector moved to scenedetect.detector
  • scenedetect.frame_timecode moved to scenedetect.common
  • Image/HTML/CSV export in scenedetect.scene_manager moved to scenedetect.output #463
  • scenedetect.video_splitter moved to scenedetect.output.video #463

FrameTimecode:

  • Add properties to access frame_num, frame_rate, and seconds instead of getter methods
  • frame_num and frame_rate are now read-only properties (construct a new FrameTimecode to change them)
  • Remove FrameTimecode.previous_frame() method
  • Deprecated functionality preserved from v0.6 now uses the warnings module to emit runtime deprecation warnings, these features will be removed in v0.8
  • Soft-deprecate framerate property and equal_framerate() method via docstring; the legacy forms will continue to work until v0.8 when they will be upgraded to DeprecationWarning before removal in v0.9

Removals:

  • Remove deprecated module scenedetect.video_manager, use the scenedetect.open_video() function instead
  • Remove deprecated parameters base_timecode and video_manager from various functions
  • Remove deprecated SceneManager.get_event_list() method
  • Remove deprecated AdaptiveDetector.get_content_val() method (use StatsManager instead)
  • Remove deprecated AdaptiveDetector constructor arg min_delta_hsv (use min_content_val instead)
  • Remove advance parameter from VideoStream.read()
  • Remove SceneDetector.stats_manager_required property, no longer required
  • SceneDetector is now a Python abstract class

Windows Distribution

  • [general] Updates to Windows distributions:
    • av 14.2.0 -> 17.0.1
    • click 8.1.8 -> 8.2.1
    • imageio-ffmpeg 0.6.0
    • moviepy 2.1.2 -> 2.2.1
    • numpy 2.2.3 -> 2.4.4
    • opencv-python-headless 4.11.0.86 -> 4.13.0.92
    • platformdirs 4.3.6 -> 4.9.6
    • tqdm...
Read more

PySceneDetect v0.6.7

25 Aug 03:37

Choose a tag to compare

Release Notes

Fixes issues with importing EDL files into DaVinci Resolve and other editors, update ffmpeg.

Changelog

  • [bugfix] Fix save-edl end timestamp being too short by 1 frame #516
  • [general] Updates to Windows distributions:
    • ffmpeg 7.1 -> 8.0

v0.6.7.1 (PyPI only, no code changes) - 2025-09-24

  • [dist] Fix version pinning to prevent incompatibility with third-party dependencies #521

PySceneDetect v0.6.6

10 Mar 01:43

Choose a tag to compare

Release Notes

PySceneDetect v0.6.6 introduces new output formats, which improve compatibility with popular video editors (e.g. DaVinci Resolve).

Changelog

  • [feature] New save-otio command supports saving scenes in OTIO format #497
  • [feature] New save-edl command supports saving scenes in EDL format CMX 3600 #495
  • [bugfix] Fix incorrect help entries for short-form arguments which suggested invalid syntax #493
  • [bugfix] Fix crash when using split-video with -m/--mkvmerge option #473
  • [bugfix] Fix incorrect default filename template for split-video command with -m/--mkvmerge option
  • [bugfix] Fix inconsistent filenames when using split_video_mkvmerge()
  • [bugfix] Ensure auto-rotation is always enabled for VideoStreamCv2 as workaround for opencv#26795
  • [general] The export-html command is now deprecated, use save-html instead
  • [general] Updates to Windows distributions:
    • av 13.1.0 -> 14.2.0
    • click 8.1.7 -> 8.1.8
    • imageio-ffmpeg 0.5.1 -> 0.6.0
    • moviepy 2.1.1 -> 2.1.2
    • numpy 2.1.3 -> 2.2.3
    • opencv-python 4.10.0.84 -> 4.11.0.86

New Contributors

  • @awkrail made their first contribution in #480 (and many more since!)

PySceneDetect v0.6.5

17 Dec 23:30

Choose a tag to compare

Release Notes

This release brings crop support, performance improvements to save-images, lots of bugfixes, and improved compatibility with MoviePy 2.0+.

Changelog

  • [feature] Add ability to crop input video before processing #302 #449
    • [cli] Add --crop option to scenedetect command and config file to crop video frames before scene detection
    • [api] Add crop property to SceneManager to crop video frames before scene detection
  • [feature] Add ability to configure CSV separators for rows/columns in config file #423
  • [feature] Add new --show flag to export-html command to launch browser after processing #442
  • [improvement] Add new threading option to save-images/save_images() #456
    • Enabled by default, offloads image encoding and disk IO to separate threads
    • Improves performance by up to 50% in some cases
  • [improvement] The export-html command now implicitly invokes save-images with default parameters
    • The output of the export-html command will always use the result of the save-images command that precedes it
  • [improvement] save_to_csv now works with paths from pathlib
  • [api] The save_to_csv function now works correctly with paths from the pathlib module
  • [api] Add col_separator and row_separator args to write_scene_list function in scenedetect.scene_manager
  • [api] The MoviePy backend now works with MoviePy 2.0+
  • [bugfix] Fix SyntaxWarning due to incorrect escaping #400
  • [bugfix] Fix ContentDetector crash when using callbacks #416 #420
  • [bugfix] Fix save-images/save_images() not working correctly with UTF-8 paths #450
  • [bugfix] Fix crash when using save-images/save_images() with OpenCV backend #455
  • [bugfix] Fix new detectors not working with default-detector config option
  • [general] Timecodes of the form MM:SS[.nnn] are now processed correctly #443
  • [general] Updates to Windows distributions:
    • The MoviePy backend is now included with Windows distributions
    • Bundled Python interpreter is now Python 3.13
    • Updated PyAV 10 -> 13.1.0 and OpenCV 4.10.0.82 -> 4.10.0.84

Python Distribution Changes

  • v0.6.5.1 - Fix compatibility issues with PyAV 14+ #466
  • v0.6.5.2 - Fix for AttributeError: module 'cv2' has no attribute 'Mat' #468

New Contributors

PySceneDetect v0.6.4

11 Jun 03:48

Choose a tag to compare

Release Notes

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:

comparison of new detector scores

Feedback on the new detection methods and their default values is most welcome. Thanks to everyone who contributed for their help and support!

Changelog

  • [feature] New detectors:
    • detect-hist / HistogramDetector #295 #53
    • detect-hash / HashDetector #290
  • [feature] Add flash suppression filter for detect-content / ContentDetector (enabled by default) #35 #53
    • Reduces number of cuts generated during strobing or flashing effects
    • Can be configured using --filter-mode option
    • --filter-mode = merge (new default) merges consecutive scenes shorter than min-scene-len
    • --filter-mode = suppress (previous default) disables generating new scenes until min-scene-len has passed
  • [feature] Add more templates for save-images filename customization: $TIMECODE, $FRAME_NUMBER, $TIMESTAMP_MS (thanks @Veldhoen0) #395
  • [bugfix] Remove extraneous console output when using --drop-short-scenes
  • [bugfix] Fix scene lengths being smaller than min-scene-len when using detect-adaptive / AdaptiveDetector with large values of --frame-window
  • [bugfix] Fix crash when decoded frames have incorrect resolution and log error instead #319
  • [bugfix] Update default ffmpeg stream mapping from -map 0 to -map 0:v:0 -map 0:a? -map 0:s? #392

PySceneDetect v0.6.3

10 Mar 03:11

Choose a tag to compare

Release Notes

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!

Program Changes:

  • [bugfix] Fix crash for some WebM videos when using save-images with --backend pyav #355
  • [bugfix] Correct --duration and --end for presentation time when specified as frame numbers #341
  • [bugfix] Progress bar now has correct frame accounting when --duration or --end are set #341
  • [bugfix] Only allow load-scenes to be specified once, and disallow with other detect-* commands #347
  • [bugfix] Disallow -s/--start being larger than -e/--end for the time command
  • [bugfix] Fix detect-adaptive not respecting --min-scene-len for the first scene
  • [general] Comma-separated timecode list is now only printed when the list-scenes command is specified #356
  • [general] Several changes to [list-scenes] config file options:
    • Add display-scenes and display-cuts options to control output
    • Add cut-format to control formatting of cut points #349
      • Valid values: frames, timecode, seconds
  • [general] Increase progress bar indent to improve visibility and visual alignment
  • [improvement] The s suffix for setting timecode values in seconds is no longer required (values without decimal places are still interpreted as frame numbers)
  • [improvement] load-scenes now skips detection, generating output much faster #347 (thanks @wjs018 for the initial implementation)

API Changes:

  • [bugfix] Fix AttributeError thrown when accessing aspect_ratio on certain videos using VideoStreamAv #355
  • [bugfix] Fix circular imports due to partially initialized module for some development environments #350
  • [bugfix] Fix SceneManager.detect_scenes warning when duration or end_time are specified as timecode strings #346
  • [bugfix] Ensure correct string conversion behavior for FrameTimecode when rounding is enabled #354
  • [bugfix] Fix AdaptiveDetector not respecting min_scene_len for the first scene
  • [feature] Add output_dir argument to split_video_ffmpeg and split_video_mkvmerge functions to set output directory #298
  • [feature] Add formatter argument to split_video_ffmpeg to allow formatting filenames via callback [#359](https://github.com/
    /issues/359)
  • [general] The frame_img argument to SceneDetector.process_frame() is now required
  • [general] Remove TimecodeValue from scenedetect.frame_timecode (use typing.Union[int, float, str])
  • [general] Remove MotionDetector and scenedetect.detectors.motion_detector module (will be reintroduced after SceneDetector interface is stable)
  • [improvement] scenedetect.stats_manager module improvements:
    • The StatsManager.register_metrics() method no longer throws any exceptions
    • Add StatsManager.metric_keys property to query registered metric keys
    • Deprecate FrameMetricRegistered and FrameMetricNotRegistered exceptions (no longer used)
  • [improvement] When converting strings representing seconds to FrameTimecode, the s suffix is now optional, and whitespace is ignored (note that values without decimal places are still interpreted as frame numbers)
  • [improvement] The VideoCaptureAdapter in scenedetect.backends.opencv now attempts to report duration if known

PySceneDetect v0.6.2

23 Jul 21:57

Choose a tag to compare

Release Notes

Includes new load-scenes command, ability to specify a default detector, PyAV 10 support, and several bugfixes. Minimum supported Python version is now Python 3.7.

Command-Line Changes:

  • [feature] Add load-scenes command to load cuts from list-scenes CSV output #235
  • [feature] Use detect-adaptive by default if a detector is not specified #329
    • Default detector can be set by config file with the default-detector option under [global]
  • [bugfix] Fix -d/--duration and -e/--end options of time command consuming one extra frame #307
  • [bugfix] Fix incorrect end timecode for final scene when last frame of video is a new scene #307
  • [bugfix] Expand $VIDEO_NAME before creating output directory for -f/--filename option of split-video, now allows absolute paths
  • [general] Rename ThresholdDetector (detect-threshold) metric delta_rgb metric to average_rgb
  • [general] -l/--logfile always produces debug logs now
  • [general] Remove -a/--all flag from scenedetect version command, now prints all information by default (can still call scenedetect for version number alone)
  • [general] Add -h/--help options globally and for each command
  • [general] Remove all option from scenedetect help command (can now call scenedetect help for full reference)

General:

  • [feature] Add ability to specify method (floor/ceiling) when creating ThresholdDetector, allows fade to white detection #143
  • [general] Minimum supported Python version is now Python 3.7
  • [general] Add support for PyAV 10.0 #292
  • [general] Use platformdirs package instead of appdirs #309
  • [bugfix] Fix end_time always consuming one extra frame #307
  • [bugfix] Fix incorrect end timecode for last scene when start_in_scene is True or the final scene contains a single frame #307
  • [bugfix] Fix MoviePy read next frame #320
  • [bugfix] Template replacement when generating output now allows lower-case letters to be used as separators in addition to other characters
  • [api] Make some public functions/methods private (prefixed with _):
    • get_aspect_ratio function in scenedetect.backends.opencv
    • mean_pixel_distance and estimated_kernel_size functions in scenedetect.detectors.content_detector
    • compute_frame_average function in scenedetect.detectors.threshold_detector
    • scenedetect.cli and scenedetect.thirdparty modules
  • [api] Remove compute_downscale_factor in scenedetect.video_stream (use scenedetect.scene_manager.compute_downscale_factor instead)
  • [dist] Updated dependencies in Windows distributions: ffmpeg 6.0, PyAV 10, OpenCV 4.8, removed mkvmerge

Project Updates

  • Website and documentation is now hosted on Github Pages, documentation can be found at scenedetect.com/docs
  • Windows and Linux builds are now done on Github Actions, add OSX builds as well
  • Build matrix has been updated to support Python 3.7 through 3.11 for all operating systems for Python distributions
  • Windows portable builds have been moved to Github Actions, signed builds/installer is still done on Appveyor
  • Windows distributions no longer include mkvmerge (can still download for Windows here)

PySceneDetect v0.6.1

29 Nov 02:35

Choose a tag to compare

Release Notes

Adds edge detection capability for fast cuts, addresses outstanding bugs, and includes various enhancements.

Changelog

Command-Line Changes:

  • [feature] Add moviepy backend wrapping the MoviePy package, uses ffmpeg binary on the system for video decoding
  • [feature] Edge detection can now be enabled with detect-content and detect-adaptive to improve accuracy in some cases, especially under lighting changes, see new -w/--weights option for more information
    • A good starting point is to place 100% weight on the change in a frame's hue, 50% on saturation change, 100% on luma (brightness) change, and 25% on change in edges, with a threshold of 32:
      detect-adaptive -w 1.0 0.5 1.0 0.25
    • Edge differences are typically larger than other components, so you may need to increase -t/--threshold higher when increasing the edge weight (the last component) with detect-content, for example:
      detect-content -w 1.0 0.5 1.0 0.25 -t 32
    • May be enabled by default in the future once it has been more thoroughly tested, further improvements for detect-content are being investigated as well (e.g. motion compensation, flash suppression)
    • Short-form of detect-content option --frame-window has been changed from -w to -f to accomodate this change
  • [enhancement] Progress bar now displays number of detections while processing, no longer conflicts with log message output
  • [enhancement] When using ffmpeg to split videos, -map 0 has been added to the default arguments so other audio tracks are also included when present (#271)
  • [enhancement] Add -a flag to version command to print more information about versions of dependencies/tools being used
  • [enhancement] The resizing method used used for frame downscaling or resizing can now be set using a config file, see [global] option downscale-method and [save-images] option scale-method
  • [other] Linear interpolation is now used as the default downscaling method (previously was nearest neighbor) for improved edge detection accuracy
  • [other] Add -c/--min-content-val argument to detect-adaptive, deprecate -d/--min-delta-hsv

General:

  • [general] Recommend detect-adaptive over detect-content
  • [feature] Add new experimental backend VideoStreamMoviePy using the MoviePy package
  • [feature] Add edge detection to ContentDetector and AdaptiveDetector (#35)
    • Add ability to specify content score weights of hue, saturation, luma, and edge differences between frames
    • Default remains as 1.0, 1.0, 1.0, 0.0 so there is no change in behavior
    • Kernel size used for improving edge overlap can also be customized
  • [feature] AdaptiveDetector no longer requires a StatsManager and can now be used with frame_skip (#283)
  • [bugfix] Fix scenedetect.detect() throwing TypeError when specifying stats_file_path
  • [bugfix] Fix off-by-one error in end event timecode when end_time was set (reported end time was always one extra frame)
  • [bugfix] Fix a named argument that was incorrect (#299)
  • [enhancement] Add optional start_time, end_time, and start_in_scene arguments to scenedetect.detect() (#282)
  • [enhancement] Add -map 0 option to default arguments of split_video_ffmpeg to include all audio tracks by default (#271)
  • [docs] Add example for using a callback (#273)
  • [enhancement] Add new VideoCaptureAdapter to make existing cv2.VideoCapture objects compatible with a SceneManager (#276)
    • Primary use case is for handling input devices/webcams and gstreamer pipes, see updated examples
    • Files, image sequences, and network streams/URLs should continue to use VideoStreamCv2
  • [api] The SceneManager methods get_cut_list() and get_event_list() are deprecated, along with the base_timecode argument
  • [api] The base_timecode argument of get_scenes_from_cuts() in scenedetect.stats_manager is deprecated (the signature of this function has been changed accordingly)
  • [api] Rename AdaptiveDetector constructor parameter min_delta_hsv to `min_content_val
  • [general] The default crf for split_video_ffmpeg has been changed from 21 to 22 to match command line default
  • [enhancement] Add interpolation property to SceneManager to allow setting method of frame downscaling, use linear interpolation by default (previously nearest neighbor)
  • [enhancement] Add interpolation argument to save_images to allow setting image resize method (default remains bicubic)

PySceneDetect v0.6

30 May 00:19

Choose a tag to compare

Release Notes

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 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.

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.

Both the Windows installer and portable distributions now include signed executables. Many thanks to SignPath, AppVeyor, and AdvancedInstaller for their support.

Changelog

Overview:

  • Major performance improvements on multicore systems
  • Configuration file support via command line option or user settings folder
  • Support for multiple video backends, PyAV is now supported in addition to OpenCV
  • Breaking API changes to VideoManager (replaced with VideoStream), StatsManager, and save_images()
    • See the Migration Guide for details on how to update from v0.5.x
    • A backwards compatibility layer has been added to prevent most applications from breaking, will be removed in a future release
  • Support for Python 2.7 has been dropped, minimum supported Python version is 3.6
  • Support for OpenCV 2.x has been dropped, minimum OpenCV version is 3.x
  • Windows binaries are now signed, thanks SignPath.io (certificate by SignPath Foundation)

Command-Line Changes:

  • Configuration files are now supported, see documentation for details
    • Can specify config file path with -c/--config, or create a scenedetect.cfg file in your user config folder
  • Frame numbers are now 1-based, aligning with most other tools (e.g. ffmpeg) and video editors (#265)
  • Start/end frame numbers of adjacent scenes no longer overlap (#264)
    • End/duration timecodes still include the frame's presentation time
  • Add --merge-last-scene option to merge last scene if shorter than --min-scene-len
  • Add -b/--backend option to use a specific video decoding backend
    • Supported backends are opencv and pyav
    • Run scenedetect help to see a list of backends available on the current system
    • Both backends are included with Windows builds
  • split-video command:
    • -c/--copy now uses ffmpeg instead of mkvmerge (#77, #236)
    • Add -m/--mkvmerge flag to use mkvmerge instead of ffmpeg (#77)
    • Long name for -a has been changed to --args (from --override-args)
  • detect-adaptive command:
    • --drop-short-scenes now works properly with detect-adaptive
  • detect-content command:
    • Default threshold -t/--threshold lowered to 27 to be more sensitive to shot changes (#246)
    • Add override for global -m/--min-scene-len option
  • detect-threshold command:
    • Remove -p/--min-percent and -b/--block-size options
    • Add override for global -m/--min-scene-len option
  • save-images command now works when -i/--input is an image sequences
  • Default backend (OpenCV) is more robust to video decoder failures
  • -i/--input may no longer be specified multiple times, if required use an external tool (e.g. ffmpeg, mkvmerge) to perform concatenation before processing
  • -s/--stats no longer loads existing statistics and will overwrite any existing files
  • -l/--logfile now respects -o/--output
  • -v/--verbosity now takes precedence over -q/--quiet

API Changes:

  • New detect() function performs scene detection on a video path, see example here
  • New open_video() function to handle video input, see example here
  • split_video_ffmpeg() and split_video_mkvmerge() now take a single path as input
  • save_images() no longer accepts downscale_factor
    • Use scale or height/width arguments to resize images
  • New VideoStream replaces VideoManager (#213)
    • Supports both OpenCV (VideoStreamCv2) and PyAV (VideoStreamAv)
    • Improves video seeking invariants, especially around defining what frames 0 and 1 mean for different time properties (frame_number is 1-based whereas position is 0-based to align with PTS)
    • See test_time_invariants in tests/test_video_stream.py as a reference of specific behaviours
  • Changes to SceneManager:
    • detect_scenes() now performs video decoding in a background thread, improving performance on most systems
    • SceneManager is now responsible for frame downscaling via the downscale/auto_downscale properties
    • detect_scenes() no longer shows a progress bar by default, set show_progress=True to restore the previous behaviour
    • clear() now clears detectors, as they may be stateful
    • get_scene_list() now returns an empty list if there are no detected cuts, specify start_in_scene=True for previous behavior (one scene spanning the entire input)
  • Changes to StatsManager:
    • save_to_csv() now accepts a path or an open file handle
    • base_timecode argument has been removed from save_to_csv()
    • load_from_csv() is now deprecated and will be removed in v1.0
  • Changes to FrameTimecode:
    • Use rounding instead of truncation when calculating frame numbers to fix incorrect round-trip conversions and improve accuracy (#268)
    • Fix previous_frame() generating negative frame numbers in some cases
    • FrameTimecode objects can now perform arithmetic with formatted strings, e.g. 'HH:MM:SS.nnn'
  • Merged constants MAX_FPS_DELTA and MINIMUM_FRAMES_PER_SECOND_DELTA_FLOAT in scenedetect.frame_timecode into new MAX_FPS_DELTA constant
  • video_manager parameter has been removed from the AdaptiveDetector constructor
  • split_video_ffmpeg and split_video_mkvmerge function arguments have been renamed and defaults updated:
    • suppress_output is now show_output, default is False
    • hide_progress is now show_progress, default is False
  • block_size argument has been removed from the ThresholdDetector constructor
  • calculate_frame_score method of ContentDetector has been renamed to _calculate_frame_score, use new module-level function of the same name instead
  • get_aspect_ratio has been removed from scenedetect.platform (use the aspect_ratio property of a VideoStream instead)
  • Backwards compatibility with v0.5 to avoid breaking most applications on release while still allowing performance improvements

Python Distribution Changes

  • v0.6.0.3 - Fix missing package description
  • v0.6.0.2 - Improve error messaging when OpenCV is not installed
  • v0.6.0.1 - Fix original v0.6 release requiring av to run the scenedetect command

Known Issues

  • URL inputs are not supported by the save-images or split-video commands
  • Variable framerate videos (VFR) are not fully supported, and will yield incorrect timestamps (#168)
  • The detect-threshold option -l/--add-last-scene cannot be disabled
  • Due to a switch from EXE to MSI for the Windows installer, you may have to uninstall older versions first before installing v0.6

PySceneDetect v0.6-rc0

25 Apr 01:35

Choose a tag to compare