@@ -346,7 +346,7 @@ def scenedetect(
346346)
347347@click .pass_context
348348def help_command (ctx : click .Context , command_name : str ):
349- """Print help for command (` help [command]`) ."""
349+ """Print full help reference ."""
350350 assert isinstance (ctx .parent .command , click .MultiCommand )
351351 parent_command = ctx .parent .command
352352 all_commands = set (parent_command .list_commands (ctx ))
@@ -1011,7 +1011,7 @@ def export_html_command(
10111011 "-o" ,
10121012 metavar = "DIR" ,
10131013 type = click .Path (exists = False , dir_okay = True , writable = True , resolve_path = False ),
1014- help = "Output directory to save videos to. Overrides global option -o/--output if set .%s"
1014+ help = "Output directory to save videos to. Overrides global option -o/--output.%s"
10151015 % (USER_CONFIG .get_help_string ("list-scenes" , "output" , show_default = False )),
10161016)
10171017@click .option (
@@ -1084,7 +1084,7 @@ def list_scenes_command(
10841084 "-o" ,
10851085 metavar = "DIR" ,
10861086 type = click .Path (exists = False , dir_okay = True , writable = True , resolve_path = False ),
1087- help = "Output directory to save videos to. Overrides global option -o/--output if set .%s"
1087+ help = "Output directory to save videos to. Overrides global option -o/--output.%s"
10881088 % (USER_CONFIG .get_help_string ("split-video" , "output" , show_default = False )),
10891089)
10901090@click .option (
@@ -1259,7 +1259,7 @@ def split_video_command(
12591259 "-o" ,
12601260 metavar = "DIR" ,
12611261 type = click .Path (exists = False , dir_okay = True , writable = True , resolve_path = False ),
1262- help = "Output directory for images. Overrides global option -o/--output if set .%s"
1262+ help = "Output directory for images. Overrides global option -o/--output.%s"
12631263 % (USER_CONFIG .get_help_string ("save-images" , "output" , show_default = False )),
12641264)
12651265@click .option (
@@ -1445,30 +1445,62 @@ def save_images_command(
14451445 ctx .save_images = True
14461446
14471447
1448+ @click .command ("save-qp" , cls = _Command )
1449+ @click .option (
1450+ "--filename" ,
1451+ "-f" ,
1452+ metavar = "NAME" ,
1453+ default = None ,
1454+ type = click .STRING ,
1455+ help = "Filename format to use.%s" % (USER_CONFIG .get_help_string ("save-qp" , "filename" )),
1456+ )
1457+ @click .option (
1458+ "--output" ,
1459+ "-o" ,
1460+ metavar = "DIR" ,
1461+ type = click .Path (exists = False , dir_okay = True , writable = True , resolve_path = False ),
1462+ help = "Output directory to save QP file to. Overrides global option -o/--output.%s"
1463+ % (USER_CONFIG .get_help_string ("save-qp" , "output" , show_default = False )),
1464+ )
1465+ @click .pass_context
1466+ def save_qp_command (
1467+ ctx : click .Context ,
1468+ filename : ty .Optional [ty .AnyStr ],
1469+ output : ty .Optional [ty .AnyStr ],
1470+ ):
1471+ ctx = ctx .obj
1472+ assert isinstance (ctx , CliContext )
1473+
1474+ save_qp_args = {
1475+ "filename_format" : ctx .config .get_value ("save-qp" , "filename" , filename ),
1476+ "output_dir" : ctx .config .get_value ("save-qp" , "output" , output ),
1477+ }
1478+ ctx .add_command (cli_commands .save_qp , save_qp_args )
1479+
1480+
14481481# ----------------------------------------------------------------------
1449- # Commands Omitted From Help List
1482+ # CLI Sub-Command Registration
14501483# ----------------------------------------------------------------------
14511484
1452- # Info Commands
1485+ # Informational
14531486scenedetect .add_command (about_command )
14541487scenedetect .add_command (help_command )
14551488scenedetect .add_command (version_command )
14561489
1457- # ----------------------------------------------------------------------
1458- # Commands Added To Help List
1459- # ----------------------------------------------------------------------
1460-
1461- # Input / Output
1462- scenedetect .add_command (export_html_command )
1463- scenedetect .add_command (list_scenes_command )
1490+ # Input
14641491scenedetect .add_command (load_scenes_command )
1465- scenedetect .add_command (save_images_command )
1466- scenedetect .add_command (split_video_command )
14671492scenedetect .add_command (time_command )
14681493
1469- # Detection Algorithms
1494+ # Detectors
14701495scenedetect .add_command (detect_adaptive_command )
14711496scenedetect .add_command (detect_content_command )
14721497scenedetect .add_command (detect_hash_command )
14731498scenedetect .add_command (detect_hist_command )
14741499scenedetect .add_command (detect_threshold_command )
1500+
1501+ # Output
1502+ scenedetect .add_command (export_html_command )
1503+ scenedetect .add_command (save_qp_command )
1504+ scenedetect .add_command (list_scenes_command )
1505+ scenedetect .add_command (save_images_command )
1506+ scenedetect .add_command (split_video_command )
0 commit comments