Commit Graph

463 Commits

Author SHA1 Message Date
f113e95821 Fix drag and drop for subtitle module - wrap entire view in droppable 2025-12-26 19:55:04 -05:00
ca903fbbeb Add drag and drop enhancements and timing offset controls to subtitle module 2025-12-26 19:44:38 -05:00
baf13bbef3 Rewrite Author module docs for accessibility 2025-12-26 19:33:51 -05:00
6b715bb6b2 Add comprehensive Author module documentation
Created AUTHOR_MODULE.md covering all features in detail:

Chapter Detection:
- How scene detection works (FFmpeg filter threshold)
- Sensitivity slider guide (0.1-0.9 range explained)
- Visual preview feature with thumbnails
- Use cases for different video types
- Technical implementation details

DVD Timestamp Correction:
- SCR backwards error explanation
- Automatic remux solution (-fflags +genpts)
- Why it's needed and how it works
- Performance impact (negligible)

Authoring Log Viewer:
- Tail behavior (last 100 lines)
- Performance optimizations explained
- Copy Log and View Full Log buttons
- Memory usage improvements (O(1) vs O(n))

Complete Workflows:
- Single movie to DVD
- TV series multi-title disc
- Concert with manual chapters

Troubleshooting:
- SCR errors
- Too many/few chapters detected
- UI lag issues (now fixed)
- ISO burning problems
- Playback stuttering

Technical Details:
- Full encoding pipeline with commands
- Chapter XML format
- Temporary file locations
- Dependencies and installation
- File size estimates for NTSC/PAL

Also updated DVD_USER_GUIDE.md:
- Removed branding footer
- Added reference to AUTHOR_MODULE.md for technical details
2025-12-26 19:33:51 -05:00
dd79bedc9a Add chapter detection visualizer with thumbnails
Allows visual verification of detected scene changes before accepting.

Features:
- Extracts thumbnail at each detected chapter timestamp
- Displays first 24 chapters in scrollable grid (4 columns)
- Shows timestamp below each thumbnail (160x90px previews)
- Accept/Reject buttons to confirm or discard detection
- Progress indicator during thumbnail generation

Implementation:
- showChapterPreview() function creates preview dialog
- extractChapterThumbnail() uses FFmpeg to extract frame
  - Scales to 320x180, saves as JPEG in temp dir
- Thumbnails generated in background, dialog updated when ready

Performance:
- Limits to 24 chapters for UI responsiveness
- Shows "(showing first 24)" if more detected
- Temp files stored in videotools-chapter-thumbs/

User workflow:
1. Adjust sensitivity slider
2. Click "Detect Scenes"
3. Review thumbnails to verify detection quality
4. Accept to use chapters, or Reject to try different sensitivity
2025-12-26 19:33:51 -05:00
b723e8f642 Optimize author log viewer performance with tail behavior
Problem: Author log was causing severe UI lag and memory issues
- Unbounded string growth (entire log kept in RAM)
- Full widget rebuild on every line append
- O(n²) string concatenation performance

Solutions implemented:
1. Tail behavior - Keep only last 100 lines in UI
   - Uses circular buffer (authorLogLines slice)
   - Prevents unbounded memory growth
   - Rebuilds text from buffer on each append

2. Copy Log button
   - Copies full log from file (accurate)
   - Falls back to in-memory log if file unavailable

3. View Full Log button
   - Opens full log in dedicated log viewer
   - No UI lag from large logs

4. Track log file path
   - authorLogFilePath stored when log created
   - Used by copy and view buttons

Performance improvements:
- Memory: O(1) instead of O(n) - fixed 100 line buffer
- CPU: One SetText() per line instead of concatenation
- UI responsiveness: Dramatically improved with tail behavior

UI changes:
- Label shows "Authoring Log (last 100 lines)"
- Copy/View buttons for accessing full log
2025-12-26 19:33:51 -05:00
282db38c4f Fix DVD authoring SCR errors and queue animation persistence
DVD Authoring Fix:
- Add remultiplex step after MPEG encoding for DVD compliance
- Use ffmpeg -fflags +genpts -c copy -f dvd to fix timestamps
- Resolves "ERR: SCR moves backwards" error from dvdauthor
- FFmpeg direct encoding doesn't always create DVD-compliant streams
- Remux regenerates presentation timestamps correctly

Queue Animation Fix:
- Stop stripe animation on completed jobs
- Bug: Refresh() was always incrementing offset regardless of state
- Now only increments offset when animStop != nil (animation running)
- Completed/failed/cancelled jobs no longer show animated stripes

