Skip to content

Free, open-source AI video generator for Mac. Run LTX-2.5 and MiniMax H3 (Hailuo) locally on Apple Silicon: text-to-video and image-to-video with sound, lip-sync, character LoRA training, songs from lyrics (YuE2) and image editing (Qwen-Image-Edit). One-click install via Pinokio. Offline: no cloud, no API key, no NVIDIA GPU.

fix(extend): add -f mp4 to downscale ffmpeg + document hang scope

mrbizarro736ca0d1120a
diff --git a/ROADMAP.md b/ROADMAP.md
index 0dde676..51ad12b 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -249,13 +249,22 @@ Tracking: the HDR-specific Phase 1 work landed via re-exposing the
hdr toggle (commit `<hdr-ship>`); the generic Phases 2–5 stay open
in this entry.
-### `[ ]` I2V Balanced perf — post-decode hang on Q4 distilled path
+### `[ ]` I2V Balanced + Extend perf — post-decode hang on Q4 distilled path
After the May 9 upstream `ltx-2-mlx` refactor, I2V Balanced (and T2V
Balanced) route through `DistilledPipeline.generate_two_stage(image=...)`.
The actual render completes in ~3 min for a 5s I2V at 1024×576, but
the helper then hangs 5-15 min before signaling done to the panel.
+**Update 2026-05-21 (later session):** Extend exhibits the EXACT SAME
+hang. 768×416 +6f Extend at 12 steps cfg=1.0: denoise completes in
+10:23, decode completes in 16s (output mp4 valid on disk), then the
+helper sits frozen for the next 13+ minutes until killed. So this is
+not specific to DistilledPipeline — it's any pipe that fuses the
+distilled stage 2 LoRA on the dev transformer and then returns from
+`_decode_and_save_video()`. Both DistilledPipeline and the Extend
+pipeline take that path.
+
Diagnostic findings (2026-05-21 session):
- Output mp4 IS written to disk before the hang starts.
- Stack samples show the helper deep in Metal command-buffer
@@ -266,6 +275,9 @@ Diagnostic findings (2026-05-21 session):
MLX/Metal completion-handler chains holding the GIL through
Python frame teardown.
- LTX2_DIT_EVAL_EVERY tuning has no effect (tested 0/1/4/8).
+- A2V (A2VidPipelineTwoStage), FFLF, T2V Character HQ
+ (TI2VidTwoStagesHQPipeline) all return cleanly — confirming the
+ hang is specific to the distilled-fused-then-decode pattern.
Path forward:
1. **For Q8 (≥48 GB) tiers:** route Balanced I2V/T2V through
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index ca441f5..3e1b3e9 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -3651,10 +3651,16 @@ def _ensure_downscaled(src: Path, max_dim: int = 768, align: int = 32) -> Path:
# cancelled-mid-encode run can't leave a broken mp4 at `cached` that
# the next call would treat as a valid cache hit.
partial = cached.with_suffix(cached.suffix + ".partial")
+ # `-f mp4` is mandatory: the `.mp4.partial` extension confuses ffmpeg's
+ # format autodetect ("Unable to choose an output format … use a standard
+ # extension or specify the format manually") and the whole Extend mode
+ # dies at downscale time. Was silent for a while because Extend wasn't
+ # exercised after the .partial rename was added.
cmd = [str(FFMPEG), "-y", "-i", str(src),
"-vf", f"scale={new_w}:{new_h}",
"-c:v", "libx264", "-pix_fmt", "yuv444p", "-crf", "0", "-preset", "veryfast",
"-c:a", "copy", # don't re-encode audio — extend doesn't need it transformed
+ "-f", "mp4",
str(partial)]
try:
subprocess.run(cmd, check=True, capture_output=True, timeout=120)