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

Function check_split_video_requirements

scenedetect/_cli/context.py:48–71  ·  view source on GitHub ↗

Validates that the proper tool is available on the system to perform the `split-video` command. Arguments: use_mkvmerge: True if mkvmerge (-m), False otherwise. Raises: click.BadParameter if the proper video splitting tool cannot be found.

(use_mkvmerge: bool)

Source from the content-addressed store, hash-verified

46
47
48def check_split_video_requirements(use_mkvmerge: bool) -> None:
49 """Validates that the proper tool is available on the system to perform the
50 `split-video` command.
51
52 Arguments:
53 use_mkvmerge: True if mkvmerge (-m), False otherwise.
54
55 Raises: click.BadParameter if the proper video splitting tool cannot be found.
56 """
57
58 if (use_mkvmerge and not is_mkvmerge_available()) or not is_ffmpeg_available():
59 error_strs = [
60 "{EXTERN_TOOL} is required for split-video{EXTRA_ARGS}.".format(
61 EXTERN_TOOL="mkvmerge" if use_mkvmerge else "ffmpeg",
62 EXTRA_ARGS=" when mkvmerge (-m) is set" if use_mkvmerge else "",
63 )
64 ]
65 error_strs += ["Ensure the program is available on your system and try again."]
66 if not use_mkvmerge and is_mkvmerge_available():
67 error_strs += ["You can specify mkvmerge (-m) to use mkvmerge for splitting."]
68 elif use_mkvmerge and is_ffmpeg_available():
69 error_strs += ["You can specify copy (-c) to use ffmpeg stream copying."]
70 error_str = "\n".join(error_strs)
71 raise click.BadParameter(error_str, param_hint="split-video")
72
73
74class CliContext:

Callers 1

split_video_commandFunction · 0.90

Calls 3

is_mkvmerge_availableFunction · 0.90
is_ffmpeg_availableFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected