{"record":{"id":"7e60f9d60c2d7c01","repo":"langchain-ai/deepagents","slug":"ffmpeg-conversion-failed-with-exit-code-proc-retu","errorCode":null,"errorMessage":"ffmpeg conversion failed with exit code {proc.returncode}: {stderr}","messagePattern":"ffmpeg conversion failed with exit code (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/speech.py","lineNumber":308,"sourceCode":"                \"-f\",\n                \"wav\",\n                str(output),\n            ],\n            capture_output=True,\n            timeout=120,\n            check=False,\n        )\n    except FileNotFoundError as exc:\n        msg = \"ffmpeg not found on PATH; install ffmpeg to enable voice transcription.\"\n        raise RuntimeError(msg) from exc\n    except subprocess.TimeoutExpired as exc:\n        msg = f\"ffmpeg timed out while converting {path}\"\n        raise RuntimeError(msg) from exc\n\n    if proc.returncode != 0:\n        stderr = proc.stderr.decode(\"utf-8\", errors=\"replace\")\n        msg = f\"ffmpeg conversion failed with exit code {proc.returncode}: {stderr}\"\n        raise RuntimeError(msg)\n    return output\n","sourceCodeStart":290,"sourceCodeEnd":310,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/speech.py#L290-L310","documentation":"After ffmpeg runs, `_convert_to_wav` checks the exit code. A non-zero exit means conversion failed, and ffmpeg's decoded stderr is included in this RuntimeError to explain why (corrupt file, unsupported codec, unreadable path, etc.).","triggerScenarios":"Local transcription of an audio file that ffmpeg cannot decode: corrupted/truncated uploads, unsupported containers/codecs in the ffmpeg build, or an input path that exists but is unreadable.","commonSituations":"Users uploading voice notes with exotic codecs (e.g. AMR, WMA); zero-byte or partial downloads; ffmpeg builds compiled without proprietary decoders (e.g. no AAC on some minimal builds).","solutions":["Read the stderr embedded in the message to identify the codec/IO problem","Validate the input file is a complete, decodable media file (e.g. `ffprobe <file>` succeeds) before transcribing","Re-encode or re-export the source file to a common format (mp3/m4a/wav) and retry"],"exampleFix":"# before\ntranscribe(partial_download.webm)  # zero-byte / truncated file\n# after\nif not path.stat().st_size:\n    raise ValueError(\"uploaded audio is empty\")\ntranscribe(path)","handlingStrategy":"validation","validationCode":"import subprocess\nprobe = subprocess.run([\"ffprobe\", \"-v\", \"error\", str(path)], capture_output=True)\nif probe.returncode != 0:\n    raise ValueError(f\"unreadable audio {path}: {probe.stderr.decode(errors='replace')}\")","typeGuard":null,"tryCatchPattern":"try:\n    text = transcribe_local(path)\nexcept RuntimeError as exc:\n    if str(exc).startswith(\"ffmpeg conversion failed\"):\n        logger.error(\"bad media file: %s\", exc)\n        text = \"\"\n    else:\n        raise","preventionTips":["Validate uploads (size, container, codec) before transcription","Re-encode user uploads to mp3/wav on ingest","Use an ffmpeg build with the codecs your users actually send (e.g. libfdk/aac)"],"tags":["ffmpeg","voice","conversion","media"],"backgroundTag":"ffmpeg-conversion-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}