tomasz-beton/music-video-automaker

Scenedetect should be your version number in requirements because of newer versions problem.

Closed this issue · 1 comments

AdaptiveDetector has diffrent arguments in newer versions of scenedetect. But anyway, here's the patch for code to work with newer version.

commit e0bea67236d413e6d23805c68350847d16a13874
Author: Sławomir Paszko <s.paszko@aisp.pl>
Date:   Fri Jan 13 11:46:25 2023 +0100

    Fixes.

diff --git a/merge_testing.py b/merge_testing.py
index bc5b239..7ad3ce9 100644
--- a/merge_testing.py
+++ b/merge_testing.py
@@ -26,8 +26,8 @@ if __name__ == '__main__':
     output_path = args.output_path
 
     print('Getting scene list')
-    scene_list = get_scene_list(video_path, args.threshold, args.luma_only, 
-            args.min_scene_len, args.min_delta_hsv, args.window_width)
+    scene_list = get_scene_list(video_path, adaptive_threshold=args.threshold, luma_only=args.luma_only, 
+            min_scene_len=args.min_scene_len, min_delta_hsv=args.min_delta_hsv, window_width=args.window_width)
     
     print('Getting beat times')
     beat_times, tempo = get_beat_times(audio_path)
diff --git a/merge_video.py b/merge_video.py
index 17f976a..c88d19b 100644
--- a/merge_video.py
+++ b/merge_video.py
@@ -46,7 +46,7 @@ def get_cut_list(cut_times, tempo, first_beat, audio_len, method='delay'):
 
     # we need not to repeat the begining
     i = 0
-    while cut_times[i] < first_beat:
+    while (i<len(cut_times)) and (cut_times[i] < first_beat):
         i+=1
 
     # cutting up everything into bar length cuts

I added scenedetect==0.5.6.1 to requirements and it works correctly as it used to. We are planning to update and revamp this project, so updating dependencies is not worth looking into at the moment.

Thanks for pointing out some of the issues.