Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

update cut

pxy2c09712a466b
diff --git a/tools/scene_cut/cut.py b/tools/scene_cut/cut.py
index 94aaf92..7bf7b9e 100644
--- a/tools/scene_cut/cut.py
+++ b/tools/scene_cut/cut.py
@@ -117,10 +117,11 @@ def split_video(
# cmd += ['-v', 'error']
# clip to cut
- # -ss after -i is very slow; put -ss before -i
- cmd += ["-nostdin", "-y", "-i", video_path]
- if scene is not None:
- cmd += ["-ss", str(s.get_seconds()), "-t", str(duration.get_seconds())]
+ # Note: -ss after -i is very slow; put -ss before -i !!!
+ if scene is None:
+ cmd += ["-nostdin", "-y", "-i", video_path]
+ else:
+ cmd += ["-nostdin", "-y", "-ss", str(s.get_seconds()), "-i", video_path, "-t", str(duration.get_seconds())]
# target fps
if target_fps is not None: