fix(mix): no tirar el diálogo en Recast cuando solo algunos clips tienen pista - #17
Conversation
Recast/Repaint/Outpaint (y el fallback del join suave) sondaban solo el primer clip. Un bumper o plano H3 mudo en el slot 0 tiraba el diálogo; un clip sin audio más tarde tumbaba ffmpeg. Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
PR Review — Loreframe StudioRisk: low Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
Keep probe_has_audio / probe_audio_flags from #16 as the single probe path, add the ffmpeg fallback from this branch, and keep the Recast hard-concat graph. Tests cover both the soft join and the hard concat. Co-authored-by: THEINAOG <IAnMove@users.noreply.github.com>
Co-authored-by: THEINAOG <IAnMove@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6d3e242. Configure here.
| if audio_flags and not all(audio_flags): | ||
| silent_durations = [ | ||
| probe_duration_seconds(path, ffmpeg_bin) or 1.0 | ||
| for path in valid_paths |
There was a problem hiding this comment.
Silence fallback desyncs mixed concat
High Severity
Mute clips get a hardcoded 1.0s anullsrc pad when probe_duration_seconds returns nothing. concat then keeps audio and video on separate timelines, so later dialogue plays at the wrong time while Recast's frame check still accepts the file. That probe rewrites ffmpeg_bins inside FFMPEG_BINARY to a missing ffprobe_bins path, so the fallback is the live mixed-audio path.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 6d3e242. Configure here.




El concat duro de
concatenate_multi_clip_videossondaba solo el clip 0 para decidir si había audio embebido. Recast / Repaint / Outpaint (y el fallback del join suave) van siempre por ese camino desde el PR #13.Impacto
[n:a]que no existe, el join falla y Recast borra el MP4.Esto es el mismo síntoma que el PR #16, pero en el grafo de concat duro. El #16 solo toca el join suave de
mix_concat.py, que Recast ya no usa.Qué cambia
anullsrc) para queconcat=a=1sea legal y el diálogo se conserve.Cómo reproducir
Validación
pytest tests/test_mix_concat.py— 12 passed, incluidos dos concats reales con ffmpeg (mudo+diálogo y diálogo+mudo).El PR #16 (join suave) sigue abierto y no se solapa con estos archivos de filtro duro.
Note
Medium Risk
Changes the ffmpeg concat path used by length-locked Recast-style assembly; wrong filter graphs could still break joins or timing, though behavior is heavily covered by new unit and ffmpeg integration tests.
Overview
Fixes Recast / Repaint / Outpaint hard multi-clip joins (and the soft-join fallback) that previously inferred embedded audio from only the first clip. That could yield a silent mix when dialogue lived in later segments, or crash ffmpeg when the first clip had audio but a later one did not.
concatenate_multi_clip_videosnow probes every clip via sharedprobe_audio_flags, and builds the hard-concatfilter_complexthrough newbuild_hard_concat_filter. When the batch is mixed, clips without an audio stream get stereo silence (anullsrc) sized from per-clip duration soconcat=a=1stays valid and dialogue is kept; all-audio and all-silent batches keep the previous simple graphs.probe_has_audioalso tries an ffmpeg stderr fallback when ffprobe fails before failing open, so flaky probes are less likely to drop later dialogue.Tests cover filter graphs for mixed/silent/all-audio cases, assert wgp no longer keys audio off clip 0, and run real ffmpeg joins for silent+talk and talk+silent.
Reviewed by Cursor Bugbot for commit 6d3e242. Configure here.