Skip to content

Add GOP-aware smart rendering to video concatenation - #9856

Open
JPPhoto wants to merge 2 commits into
invoke-ai:mainfrom
JPPhoto:smart-video-concatenation
Open

JPPhoto wants to merge 2 commits into
invoke-ai:mainfrom
JPPhoto:smart-video-concatenation

Conversation

@JPPhoto

@JPPhoto JPPhoto commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

#9833 laid the groundwork for adding GOP-aware smart rendering to video concatenation. This PR adds it to video_concat (version 1.3.0), preserving original H.264 video data outside transition regions when inputs are compatible. It re-encodes transition bridges extended to safe GOP boundaries and falls back to the existing full-encoding path when stream copying is unsafe. Existing transitions and audio assembly are retained.

Related Issues / Discussions

Builds on #9833.

QA Instructions

QA Instructions

  • PYTHONOPTIMIZE=0 OMP_NUM_THREADS=1 uv run --no-sync pytest -p no:cacheprovider tests/app/invocations/test_video_concat_splice.py - 49 passed.
  • Ruff 0.11.2 check and format checks passed for the seven changed Python files.
  • Chromium playback: five seeks around splice boundaries succeeded.
  • One warm-cache benchmark with two 40-second 640x360 clips at 30 FPS and an 8-frame crossfade: smart rendering copied 2,280 of 2,392 output frames and encoded 112 across one bridge in 3.74 seconds; full encoding took 6.46 seconds. Peak RSS was 1,419.2 MiB smart versus 1,453.5 MiB full.

Review

Added real-FFmpeg checks comparing decoded smart-render bridge frames with independent transition math and the full-encode path for crossfade and even/odd fades. The transition-value coverage finding is resolved.

Compatibility / Rollout

The video_concat invocation is version 1.3.0 and adds smart_render, enabled by default. Existing workflows remain compatible. Unsupported inputs and failed output validation fall back to full encoding; set smart_render to false to force that path.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@JPPhoto
JPPhoto requested a review from lstein October 14, 2026 18:20
@github-actions github-actions Bot added python PRs that change python files invocations PRs that change invocations python-tests PRs that change python tests docs PRs that change docs labels Oct 14, 2026
@JPPhoto JPPhoto moved this to 7.0 Theme: Modular Design in Invoke - Community Roadmap Oct 14, 2026
@github-actions github-actions Bot added the services PRs that change app services label Oct 15, 2026
@JPPhoto
JPPhoto force-pushed the smart-video-concatenation branch 4 times, most recently from f4e1951 to 5bdb16f Compare October 16, 2026 02:22
Preserve compatible H.264 segments and fall back to full encoding when needed.

Verify smart-render bridge values against independent transition math and full encoding.
Regenerate OpenAPI and TypeScript schemas for video_concat 1.3.0.

Update bundled workflows with the version and default-enabled input.
@JPPhoto
JPPhoto force-pushed the smart-video-concatenation branch from 5bdb16f to 4290ea4 Compare October 16, 2026 02:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs PRs that change docs invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

Status: 7.0 Theme: Modular Design

Development

Successfully merging this pull request may close these issues.

2 participants