Commit Graph

11 Commits

Author SHA1 Message Date
9dd6ddd1e5 fix(author): remove quotes from fontfile and font paths in FFmpeg filter
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).
2026-01-10 02:02:59 -05:00
53a11819ec fix(author): remove quotes from scale expression in menu logo filter
Fixed FFmpeg filter parsing error by removing unnecessary single quotes
from the scale expression in resolveMenuLogoScaleExpr.

The Bug:
FFmpeg command was failing with "Error parsing filterchain" because
the scale expression had quotes around the min() functions:
  scale=w='min(iw*0.50,180)':h='min(ih*0.50,120)'
                ^^^^^^^^^^^^        ^^^^^^^^^^^^
FFmpeg's filter parser doesn't expect quotes here and treats them as
part of the option value, breaking the parsing.

The Fix:
  Before: scale=w='min(iw*%.2f,%.0f)':h='min(ih*%.2f,%.0f)'
  After:  scale=w=min(iw*%.2f,%.0f):h=min(ih*%.2f,%.0f)

Error was:
  [AVFilterGraph] No option name near ' I Fucked My Best…'
  [AVFilterGraph] Error parsing filterchain around: ,180)':h='min...
  exit status 234

Now the scale expression is parsed correctly and menu generation
should complete successfully.
2026-01-10 01:54:47 -05:00
654378422a fix(author): pass logFn through all menu generation functions
Fixed menu generation logging by threading logFn parameter through all
menu building functions. Previously, all menu FFmpeg commands were
called with logFn=nil, so errors were never logged.

Functions updated to accept and pass logFn:
- buildMenuBackground
- buildDarkMenuBackground
- buildPosterMenuBackground
- buildMenuOverlays
- buildMenuOverlay (helper)
- buildMenuMPEG

All three menu templates now properly log:
- SimpleMenu.Generate() → buildMenuBackground → runCommandWithLogger
- DarkMenu.Generate() → buildDarkMenuBackground → runCommandWithLogger
- PosterMenu.Generate() → buildPosterMenuBackground → runCommandWithLogger

Before:
- Menu FFmpeg commands run silently (logFn=nil)
- Errors not logged → "ERROR: FFmpeg failed during DVD encoding"
- No way to diagnose what failed

After:
- >> /usr/bin/ffmpeg [full command with args]
- ERROR starting command: [error details]
- ERROR command failed: [error] (exit code: X)

Combined with the previous commit's enhanced runCommandWithLogger,
we now have complete visibility into menu generation failures.
2026-01-10 01:46:01 -05:00
822a6d0c45 fix(author): improve DVD menu font fallback to prevent FFmpeg failures
The menu generation was failing because it tried to use "IBM Plex Mono"
font which isn't universally available. FFmpeg's drawtext filter would
fail silently when the font didn't exist.

Changes:
- Check if FontPath actually exists before using it (os.Stat check)
- Only use FontName if it's a known universally available font
- Whitelist of safe fonts: DejaVu, Liberation, Free fonts
- Ultimate fallback: "monospace" (most universally available)

Before:
- Tried IBM Plex Mono (not installed) → FFmpeg fails → "ERROR: FFmpeg failed during DVD encoding"

After:
- Tries IBM Plex Mono font file → doesn't exist
- Checks if "IBM Plex Mono" is in safe list → not in list
- Falls back to "monospace" → works everywhere

This fixes the cryptic "FFmpeg failed during DVD encoding" error that
actually occurred during menu generation, not encoding.
2026-01-10 01:22:05 -05:00
f3cc9bc503 Clamp menu logo scale and add preview 2026-01-06 23:42:14 -05:00
4e5c1cb33f Fix menu theme type and add openURL helper 2026-01-06 21:09:50 -05:00
c5efd222a9 Add DVD menu tab with theme and logo controls 2026-01-06 21:04:58 -05:00
Stu Leak
29573229e4 fix: remove duplicate code and syntax errors
- Remove orphaned closing brace in author_menu.go
- Remove duplicate code sections in main.go
- Fix non-declaration statements outside function body
- Ensure clean compilation with no syntax errors
- Complete UnifiedPlayerAdapter integration cleanup
2026-01-06 18:36:07 -05:00
Stu Leak
d9df6a22a8 fix: resolve syntax errors in author_menu.go and main.go
- Fix unterminated string in author_menu.go line 418
- Fix invalid escape sequences in escapeDrawtextText function
- Remove orphaned code outside function body in main.go
- Fix extra parentheses causing syntax errors
- Ensure clean compilation for successful build
2026-01-06 18:14:07 -05:00
Stu Leak
7dc5be6ecc feat: Implement DVD menu templating system
- Refactor author_menu.go to support multiple menu templates
- Add Simple, Dark, and Poster menu templates
- Add UI for selecting menu template and background image
2026-01-06 17:42:51 -05:00
Stu Leak
13f138e945 Add VT-styled DVD menu generation 2026-01-04 18:44:21 -05:00