Testing:
- DVD authoring should now succeed on AVI files
- Completed queue jobs should show static progress bar
2025-12-25 21:20:14 -05:00
901a6e45ed Stabilize queue back navigation 2025-12-24 16:22:24 -05:00
89292a0a0f Add persistent configs for author/subtitles/merge/rip 2025-12-24 15:39:22 -05:00
26b71cc5c9 Make log viewer responsive on large files 2025-12-24 08:32:19 -05:00
d9b73bc099 Stop split layout from expanding window 2025-12-24 03:14:31 -05:00
48108b9f75 Disable auto-name on manual output edit 2025-12-24 03:07:54 -05:00
5f161978de Use per-file output base for batch convert 2025-12-24 03:05:35 -05:00
4d5f864a69 Avoid batch remux output collisions 2025-12-24 03:02:24 -05:00
e3cc6ee41f Stop queue animation on completion 2025-12-24 02:57:54 -05:00
1f752263c5 Return to last module after clear all 2025-12-24 02:53:24 -05:00
d50a582b80 Prevent clear completed from wiping active project 2025-12-24 02:51:02 -05:00
3077e50a68 Add chapter removal option in Convert 2025-12-24 02:47:55 -05:00
e81872f16e Fix remux build variables 2025-12-24 02:40:37 -05:00
60722c79b7 Harden remux timestamp handling 2025-12-24 02:38:41 -05:00
d630cea8d6 Skip filters during remux 2025-12-24 02:33:28 -05:00
47975ac0f5 Lock remux aspect controls to Source 2025-12-24 02:31:34 -05:00
be4ef2303b Hide encode controls for remux 2025-12-24 02:29:15 -05:00
2490cb4970 Add remux option to Convert 2025-12-24 02:22:07 -05:00
8c12ae059d Show benchmark apply status in Convert header 2025-12-24 01:55:37 -05:00
0d7fd09ac1 Add player robustness improvements and A/V sync logging
Improvements:
1. Track audio active state with atomic.Bool flag
2. Handle videos without audio track gracefully
   - If audio fails to start, video plays at natural frame rate
   - Clear error messages indicate "video-only playback"
3. Better A/V sync logging for debugging
   - Log when video ahead/behind and actions taken
   - Log good sync status periodically (every ~6 seconds at 30fps)
   - More granular logging for different sync states
4. Proper cleanup when audio stream ends or fails

How it works:
- audioActive flag set to true when audio starts successfully
- Set to false when audio fails to start or ends
- Video checks audioActive before syncing to audio clock
- If no audio: video just paces at natural frame rate (no sync)
- If audio active: full A/V sync with adaptive timing

Expected improvements:
- Video-only files (GIFs, silent videos) play smoothly
- Better debugging info for sync quality
- Graceful degradation when audio missing
2025-12-24 01:44:08 -05:00
eb5db177d6 Fix merge badge color 2025-12-24 01:42:57 -05:00
615581b4a3 Reset merge output on clear 2025-12-24 01:38:57 -05:00
e0982109ba Implement audio master clock for A/V synchronization
Priority 3 fix from PLAYER_PERFORMANCE_ISSUES.md - addresses the root
cause of A/V desync in player module.

Changes:
- Audio loop now tracks bytes written and updates master clock (audioTime)
- Audio clock calculation: bytesWritten / (sampleRate × channels × bytesPerSample)
- Video loop already syncs to audio master clock (from previous commit)
- Master clock updates happen after each audio chunk write

How it works:
- Audio is the timing master, plays at natural rate
- Video reads audio clock and adapts timing to stay in sync
- If video >3 frames behind: drop frame and resync
- If video >3 frames ahead: wait longer
- Otherwise: adjust sleep duration for gradual sync

Expected improvements:
- Rock-solid A/V sync maintained over extended playback
- No more drift between audio and video
- Adaptive recovery from temporary slowdowns

