Skip to content

perf: skip x264 scene-cut analysis on LTX-2.3 PyAV save path (env-configurable)#15

Merged
Johan-de-R merged 1 commit into
deep-main-v1.1.1-videogenfrom
johan/ltx23-pyav-scenecut
Jul 7, 2026
Merged

perf: skip x264 scene-cut analysis on LTX-2.3 PyAV save path (env-configurable)#15
Johan-de-R merged 1 commit into
deep-main-v1.1.1-videogenfrom
johan/ltx23-pyav-scenecut

Conversation

@Johan-de-R

Copy link
Copy Markdown

What

Adds FASTVIDEO_X264_SCENECUT (default 0) to the x264 options PyAV passes when encoding LTX-2.3 output — mirrors the existing FASTVIDEO_X264_THREADS/FASTVIDEO_X264_PRESET pattern in the same function.

Why

Investigating FastVideo's published 4.55s recipe (#12's follow-up work), their own streaming code sets scenecut=0 as a pure x264 encode-speed lever (skips scene-cut cost analysis). It's unrelated to their streaming/fragmented-mp4 machinery (which doesn't apply to our one-shot batch delivery — see internal writeup) — this one flag is a clean, isolated speed knob.

Evidence

Measured twice independently (real generations + isolated PyAV-direct test, n=5 each): ~50-100ms/clip, consistent direction both times. Small (~0.5-1% of the ~10.4s total clip) but free and zero quality/compat cost, since we deliver one complete file rather than streaming fragments.

Env-gated, not hardcoded — any model built on a patched base image can override/disable per-deployment via extra_env without a rebuild, same as the existing thread/preset knobs.

Validation

  • Patch applies clean (patch -p1 --dry-run) against the pinned fastvideo commit (4f3ad3f6).
  • Patched source verified syntactically valid.
  • Confirmed present and correct inside a real docker build -f Dockerfile.dreamverse output image.

No behavior change for any model that doesn't set FASTVIDEO_X264_SCENECUT — the value is always passed, defaulting to the measured-good 0.

🤖 Generated with Claude Code

…urable)

Adds FASTVIDEO_X264_SCENECUT (default 0, matching FASTVIDEO_X264_THREADS'
existing pattern) to the x264-params passed to PyAV's encoder options.
Pure encode-speed lever, no quality/compat cost for our fixed-GOP
single-file output -- the video is delivered as one complete file, not
streamed progressively, so scene-cut-triggered keyframes buy us nothing.

Measured (real generations, PyAV path, n=5, deepinfra 2026-07-07):
~50-100ms/clip -- small (~0.5-1% of the ~10.4s total) but consistent
across two independent tests (isolated ffmpeg-CLI A/B and PyAV-direct
A/B), free, and zero-risk. Verified: patch applies clean against the
pinned fastvideo commit, produces valid Python, confirmed present in a
real Dockerfile.dreamverse build.

Env-gated (not hardcoded) so any future model built on this patched
base can opt out per-deployment without a rebuild.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Johan-de-R Johan-de-R changed the title ltx23: skip x264 scene-cut analysis on PyAV save path (env-configurable, ~50-100ms) perf: skip x264 scene-cut analysis on LTX-2.3 PyAV save path (env-configurable) Jul 7, 2026
@github-actions github-actions Bot added the perf label Jul 7, 2026
@Johan-de-R Johan-de-R merged commit 0ca1e1e into deep-main-v1.1.1-videogen Jul 7, 2026
12 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant