langchain-ai/deepagents · error · RuntimeError

ffmpeg timed out while converting {path}

Error message

ffmpeg timed out while converting {path}

What it means

ffmpeg conversion of the input audio to WAV is wrapped with a 120-second timeout. If `subprocess.run` raises TimeoutExpired, `_convert_to_wav` raises this RuntimeError naming the input file, aborting transcription for that file.

Source

Thrown at libs/talon/deepagents_talon/speech.py:303

                str(path),
                "-ar",
                "16000",
                "-ac",
                "1",
                "-f",
                "wav",
                str(output),
            ],
            capture_output=True,
            timeout=120,
            check=False,
        )
    except FileNotFoundError as exc:
        msg = "ffmpeg not found on PATH; install ffmpeg to enable voice transcription."
        raise RuntimeError(msg) from exc
    except subprocess.TimeoutExpired as exc:
        msg = f"ffmpeg timed out while converting {path}"
        raise RuntimeError(msg) from exc

    if proc.returncode != 0:
        stderr = proc.stderr.decode("utf-8", errors="replace")
        msg = f"ffmpeg conversion failed with exit code {proc.returncode}: {stderr}"
        raise RuntimeError(msg)
    return output

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Pre-convert long audio to a smaller format (e.g. 16 kHz mono mp3/opus) before transcription, or split into chunks
  2. Run transcription on hardware with more CPU/IO headroom
  3. Avoid network-mounted input; copy the file locally first
Defensive patterns

Strategy: retry

Try / catch

from tenacity import retry, stop_after_attempt
@retry(stop=stop_after_attempt(2), retry=retry_if_exception_message(match="ffmpeg timed out"))
def convert(path):
    return transcribe_local(path)

Prevention

When it happens

Trigger: Local transcription of an audio file whose ffmpeg conversion exceeds 120 seconds — typically very large/long recordings or slow/constrained hardware (CPU-starved containers).

Common situations: Transcribing hour-long meeting recordings on a small CI container; disk-I/O-bound machines; network-mounted audio files with slow reads.

Understand the failure class

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/ddf19b87486627e8. Report an issue: GitHub.