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:
@@ -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}]`,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user