Combined with Priority 1 (larger audio buffers) and Priority 2 (FFmpeg
volume control), this completes the core A/V sync architecture.
2025-12-24 01:36:50 -05:00
c94fdb403f Drop unsupported reset_timestamps flag 2025-12-24 01:31:33 -05:00
f648fb4303 Fix mkv copy merge timestamps 2025-12-24 01:10:30 -05:00
1ca5810bad Simplify merge format list 2025-12-24 01:05:16 -05:00
499be5ef98 Add AV1 merge option 2025-12-24 01:02:46 -05:00
98f8273cb7 Add WebM merge option 2025-12-24 00:53:07 -05:00
e7f1c15723 Make main menu vertically resizable 2025-12-24 00:30:18 -05:00
3cc2124a10 Group DVD modules and add responsive menu 2025-12-24 00:08:56 -05:00
ca95f7ffca Fix build blockers and continue refactoring
- Fixed Fyne API issue: app.Driver() → fyne.CurrentApp().Driver()
- Fixed unused import: removed strconv from upscale_module.go
- Build now passes successfully 
- Ready to continue module extraction

Current progress:
 filters_module.go (257 lines)
 thumb_module.go (406 lines)
 upscale_module.go partial (173 lines + showUpscaleView + AI helpers)
📊 main.go reduced by ~800+ lines
2025-12-23 23:50:51 -05:00
b76e0c5114 Fix queue UI refresh 2025-12-23 22:42:45 -05:00
ed9939905b Commit incremental progress
- Current state: 3 modules partially/fully extracted
- upscale_module.go: showUpscaleView + AI helpers migrated successfully
- Build syntax:  Clean
- Build failing due to unrelated Fyne API issue in internal/ui/queueview.go
- Ready for next incremental extraction steps
2025-12-23 22:39:33 -05:00
8834a05b8f Extract showUpscaleView and AI helper functions to upscale_module.go
- Move showUpscaleView() from main.go to upscale_module.go
- Remove AI helper functions (detectAIUpscaleBackend, checkAIFaceEnhanceAvailable, etc.)
- Syntax passes, ready for further migration
- Build error is unrelated Fyne API issue in internal/ui
2025-12-23 22:35:06 -05:00
5577468ea2 Restore main.go + upscale_module.go preparation
- main.go restored from corruption (13,664 lines)
- upscale_module.go created with AI helper functions
- Ready for safer incremental extraction approach
2025-12-23 22:29:42 -05:00
4ae45647c2 Update rip documentation 2025-12-23 22:13:54 -05:00
2f9a5960a0 Finish thumb module extraction fixes 2025-12-23 22:05:54 -05:00
24ce1c7837 Add thumb module files
- thumb_module.go: Complete thumb module implementation
- main.go.backup-before-inspect-extraction: Backup before refactoring
- Successfully extracted showThumbView() from main.go
2025-12-23 21:57:41 -05:00
f0db050d30 Format cleanup and minor fixes
- Apply go formatting across internal packages
- Clean up imports and code style
2025-12-23 21:56:47 -05:00
2e1faacea7 Extract thumb module from main.go (partial)
- Create thumb_module.go with showThumbView(), buildThumbView(), executeThumbJob()
- Remove showThumbView() from main.go
- buildThumbView() and executeThumbJob() still in main.go to be removed
- Syntax check passes
- Working on large function extraction
2025-12-23 21:47:14 -05:00
f108a40ac3 Auto-refresh queue view 2025-12-23 21:36:19 -05:00
bc4f7e5cce Extract filters module from main.go
- Create filters_module.go (257 lines)
- Move showFiltersView() and buildFiltersView()
- Reduce main.go by ~257 lines (from 14245 to 13988)
- All syntax checks pass, module ready for testing
2025-12-23 21:35:06 -05:00
bfc1898204 Label author/rip jobs in queue 2025-12-23 21:30:56 -05:00
4fc143ad2b Add comprehensive refactoring guide for opencode
Created step-by-step guide for modularizing main.go:
- 9 modules to extract in priority order (least → most important)
- Filters first (easiest), Convert last (most critical)
- Clear instructions for each extraction
- Reference patterns from existing modules
- Success criteria and testing steps
- Emergency rollback procedures

Module extraction order:
1. filters_module.go (~236 lines) - Simple UI
2. upscale_module.go (~1200 lines) - AI integration
3. thumb_module.go (~400 lines) - Thumbnail generation
4. player_module.go (~800 lines) - Playback system
5. compare_module.go (~550 lines) - File comparison
6. merge_module.go (~700 lines) - File merging
7. benchmark_module.go (~400 lines) - Encoder benchmarks
8. queue_module.go (~500 lines) - Job queue
9. convert_module.go (~6400 lines) - Most critical, do last

Goal: Reduce main.go from 14,116 → ~4,000 lines
Expected: Windows build time 5+ min → <2 min

Each module extraction is independent and testable.
Pattern established with inspect_module.go (already done).
2025-12-23 21:30:17 -05:00