diff --git a/src/app.py b/src/app.py index 1c02d89..d5d9e95 100644 --- a/src/app.py +++ b/src/app.py @@ -59,7 +59,16 @@ def main( "-show_streams", filename, ] - result = subprocess.run(cmd, capture_output=True, check=True) + try: + result = subprocess.run(cmd, capture_output=True, check=True) + except FileNotFoundError: + typer.secho("Error: ffprobe not found. Please install FFmpeg.", fg="red", err=True) + raise typer.Exit(code=1) + except subprocess.CalledProcessError as e: + typer.secho("Error: ffprobe failed to probe the file.", fg="red", err=True) + error_output = e.stderr.decode() if e.stderr else str(e) + typer.secho(error_output, fg="red", err=True) + raise typer.Exit(code=1) data = parse_streams(json.loads(result.stdout), video_details) data.original_media_type = original_media_type for stream in data.video_streams: