perf: skip x264 scene-cut analysis on LTX-2.3 PyAV save path (env-configurable)#15
Merged
Merged
Conversation
…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>
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.
What
Adds
FASTVIDEO_X264_SCENECUT(default0) to the x264 options PyAV passes when encoding LTX-2.3 output — mirrors the existingFASTVIDEO_X264_THREADS/FASTVIDEO_X264_PRESETpattern in the same function.Why
Investigating FastVideo's published 4.55s recipe (#12's follow-up work), their own streaming code sets
scenecut=0as 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_envwithout a rebuild, same as the existing thread/preset knobs.Validation
patch -p1 --dry-run) against the pinned fastvideo commit (4f3ad3f6).docker build -f Dockerfile.dreamverseoutput image.No behavior change for any model that doesn't set
FASTVIDEO_X264_SCENECUT— the value is always passed, defaulting to the measured-good0.🤖 Generated with Claude Code