Skip to content

Bugs in edit output: overlay picks the wrong audio, xfade drops audio, vertical_reel is 96 kHz, tiny blur redactions fail #188

Closed

Description

@TMHSDigital

Why it matters

Each of these silently produces wrong output from a normal edit: the wrong audio track, lost narration, a non-standard sample rate, or a failed redaction.

Evidence (reproduced with ffmpeg 8.1.1)

  1. overlay takes the overlay's audio and length. src/utils/media.ts:454-481 builds -filter_complex "[0:v][1:v]overlay=..." with no -map, so ffmpeg auto-selects the audio stream with the most channels across all inputs.
    • A 4 s mono main plus an 8 s stereo picture-in-picture clip gave 8 s of video with the PiP's stereo audio.
  2. xfade_transition drops all audio when only one clip has it.
  3. The vertical_reel export writes 96 kHz audio. One-pass loudnorm upsamples to 192 kHz, and only steam_trailer sets aresample (src/utils/produce.ts:478-492), so the reel MP4 got a 96000 Hz AAC track. That is bad for TikTok/Reels compatibility and wastes bitrate.
  4. redact_region blur fails on regions under 8 px. In src/utils/media.ts:649-651 the boxblur luma radius has a minimum of 2, but the yuv420p chroma plane of a 4x4 or 6x6 crop is too small, and libx264 fails with EINVAL. A thin region, such as a 6 px line holding a token, cannot be blurred.

Suggested approach

  1. Label the overlay output [v], add -map [v] -map 0:a?, and use eof_action=pass with -t <main duration> (or shortest=1 when the overlay is a video).
  2. Reuse the anullsrc substitution from buildAssembleArgs.
  3. Always append aresample=48000 after loudnorm in export presets.
  4. Set the chroma radius separately (boxblur=lr=R:cr=max(1,floor(min(w,h)/4))), or fall back to pixelate/box for tiny regions.

Done when

Each case has an integration test that asserts the probed streams: audio source and duration, sample rate, and a successful blur on a 4x4 region.

Activity

  1. added
    bug
    effort: small
    impact: medium
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugeffort: smallimpact: mediumpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions