mkv2cast.pipeline
Pipeline orchestrator for parallel processing in mkv2cast.
Manages multiple integrity check and encode workers processing files in parallel.
Functions
Auto-detect optimal number of workers based on system resources. |
|
|
Perform integrity check with Rich UI progress updates. |
|
Register a process for tracking. |
|
Run ffmpeg command while updating Rich UI progress. |
Terminate all active processes. |
|
|
Unregister a process from tracking. |
Classes
|
Job data passed from integrity worker to encode worker. |
|
Orchestrates parallel integrity check and encoding with multiple workers. |
- class mkv2cast.pipeline.EncodeJob(inp: Path, decision: Decision, log_path: Path, final: Path, tmp: Path, dur_ms: int, stage: str, integrity_time: float)[source]
Bases:
objectJob data passed from integrity worker to encode worker.
- mkv2cast.pipeline.integrity_check_with_progress(path: Path, ui: RichProgressUI, worker_id: int, filename: str, log_path: Path | None = None, stop_event: Event | None = None, cfg: Config | None = None) Tuple[bool, float][source]
Perform integrity check with Rich UI progress updates.
Returns (success, elapsed_seconds).
- mkv2cast.pipeline.run_ffmpeg_with_progress(cmd: List[str], ui: RichProgressUI, worker_id: int, stage: str, filename: str, dur_ms: int, log_path: Path | None, inp: Path, stop_event: Event | None = None) int[source]
Run ffmpeg command while updating Rich UI progress.
Returns the process return code.
- class mkv2cast.pipeline.PipelineOrchestrator(targets: List[Path], backend: str, ui: RichProgressUI, cfg: Config, encode_workers: int, integrity_workers: int, get_log_path: Callable[[Path], Path], get_tmp_path: Callable[[Path, int, str], Path], output_exists_fn: Callable[[Path, Config], bool], history: HistoryRecorder | None = None)[source]
Bases:
objectOrchestrates parallel integrity check and encoding with multiple workers.