smallstepforman / Medo

Haiku Media Editor
MIT License
147 stars 6 forks source link

[SUGGESTION] Intelligent scene cut detection for automated clip splitting #16

Open MarcoRavich opened 3 years ago

MarcoRavich commented 3 years ago

It could be very useful - expecially for editors - to have an option for automated clip splitting based on scene cuts.

PySceneDetect can help to implement it:

PySceneDetect is a command-line application and a Python library for detecting scene changes in videos, and automatically splitting the video into separate clips. Not only is it free and open-source software (FOSS), but there are several detection methods available (see Features), from simple threshold-based fade in/out detection, to advanced content aware fast-cut detection of each shot.

Here are some of the things people are using PySceneDetect for:

  • splitting home videos or other source footage into individual scenes
  • automated detection and removal of commercials from PVR-saved video sources
  • processing and splitting surveillance camera footage
  • statistical analysis of videos to find suitable "loops" for looping GIFs/cinemagraphs
  • academic analysis of film and video (e.g. finding mean shot length)

https://pyscenedetect.readthedocs.io/en/latest/

Hope that inspires !

smallstepforman commented 3 years ago

Thanks forart for the feedback. Detecting split points procedurally sounds great, and can be done by interrogating whether a specific frame is a Keyframe of a Intraframe in scenarios where the codec doesn't artificially insert keyframes every 1s or so. However, a lot of codecs do insert keyframes at fixed intervals (due to streaming) so we cannot rely on every keyframe being a cut point. We can use some heuristics to determine the delta of a keyframe with it's previous frame and do the split at that interval. This greatly reduces the number of frames we need to check, so sounds like a valid and effective strategy.

I will investigate this feature for R1.1. Right now there are thousands of bugs to fix first, and I'd like to get some more audio effects to reach feature parity with Audacity.