Skip to content

fix(h3): no desfasar el soundtrack cuando el plan empieza a mitad de canción - #19

Merged
IAnMove merged 2 commits into
mainfrom
cursor/critical-bug-management-7cb7
Aug 29, 2026
Merged

fix(h3): no desfasar el soundtrack cuando el plan empieza a mitad de canción#19
IAnMove merged 2 commits into
mainfrom
cursor/critical-bug-management-7cb7

Conversation

@cursor

@cursor cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown

El concat final de _run_minimax_h3_story_video (H3 Legacy / proyectos H3 sin registry) remuxeaba la canción o el diálogo desde 0:00 aunque el plan saltara la intro.

Los slices de drive por plano ya partían de audio_origin_sec (_audio_timeline_start). El MP4 final no pasaba ese offset a concatenate_multi_clip_videos. El rejoin y el Director nativo sí lo hacen.

Disparador: videoclip o short_film_audio con MiniMax H3 Legacy (o lote Quick Video, que usa ese modelo) cuyo primer plano empieza después de 0 s — intro instrumental, entrada a mitad de tema. Los labios se generan al verso; el montaje suena el instrumental y -shortest recorta el final.

Fix: pasar audio_start_sec=audio_origin_sec en el concat final.

Tests: pytest tests/test_director_minimax_h3.py::test_h3_legacy_assembly_offsets_source_audio_to_plan_start — passed. También los tests de concat H3 existentes y test_rejoin_offsets_source_audio_to_first_planned_time.

No reabre #16, #17 ni #18.

Open in Web View Automation 

Note

Medium Risk
Touches final A/V mux timing for H3 multiclip outputs; wrong offset would still misalign music and dialogue, but the fix aligns assembly with existing per-clip slicing and other pipeline paths.

Overview
Fixes soundtrack desync when MiniMax H3 Legacy (or registry-less H3) assembles a music video or short_film_audio project whose first shot starts after 0 s (e.g. skipping an instrumental intro).

Per-clip generation already drove from audio_origin_sec via _audio_timeline_start, but the final concatenate_multi_clip_videos call in _run_minimax_h3_story_video remuxed the full track from 0:00—so lip-sync matched the verse while the output still played the intro, and -shortest could trim the end. The change passes audio_start_sec=audio_origin_sec on that final concat, matching rejoin and native Director behavior.

Tests update FakeWgp.concatenate_multi_clip_videos stubs for the new argument and add test_h3_legacy_assembly_offsets_source_audio_to_plan_start (plan starting at 12.5 s asserts assembly uses the same offset).

Reviewed by Cursor Bugbot for commit a47cd57. Configure here.

…canción

El concat final de H3 Legacy/secuencial remuxeaba la canción desde 0:00
aunque el plan saltara la intro. Los slices de drive ya partían de
audio_origin_sec, así que los labios iban al verso y el MP4 final
sonaba el instrumental.

Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
@github-actions

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 3 file(s); +96/-6; 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/director_pipeline.py, tests/test_director_h3_identity_continuity.py, tests/test_director_minimax_h3.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.

…anagement-7cb7

Co-authored-by: THEINAOG <IAnMove@users.noreply.github.com>
@IAnMove
IAnMove marked this pull request as ready for review August 29, 2026 12:15

@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. No pude aprobar: GitHub bloquea la autoaprobación de este PR. Se asignó revisor para revisión humana.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor
cursor Bot requested a review from IAnMove August 29, 2026 12:18
@IAnMove
IAnMove merged commit dc09942 into main Aug 29, 2026
2 of 4 checks passed
cursor Bot pushed a commit that referenced this pull request Aug 29, 2026
#19 already offset the final remux from audio_origin_sec. This branch
still walks a single elapsed_frames cursor so shot 2+ slices the song
after prior segments. Keep both tests after the conflict in
test_director_minimax_h3.py.

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