Skip to content

fix(mix): no tirar el audio cuando solo algunos clips tienen pista - #16

Merged
IAnMove merged 1 commit into
mainfrom
cursor/critical-bug-management-aa6d
Aug 29, 2026
Merged

fix(mix): no tirar el audio cuando solo algunos clips tienen pista#16
IAnMove merged 1 commit into
mainfrom
cursor/critical-bug-management-aa6d

Conversation

@cursor

@cursor cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

El join suave (freeze-tail + crossfade) sondaba únicamente el primer clip para decidir si el montaje llevaba audio.

  • Bumper o plano visual-only al inicio: el mix salía mudo y se perdía el diálogo de los clips siguientes.
  • Diálogo al inicio y B-roll sin pista después: ffmpeg pedía [n:a] inexistente, el join fallaba y el fallback duro también, así que el film no se ensamblaba.

Qué cambia

  • Se sonda cada clip.
  • Si alguno tiene audio, el mix lo conserva.
  • Los clips sin pista reciben silencio estéreo 48 kHz (anullsrc) para que acrossfade no rompa.
  • Si ninguno tiene audio, el montaje sigue siendo solo vídeo.

Cómo reproducir

  1. Ensamblar 3+ clips sin banda sonora externa (Director / Series / rejoin de galería).
  2. El primero es vídeo-only (Wan, import, bumper) y los siguientes tienen diálogo H3 → el MP4 final salía silencioso.
  3. O al revés: diálogo primero y un B-roll sin audio → el ensamblado fallaba.

Validación
pytest tests/test_mix_concat.py — 9 passed.

Open in Web View Automation 

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_filter accepts optional has_audio flags and, for clips without audio, inserts 48 kHz stereo silence via anullsrc (with resample/format on real tracks) so acrossfade stays valid. If no clip has audio, the graph stays video-only as before.

concat_with_tail_hold_and_crossfade wires 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.

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>
@github-actions

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 2 file(s); +123/-20; backend services

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • No heuristic issues. Still run the CI checklist below.

Changed files

  • modified: app/services/mix_concat.py, tests/test_mix_concat.py

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

@IAnMove
IAnMove marked this pull request as ready for review August 29, 2026 12:07
@IAnMove
IAnMove merged commit 62fba9c into main Aug 29, 2026
4 of 6 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Approval criteria are met: Cursor Bugbot and Cursor Security Agent completed successfully with no findings that need human review, but GitHub blocked this automation from approving its own PR. No reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants