MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / save_html

Function save_html

scenedetect/_cli/commands.py:45–76  ·  view source on GitHub ↗

Handles the `save-html` command.

(
    context: CliContext,
    scenes: SceneList,
    cuts: CutList,
    image_width: int,
    image_height: int,
    filename: str,
    no_images: bool,
    show: bool,
)

Source from the content-addressed store, hash-verified

43
44
45def save_html(
46 context: CliContext,
47 scenes: SceneList,
48 cuts: CutList,
49 image_width: int,
50 image_height: int,
51 filename: str,
52 no_images: bool,
53 show: bool,
54):
55 """Handles the `save-html` command."""
56 assert context.video_stream is not None
57 (image_filenames, output) = (
58 context.save_images_result
59 if context.save_images_result is not None
60 else (None, context.output)
61 )
62
63 html_filename = Template(filename).safe_substitute(VIDEO_NAME=context.video_stream.name)
64 if not html_filename.lower().endswith(".html"):
65 html_filename += ".html"
66 html_path = get_and_create_path(html_filename, output)
67 write_scene_list_html(
68 output_html_filename=html_path,
69 scene_list=scenes,
70 cut_list=cuts,
71 image_filenames=None if no_images else image_filenames,
72 image_width=image_width,
73 image_height=image_height,
74 )
75 if show:
76 webbrowser.open(html_path)
77
78
79def save_qp(

Callers

nothing calls this directly

Calls 3

get_and_create_pathFunction · 0.90
write_scene_list_htmlFunction · 0.90
TemplateClass · 0.85

Tested by

no test coverage detected