From d3d2a1b14eeae80001d14c00ee36138c8e9ada78 Mon Sep 17 00:00:00 2001 From: JSLMPR Date: Wed, 22 Jul 2026 18:19:27 +0200 Subject: [PATCH] Soften voiceover entry/exit with short fades Add afade in (0.12s) / out (0.25s) to each narration line so it eases in and out instead of hard-cutting -- the hard cut read as un-cinematic. Voice remains present and leading (measured onset ramp -18 -> -17 dB). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Bg76sLc43Wc3j5ZcLkboYR --- .../videoclips/editing/HighlightFfmpegRenderer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/example/videoclips/editing/HighlightFfmpegRenderer.java b/src/main/java/org/example/videoclips/editing/HighlightFfmpegRenderer.java index 9c842bf..5f3cbad 100644 --- a/src/main/java/org/example/videoclips/editing/HighlightFfmpegRenderer.java +++ b/src/main/java/org/example/videoclips/editing/HighlightFfmpegRenderer.java @@ -283,8 +283,15 @@ public class HighlightFfmpegRenderer { command.addAll(List.of("-i", voiceover.path().toString())); // Narration must clearly lead. Boost ~+8 dB; combined with the lower music bed and side-chain // ducking, this keeps the voice well above the score during each line. + // Short fades soften the entry/exit so the narration doesn't hard-cut in and out. + double voiceFadeIn = Math.min(0.12, duration / 4); + double voiceFadeOut = Math.min(0.25, duration / 3); filters.append("[").append(input).append(":a]atrim=duration=").append(duration) - .append(",asetpts=PTS-STARTPTS,volume=1.0,adelay=") + .append(",asetpts=PTS-STARTPTS,volume=1.0") + .append(",afade=t=in:st=0:d=").append(voiceFadeIn) + .append(",afade=t=out:st=").append(Math.max(0.0, duration - voiceFadeOut)) + .append(":d=").append(voiceFadeOut) + .append(",adelay=") .append(delayMillis).append("|").append(delayMillis).append("[").append(label).append("];"); voiceLabels.add("[" + label + "]"); input++;