Validate and create output directory if it doesn't exist. Args: output_dir: Path to the output directory Returns: Path object of the validated output directory
(output_dir: str)
| 103 | |
| 104 | |
| 105 | def validate_output_dir(output_dir: str) -> Path: |
| 106 | """Validate and create output directory if it doesn't exist. |
| 107 | Args: |
| 108 | output_dir: Path to the output directory |
| 109 | Returns: |
| 110 | Path object of the validated output directory |
| 111 | """ |
| 112 | path = Path(output_dir) |
| 113 | |
| 114 | if path.exists() and not path.is_dir(): |
| 115 | raise typer.BadParameter(f"{output_dir} exists but is not a directory") |
| 116 | |
| 117 | return path |
| 118 | |
| 119 | |
| 120 | def parse_timecode(video: any, time_str: Optional[str]) -> Optional[FrameTimecode]: |