mkv2cast.json_progress
JSON progress output for mkv2cast.
This module provides structured JSON output for integration with other applications (web UIs, monitoring tools, etc.).
Functions
Parse FFmpeg progress line for JSON output. |
Classes
|
Progress information for a single file. |
|
Manages JSON progress output to stdout. |
|
Complete state for JSON progress output. |
|
Overall progress for the entire batch. |
- class mkv2cast.json_progress.FileProgress(filename: str, filepath: str, status: str, progress_percent: float = 0.0, current_frame: int = 0, total_frames: int = 0, current_time_ms: int = 0, duration_ms: int = 0, fps: float = 0.0, speed: str = '', bitrate: str = '', size_bytes: int = 0, eta_seconds: float = 0.0, error: str | None = None, started_at: float | None = None, finished_at: float | None = None, output_path: str | None = None)[source]
Bases:
objectProgress information for a single file.
- class mkv2cast.json_progress.OverallProgress(total_files: int = 0, processed_files: int = 0, converted_files: int = 0, skipped_files: int = 0, failed_files: int = 0, current_file: str | None = None, overall_percent: float = 0.0, eta_seconds: float = 0.0, started_at: float | None = None, backend: str = '', encode_workers: int = 1, integrity_workers: int = 1)[source]
Bases:
objectOverall progress for the entire batch.
- class mkv2cast.json_progress.JSONProgressState(version: str = '1.0', timestamp: float = <factory>, event: str = 'progress', overall: OverallProgress = <factory>, files: Dict[str, ~mkv2cast.json_progress.FileProgress]=<factory>, current_encoding: List[str] = <factory>, current_checking: List[str] = <factory>)[source]
Bases:
objectComplete state for JSON progress output.
- overall: OverallProgress
- files: Dict[str, FileProgress]
- class mkv2cast.json_progress.JSONProgressOutput(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
Bases:
objectManages JSON progress output to stdout.
- start(total_files: int, backend: str, encode_workers: int, integrity_workers: int) None[source]
Signal start of processing.
- set_file_duration(filepath: str, duration_ms: int) None[source]
Set the duration for a file (from probe).
- file_encoding_start(filepath: Path, duration_ms: int = 0) None[source]
Signal encoding has started for a file.
- file_progress(filepath: Path, frame: int = 0, fps: float = 0.0, time_ms: int = 0, bitrate: str = '', speed: str = '', size_bytes: int = 0) None[source]
Update encoding progress for a file.