mkv2cast.cli
Command-line interface for mkv2cast.
This is the main entry point for the application.
Functions
|
Auto-detect optimal worker counts based on backend and system resources. |
Check system requirements. |
|
|
Clean logs for all users (requires root). |
|
Clean tmp files for all users (requires root). |
|
Collect target files for processing. |
Get mkv2cast directories for all users on the system. |
|
Detect GPU type and VRAM. |
|
|
Generate log path for input file. |
|
Generate temp path for encoding. |
Get total RAM in GB. |
|
|
Handle utility commands that exit immediately. |
|
Check if filename is our output or temp file. |
Check if script is running as root. |
|
|
Main entry point. |
|
JSON progress output mode for integration with external tools. |
|
Legacy sequential mode. |
|
Pipeline mode with parallel workers. |
|
Rich UI sequential mode. |
|
Check if output already exists for input file. |
|
Parse command-line arguments and return config + optional file path. |
|
Register a process for tracking. |
|
Run in watch mode, monitoring directory for new MKV files. |
|
Check if file should be processed based on filters. |
Terminate all active processes and wait for cleanup. |
|
|
Unregister a process from tracking. |
- mkv2cast.cli.terminate_all_processes() None[source]
Terminate all active processes and wait for cleanup.
- mkv2cast.cli.parse_args(args: List[str] | None = None) Tuple[Config, Path | None][source]
Parse command-line arguments and return config + optional file path.
- mkv2cast.cli.is_our_output_or_tmp(name: str, cfg: Config) bool[source]
Check if filename is our output or temp file.
- mkv2cast.cli.should_process_file(filepath: Path, cfg: Config) Tuple[bool, str | None][source]
Check if file should be processed based on filters.
- mkv2cast.cli.output_exists_for_input(inp: Path, cfg: Config) bool[source]
Check if output already exists for input file.
- mkv2cast.cli.collect_targets(root: Path, single: Path | None, cfg: Config) Tuple[List[Path], List[Tuple[Path, str]]][source]
Collect target files for processing.
- mkv2cast.cli.get_gpu_info() Tuple[str, int][source]
Detect GPU type and VRAM. Returns: (gpu_type, vram_mb) gpu_type: “nvidia”, “amd”, “intel”, “unknown”
- mkv2cast.cli.auto_detect_workers(backend: str) Tuple[int, int][source]
Auto-detect optimal worker counts based on backend and system resources. Returns: (encode_workers, integrity_workers)
- mkv2cast.cli.get_all_users_mkv2cast_dirs() List[Dict[str, Any]][source]
Get mkv2cast directories for all users on the system. Only returns users that have mkv2cast data directories.
- mkv2cast.cli.cleanup_all_users_logs(days: int, verbose: bool = True) Dict[str, int][source]
Clean logs for all users (requires root). Returns dict of {username: removed_count}.
- mkv2cast.cli.cleanup_all_users_tmp(max_age_hours: int = 0, verbose: bool = True) Dict[str, int][source]
Clean tmp files for all users (requires root). max_age_hours=0 means clean all tmp files. Returns dict of {username: removed_count}.
- mkv2cast.cli.get_tmp_path(inp: Path, worker_id: int, tag: str, cfg: Config) Path[source]
Generate temp path for encoding.
- mkv2cast.cli.handle_utility_commands(cfg: Config, args: Namespace) int | None[source]
Handle utility commands that exit immediately.
- mkv2cast.cli.main_json_progress(single: Path | None, cfg: Config) Tuple[int, int, int, int, bool][source]
JSON progress output mode for integration with external tools.
Outputs structured JSON to stdout for each progress update.
- mkv2cast.cli.main_legacy(single: Path | None, cfg: Config) Tuple[int, int, int, int, bool][source]
Legacy sequential mode. Returns (ok, skipped, failed, interrupted, was_interrupted).
- mkv2cast.cli.main_rich(single: Path | None, cfg: Config) Tuple[int, int, int, int, bool][source]
Rich UI sequential mode. Returns (ok, skipped, failed, interrupted, was_interrupted).
- mkv2cast.cli.main_pipeline(single: Path | None, cfg: Config) Tuple[int, int, int, int, bool][source]
Pipeline mode with parallel workers. Returns (ok, skipped, failed, interrupted_count, was_interrupted).