ATH-MaaS/Pixelle-Video · error · FileNotFoundError

Video file not found: {video_path}

Error message

Video file not found: {video_path}

What it means

analyze_video checks Path(video_path).exists() before delegating to _query_vlm and raises FileNotFoundError for missing video files. Same pre-flight pattern as analyze_image but for video assets.

Source

Thrown at pixelle_video/services/api_asset_analysis.py:116

        if not image_file.exists():
            raise FileNotFoundError(f"Image file not found: {image_path}")

        return await self._query_vlm(
            prompt=prompt or self.IMAGE_PROMPT,
            image_paths=[str(image_file)],
            model=model,
        )

    async def analyze_video(
        self,
        video_path: str,
        model: Optional[str] = None,
        prompt: Optional[str] = None,
        **_: object,
    ) -> str:
        video_file = Path(video_path)
        if not video_file.exists():
            raise FileNotFoundError(f"Video file not found: {video_path}")

        return await self._query_vlm(
            prompt=prompt or self.VIDEO_PROMPT,
            image_paths=[],
            video_paths=[str(video_file)],
            model=model,
        )

    async def __call__(self, asset_path: str, asset_type: Optional[str] = None, **kwargs) -> str:
        path = Path(asset_path)
        resolved_type = asset_type or self._get_asset_type(path)
        if resolved_type == "image":
            return await self.analyze_image(asset_path, **kwargs)
        if resolved_type == "video":
            return await self.analyze_video(asset_path, **kwargs)
        raise ValueError(f"Unsupported asset type for VLM analysis: {asset_path}")

    async def _query_vlm(

View on GitHub (pinned to 848b054e4f)

Solutions

  1. Check Path(video_path).exists() before invoking analyze_video
  2. Use absolute resolved paths when storing asset references at upload time
  3. Ensure video upload/encoding completed before the pipeline analyzes the asset
  4. Do not pass URLs — download the media to a local file first

Example fix

# before
await analyzer.analyze_video(video_path="https://cdn.example.com/clip.mp4")
# after
local = Path("/tmp/uploads/clip.mp4")  # downloaded beforehand
await analyzer.analyze_video(video_path=str(local))
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
v = Path(video_path)
if not v.is_file():
    raise FileNotFoundError(f"video missing before analysis: {v}")

Type guard

def video_exists(path: str) -> bool:
    return Path(path).is_file()

Try / catch

try:
    desc = await analyzer.analyze_video(video_path)
except FileNotFoundError:
    desc = await reupload_and_analyze_video(video_path)

Prevention

When it happens

Trigger: Calling analyze_video with a path that does not exist on disk — deleted/moved temp file, wrong extension, URL passed instead of local path, or relative path broken by CWD change.

Common situations: Upload pipeline stores video under a temp dir that was cleaned; assets recorded before upload finished; path truncated or extension stripped by an earlier processing step.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30). Data as JSON: /api/errors/54c84528930aa685. Report an issue: GitHub.