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 withVideoStream),StatsManager, andsave_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 ascenedetect.cfgfile in your user config folder
- Can specify config file path with
- 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-sceneoption to merge last scene if shorter than--min-scene-len - Add
-b/--backendoption to use a specific video decoding backend- Supported backends are
opencvandpyav - Run
scenedetect helpto see a list of backends available on the current system - Both backends are included with Windows builds
- Supported backends are
split-videocommand:detect-adaptivecommand:--drop-short-scenesnow works properly withdetect-adaptive
detect-contentcommand:- Default threshold
-t/--thresholdlowered to 27 to be more sensitive to shot changes (#246) - Add override for global
-m/--min-scene-lenoption
- Default threshold
detect-thresholdcommand:- Remove
-p/--min-percentand-b/--block-sizeoptions - Add override for global
-m/--min-scene-lenoption
- Remove
save-imagescommand now works when-i/--inputis an image sequences- Default backend (OpenCV) is more robust to video decoder failures
-i/--inputmay no longer be specified multiple times, if required use an external tool (e.g.ffmpeg,mkvmerge) to perform concatenation before processing-s/--statsno longer loads existing statistics and will overwrite any existing files-l/--logfilenow respects-o/--output-v/--verbositynow 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()andsplit_video_mkvmerge()now take a single path as inputsave_images()no longer acceptsdownscale_factor- Use
scaleorheight/widtharguments to resize images
- Use
- New
VideoStreamreplacesVideoManager(#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_numberis 1-based whereaspositionis 0-based to align with PTS) - See
test_time_invariantsintests/test_video_stream.pyas a reference of specific behaviours
- Supports both OpenCV (
- Changes to
SceneManager:detect_scenes()now performs video decoding in a background thread, improving performance on most systemsSceneManageris now responsible for frame downscaling via thedownscale/auto_downscalepropertiesdetect_scenes()no longer shows a progress bar by default, setshow_progress=Trueto restore the previous behaviourclear()now clears detectors, as they may be statefulget_scene_list()now returns an empty list if there are no detected cuts, specifystart_in_scene=Truefor previous behavior (one scene spanning the entire input)
- Changes to
StatsManager:save_to_csv()now accepts a path or an open file handlebase_timecodeargument has been removed fromsave_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 FrameTimecodeobjects can now perform arithmetic with formatted strings, e.g.'HH:MM:SS.nnn'
- Merged constants
MAX_FPS_DELTAandMINIMUM_FRAMES_PER_SECOND_DELTA_FLOATinscenedetect.frame_timecodeinto newMAX_FPS_DELTAconstant video_managerparameter has been removed from theAdaptiveDetectorconstructorsplit_video_ffmpegandsplit_video_mkvmergefunction arguments have been renamed and defaults updated:suppress_outputis nowshow_output, default isFalsehide_progressis nowshow_progress, default isFalse
block_sizeargument has been removed from theThresholdDetectorconstructorcalculate_frame_scoremethod ofContentDetectorhas been renamed to_calculate_frame_score, use new module-level function of the same name insteadget_aspect_ratiohas been removed fromscenedetect.platform(use theaspect_ratioproperty of aVideoStreaminstead)- 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
avto run thescenedetectcommand
Known Issues
- URL inputs are not supported by the
save-imagesorsplit-videocommands - Variable framerate videos (VFR) are not fully supported, and will yield incorrect timestamps (#168)
- The
detect-thresholdoption-l/--add-last-scenecannot 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