Enlarge watermark badge for preview/encode parity and document video title fields.

Fix double-scaled badge preview, bump default watermark to 42% frame width, and update OSS docs/API for title vs songTitle separation and shared typography.
This commit is contained in:
Atakan Doğan Özban
2026-07-27 18:28:07 +02:00
parent 9404efd86c
commit 0c9b07bcb5
8 changed files with 76 additions and 45 deletions
+6 -2
View File
@@ -13,6 +13,10 @@ import {
buildArtTrackFilterComplex,
type LayoutSettings,
} from "../layout";
import {
WATERMARK_WIDTH_FRACTION,
watermarkFontSizeForWidth,
} from "../preview-typography";
import { getWatermarkPath } from "../storage";
import {
buildDrawtextFilter,
@@ -113,8 +117,8 @@ export async function encodeVideo(options: {
const settings = normalizeWatermarkSettings(options.watermark, options.includeWatermark);
const layout = options.layout?.template ? options.layout : null;
const watermarkWidth = Math.max(1, Math.round(res.width * 0.32));
const fontSize = Math.max(16, Math.round(res.width * 0.018));
const watermarkWidth = Math.max(1, Math.round(res.width * WATERMARK_WIDTH_FRACTION));
const fontSize = watermarkFontSizeForWidth(res.width);
const fontfile = await resolveFontfileEscaped(settings);
const args = ["-y", "-loop", "1", "-r", "1", "-i", options.imagePath, "-i", options.audioPath];
+2 -2
View File
@@ -18,7 +18,7 @@ export function artistFontSizeForWidth(width: number): number {
}
export function watermarkFontSizeForWidth(width: number): number {
return Math.max(16, Math.round(width * 0.018));
return Math.max(22, Math.round(width * 0.028));
}
/** Scale encode-resolution px to preview container px. */
@@ -43,4 +43,4 @@ export function curatedFontApiUrl(key: string): string {
}
/** Watermark overlay width as fraction of frame (matches encode.ts). */
export const WATERMARK_WIDTH_FRACTION = 0.32;
export const WATERMARK_WIDTH_FRACTION = 0.42;