From 9afe4251df2702706c93afe0500cc7691ff62f1c Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sat, 10 Jan 2026 02:02:59 -0500 Subject: [PATCH] fix(author): remove quotes from fontfile and font paths in FFmpeg filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed FFmpeg filter parsing error by removing single quotes from font paths and properly escaping special characters instead. The Bug: FFmpeg's drawtext filter was failing because fontfile paths were wrapped in single quotes, which conflicted with the filter expression parsing: drawtext=fontfile='/path/to/font.ttf':text='Some Text' ^ ^ ^ ^ These quotes broke FFmpeg's parser! Error was: [AVFilterGraph] No option name near ' I Fucked My Best…' Error parsing filterchain ... around: The Fix: Before: fontfile='/home/.../IBMPlexMono-Regular.ttf' After: fontfile=/home/.../IBMPlexMono-Regular.ttf (with : and ' escaped) Now we: 1. Escape : as \: (FFmpeg filter requirement) 2. Escape ' as \' (FFmpeg filter requirement) 3. Don't wrap in quotes (FFmpeg doesn't need them) Same fix applied to font= paths (system fonts). đŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- author_menu.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/author_menu.go b/author_menu.go index c9ba1cb..d3b3d37 100644 --- a/author_menu.go +++ b/author_menu.go @@ -547,7 +547,10 @@ func menuFontArg(theme *MenuTheme) string { // Try FontPath first (specific font file) if theme != nil && theme.FontPath != "" { if _, err := os.Stat(theme.FontPath); err == nil { - return fmt.Sprintf("fontfile='%s'", theme.FontPath) + // Escape the font path for FFmpeg filter - replace : and ' with escaped versions + escapedPath := strings.ReplaceAll(theme.FontPath, ":", "\\:") + escapedPath = strings.ReplaceAll(escapedPath, "'", "\\'") + return fmt.Sprintf("fontfile=%s", escapedPath) } } // FontPath doesn't exist or is empty - use system-wide fonts @@ -562,11 +565,11 @@ func menuFontArg(theme *MenuTheme) string { "FreeSans": true, } if safeFonts[theme.FontName] { - return fmt.Sprintf("font='%s'", theme.FontName) + return fmt.Sprintf("font=%s", theme.FontName) } } // Fallback to most universally available monospace font on Linux - return "font='monospace'" + return "font=monospace" } func resolveMenuLogoPath(logo menuLogoOptions) string {