HKUDS/DeepTutor · error · ManimRenderError

Failed to inspect rendered video duration:

Error message

Failed to inspect rendered video duration: 

What it means

Raised by _probe_duration when the ffprobe subprocess exits non-zero while asking for the rendered video's duration. The message carries ffprobe's stderr. Indicates an unreadable/absent video file or a missing/nonfunctional ffprobe binary, blocking frame-timestamp planning for visual review.

Solutions

  1. Confirm the video file exists and is readable before probing
  2. Install ffprobe (part of ffmpeg) and ensure it is on PATH
  3. Log/inspect the ffprobe stderr included in the error for the precise codec or IO failure
  4. Regenerate the video if the file is corrupt
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at deeptutor/agents/math_animator/visual_review.py:109 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/1c3c1b74a0a63970. Report an issue: GitHub.

Appendix: source

Thrown at deeptutor/agents/math_animator/visual_review.py:109

    async def _probe_duration(self, video_path: Path) -> float:
        command = [
            "ffprobe",
            "-v",
            "error",
            "-show_entries",
            "format=duration",
            "-of",
            "default=noprint_wrappers=1:nokey=1",
            str(video_path),
        ]
        process = await asyncio.create_subprocess_exec(
            *command,
            stdout=asyncio.subprocess.PIPE,
            stderr=asyncio.subprocess.PIPE,
        )
        stdout, stderr = await process.communicate()
        if process.returncode != 0:
            raise ManimRenderError(
                "Failed to inspect rendered video duration: "
                + stderr.decode(errors="ignore").strip()
            )
        try:
            return max(float(stdout.decode().strip() or "0"), 0.0)
        except ValueError as exc:
            raise ManimRenderError(
                "Rendered video duration could not be parsed for visual review."
            ) from exc

    @staticmethod
    def _choose_timestamps(duration: float) -> list[float]:
        if duration <= 0:
            return [0.0]
        if duration < 2:
            return [0.0, min(duration / 2, duration), max(duration - 0.05, 0.0)]
        return [
            max(duration * 0.15, 0.0),

View on GitHub (pinned to 3e82f13042)