fix(mix): no tirar el audio cuando solo algunos clips tienen pista - #16
Merged
Conversation
El join suave sondaba únicamente el primer archivo. Un bumper sin audio dejaba el montaje mudo; un B-roll mudo al final hacía fallar ffmpeg. Ahora se sonda cada clip y se sintetiza silencio donde falte la pista. 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. |
cursor Bot
pushed a commit
that referenced
this pull request
Aug 29, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


El join suave (freeze-tail + crossfade) sondaba únicamente el primer clip para decidir si el montaje llevaba audio.
[n:a]inexistente, el join fallaba y el fallback duro también, así que el film no se ensamblaba.Qué cambia
anullsrc) para queacrossfadeno rompa.Cómo reproducir
Validación
pytest tests/test_mix_concat.py— 9 passed.Note
Medium Risk
Changes ffmpeg filter graphs for a core assembly path; incorrect silence/stream handling could still affect dialogue or cause encode failures, though behavior is covered by new unit tests.
Overview
Fixes hold-tail + crossfade assembly when clips mix video-only segments with dialogue: the pipeline used to probe only the first clip for audio, which could mute the whole export or make ffmpeg fail on missing
[n:a]streams.Per-clip probing (
probe_has_audio/probe_audio_flags) now decides whether to mix audio if any clip has a track.build_hold_crossfade_filteraccepts optionalhas_audioflags and, for clips without audio, inserts 48 kHz stereo silence viaanullsrc(with resample/format on real tracks) soacrossfadestays valid. If no clip has audio, the graph stays video-only as before.concat_with_tail_hold_and_crossfadewires this in by replacing the first-clip ffprobe with flags for every input. Tests cover silent-first, silent-later, all-silent, and per-path probing.Reviewed by Cursor Bugbot for commit c28e73c. Configure here.