babysor/MockingBird · error · RuntimeError
ffmpeg failed: {' '.join(cmd)}\n{proc.stderr}
Error message
ffmpeg failed: {' '.join(cmd)}\n{proc.stderr} What it means
RuntimeError raised by _run_ff whenever an ffmpeg subprocess exits non-zero; stderr is captured and included. All audio processing steps (pad/trim, atempo, delay, final mix) funnel through this helper.
Source
Thrown at skills/speak/scripts/render_timeline.py:118
return v, v
def resolve_segment_cfg(index: int, config: Dict[str, Any]) -> Dict[str, Any]:
merged = dict(config.get("default", {}))
for key, seg_cfg in config.get("segments", {}).items():
lo, hi = parse_segment_key(key)
if lo <= index <= hi:
merged.update(seg_cfg)
return merged
# ── ffmpeg helpers ────────────────────────────────────────────────────
def _run_ff(cmd: List[str]) -> None:
proc = subprocess.run(cmd, capture_output=True, text=True)
if proc.returncode != 0:
raise RuntimeError(f"ffmpeg failed: {' '.join(cmd)}\n{proc.stderr}")
def ensure_ffmpeg() -> None:
if not shutil.which("ffmpeg"):
raise RuntimeError("ffmpeg not found in PATH.")
def probe_duration_ms(path: Path) -> float:
proc = subprocess.run(
[
"ffprobe", "-v", "error", "-show_entries", "format=duration",
"-of", "default=noprint_wrappers=1:nokey=1", str(path),
],
capture_output=True, text=True,
)
if proc.returncode != 0:
raise RuntimeError(f"ffprobe failed on {path}: {proc.stderr}")
return float(proc.stdout.strip()) * 1000View on GitHub (pinned to 28dc5e14f1)
Solutions
- Read the embedded ffmpeg stderr — it names the exact failing filter/option
- Reproduce the command manually in a shell to iterate quickly
- Upgrade ffmpeg to a recent build if a filter/encoder is unsupported
- Verify input audio files are valid and output dir is writable
Defensive patterns
Strategy: try-catch
Validate before calling
import shutil
assert shutil.which('ffmpeg'), 'ffmpeg required' Try / catch
try:
_run_ff(cmd)
except RuntimeError as e:
print(e); subprocess.run(' '.join(cmd), shell=True) # reproduce manually
raise Prevention
- Pin a recent ffmpeg version in Dockerfiles
- Test the exact filter chain on samples first
- Validate inputs are real audio files
When it happens
Trigger: Any ffmpeg filter error: invalid adelay/amix/atempo arguments, unsupported/corrupt input file, missing encoder for the requested output format, or output path not writable.
Common situations: Old ffmpeg build lacking a filter or encoder, mistyped output extension (e.g. .m4a without an AAC encoder enabled), paths with characters that break arg assembly, or truncated TTS output files fed in.
Related errors
- ffprobe failed on {path}: {proc.stderr}
- No segments to mix.
- kokoro-tts failed for cue {cue.index}: {proc.stderr}
- Package 'webrtcvad' not found. This package enables noise re
- Package 'webrtcvad' not found. This package enables noise re
AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27).
Data as JSON: /api/errors/9aeef3eb19dbffbf.
Report an issue: GitHub.