From c3b79a1f4701b32b3cf67e7dc391cef9aa965a31 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Tue, 16 Dec 2025 18:26:00 +0000 Subject: [PATCH] RENAME "clip" option to "save" Clips refer to short recordings, this command can save much longer recordings, therefore "save" is more appropriate --- rewind/clip.py | 12 ++++++------ rewind/video.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rewind/clip.py b/rewind/clip.py index acdca08..bda66ec 100755 --- a/rewind/clip.py +++ b/rewind/clip.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 from datetime import datetime -from rewind.video import clip +from rewind.video import save import obsws_python as obs import sys, argparse @@ -15,10 +15,10 @@ def stop_recording(con): con.stop_record() print("Stopped recording") -def create_clip(con): +def create_recording(con): record_dir = con.get_record_directory() output_file_name = f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}.mp4" - clip(record_dir.record_directory, output_file_name) + save(record_dir.record_directory, output_file_name) print(f"Created clip: {output_file_name}") def build_parser(): @@ -31,7 +31,7 @@ def build_parser(): sub.add_parser("start", help="Start OBS recording") sub.add_parser("stop", help="Stop OBS recording") - sub.add_parser("clip", help="Create a clip from the current recording") + sub.add_parser("save", help="Save a section from the current recording") return parser @@ -46,8 +46,8 @@ def main(argv=None): start_recording(con) elif args.command == "stop": stop_recording(con) - elif args.command == "clip": - create_clip(con) + elif args.command == "save": + create_recording(con) else: parser.error("Unknown command") diff --git a/rewind/video.py b/rewind/video.py index bcd1358..560bd13 100644 --- a/rewind/video.py +++ b/rewind/video.py @@ -19,7 +19,7 @@ def clean_old_ts_files(record_dir, max_age_seconds=60*60*3): os.remove(file_path) print(f"Deleted old file: {file_path}") -def clip(record_dir, output_file_name): +def save(record_dir, output_file_name): # Gather all ts files and combine them into a single mp4 ts_files = [f for f in os.listdir(record_dir) if f.endswith(".ts")] ts_files.sort(key=lambda x: os.path.getmtime(os.path.join(record_dir, x)))