Skip to content

fix(render): preserve and validate muxed video frames#2425

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/mux-frame-parity
Open

fix(render): preserve and validate muxed video frames#2425
miguel-heygen wants to merge 1 commit into
mainfrom
fix/mux-frame-parity

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve encoded packet timestamps by removing output -r from every stream-copy mux/remux path
  • validate video packet-count and true video-stream-duration parity after both local and distributed assembly
  • bound full-stream ffprobe scans and cancel them with the render abort signal

Root cause

A 17.5-minute render captured all 31,527 frames, but the final MP4 retained only 162 video packets while full-length audio remained. The stream-copy mux paths still passed output -r; FFmpeg may drop or retimestamp packets to satisfy that requested rate even with -c:v copy. A zero exit status therefore did not guarantee a valid video stream.

Regression coverage

  • reproduces the reported 31,527 → 162 packet mismatch in parity validation
  • rejects true video-stream-duration drift without substituting longer container audio duration
  • verifies abort kills a full-stream packet probe
  • verifies local assembly rejects post-mux parity loss
  • verifies a 30000/1001 single chunk assembled under a 30/1 plan preserves all packets and source timing
  • pins the absence of output -r in audio mux and faststart stream-copy paths

Verification

  • engine ffprobe/chunk encoder: 103/103 passed
  • local assemble stage: 1/1 passed
  • distributed single-chunk regression: 1/1 passed
  • engine and producer typechecks passed
  • producer test classification passed (57 files)
  • lint, format, tracked-artifact, fallow, and typecheck pre-commit gates passed
  • independent adversarial review: no remaining findings

The host FFmpeg is 4.2 and cannot run the pre-existing distributed CFR test because it lacks -fps_mode; the new focused distributed regression passes.

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.

1 participant