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. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
c8015937f9
commit
56880256e5
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user