Make layout blur, opacity, and watermark position apply in rendered videos.

Still-image encodes ignored boxblur and 1s black fills; switch to gblur plus full-length black frames, and honor brand watermark position.
This commit is contained in:
Atakan Doğan Özban
2026-08-17 12:47:19 +02:00
parent 0f363c5620
commit 2f25435921
4 changed files with 39 additions and 13 deletions
+7 -2
View File
@@ -1,20 +1,25 @@
/**
* Modular FFmpeg filter fragments for the Songs2VID brand watermark overlay.
* Always bottom-right with padding; scales to a fraction of frame width.
* Honors corner/center position + padding; scales to a fraction of frame width.
*/
import { overlayXy, type WatermarkPosition } from "../watermark";
export function buildBrandWatermarkOverlayFilters(options: {
baseLabel: string;
watermarkInputIndex: number;
watermarkWidthPx: number;
position?: WatermarkPosition;
offsetX?: number;
offsetY?: number;
outLabel?: string;
}): string[] {
const ox = options.offsetX ?? 20;
const oy = options.offsetY ?? 20;
const position = options.position ?? "bottom-right";
const { x, y } = overlayXy(position, ox, oy);
const out = options.outLabel ?? "vout";
return [
`[${options.watermarkInputIndex}:v]scale=${options.watermarkWidthPx}:-1[wm]`,
`[${options.baseLabel}][wm]overlay=W-w-${ox}:H-h-${oy}[${out}]`,
`[${options.baseLabel}][wm]overlay=${x}:${y}[${out}]`,
];
}
+1
View File
@@ -360,6 +360,7 @@ export async function encodeVideo(options: {
baseLabel,
watermarkInputIndex: defaultWmInputIndex,
watermarkWidthPx: watermarkWidth,
position: settings.position,
offsetX: settings.offsetX,
offsetY: settings.offsetY,
}),