Commit Graph

415 Commits

Author SHA1 Message Date
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
627cb541a1 Handle nil values in toString 2025-12-23 21:25:41 -05:00
a3d9f868c1 Add rip job type 2025-12-23 21:22:37 -05:00
992114ce1c Add Rip module for DVD/ISO/VIDEO_TS 2025-12-23 21:19:44 -05:00
eb74a9f2b6 Implement major player performance improvements (Priority 2 & 5)
Priority 2: FFmpeg Volume Control
- Moved volume processing from Go to FFmpeg -af volume filter
- Eliminated CPU-intensive per-sample processing loop
- Removed ~40 lines of hot-path audio processing code
- Reduced CPU usage during playback significantly
- Dynamic volume changes restart audio seamlessly

Changes:
- Build FFmpeg command with volume filter
- Remove per-sample int16 processing loop
- Remove encoding/binary import (no longer needed)
- Add restartAudio() for dynamic volume changes
- Volume changes >5% trigger audio restart with new filter

Priority 5: Adaptive Frame Timing
- Implemented drift correction for smooth video playback
- Frame dropping when >3 frames behind schedule
- Gradual catchup when moderately behind
- Maintains smooth playback under system load

Frame Timing Logic:
- Behind < 0: Sleep until next frame (ahead of schedule)
- Behind > 3 frames: Drop frame and resync (way behind)
- Behind > 0.5 frames: Catch up gradually (moderately behind)
- Otherwise: Maintain normal pace

Performance Improvements:
- Audio: No more per-chunk volume processing overhead
- Video: Adaptive timing handles temporary slowdowns
- CPU: Significant reduction in audio processing load
- Smoothness: Better handling of system hiccups

Testing Notes:
- Audio stuttering should be greatly reduced
- Volume changes have ~200ms glitch during restart
- Frame drops logged every 30 frames to avoid spam
- Works with all frame rates (24/30/60 fps)

Still TODO (Priority 3):
- Single FFmpeg process for perfect A/V sync
- Currently separate video/audio processes can drift
2025-12-23 21:16:38 -05:00
df1ff0c605 Support VIDEO_TS drop to ISO 2025-12-23 21:10:46 -05:00
d5fcd1730a Document and fix player module stuttering issues
Performance Analysis:
- Created PLAYER_PERFORMANCE_ISSUES.md with root cause analysis
- Identified 6 major issues causing stuttering
- Provided priority-ordered fix recommendations

Quick Fixes Implemented (Priority 1):
- Increase audio buffer: 2048 → 8192 samples (42ms → 170ms)
- Increase audio chunk size: 4096 → 16384 bytes (21ms → 85ms)
- Reduces audio underruns and stuttering significantly

Root Causes Documented:
1. Separate video/audio FFmpeg processes (no A/V sync)
2. Tiny audio buffers causing underruns
3. CPU waste on per-sample volume processing
4. Frame timing drift with no correction mechanism
5. UI thread blocking every frame update
6. Memory allocation on every frame (GC pressure)

Remaining Work (Requires More Time):
- Priority 2: Move volume control to FFmpeg (remove hot path processing)
- Priority 3: Single FFmpeg process for perfect A/V sync
- Priority 4: Frame buffer pooling to reduce GC pressure
- Priority 5: Adaptive frame timing with drift correction

Testing Checklist Provided:
- Frame rate support (24/30/60 fps)
- A/V sync validation
- Codec compatibility
- CPU usage benchmarking
2025-12-23 21:09:21 -05:00
57c43882cb Default author output path without dialogs 2025-12-23 21:06:49 -05:00
05087a0fe8 Update Windows build guide for Git Bash users
Git Bash Optimizations:
- Create add-defender-exclusions.ps1 automated script
- Update guide with Git Bash-first instructions
- Add command for running PowerShell from Git Bash
- Document how to run Git Bash as Administrator

New Helper Script:
- scripts/add-defender-exclusions.ps1
- Automatically adds all necessary Defender exclusions
- Shows clear success/failure messages
- Can be run from Git Bash using powershell.exe

Documentation Updates:
- Prioritize Git Bash commands (Jake's workflow)
- Add "Quick Start for Git Bash Users" section
- Provide step-by-step Git Bash instructions
- Keep PowerShell/CMD options as alternatives

For Jake:
```bash
# From Git Bash as Administrator:
powershell.exe -ExecutionPolicy Bypass -File ./scripts/add-defender-exclusions.ps1
```
2025-12-23 20:55:47 -05:00
fe75a7310e Add Windows build performance optimizations
Build Script Improvements:
- Add -p flag for parallel compilation (use all CPU cores)
- Add -trimpath for faster builds and smaller binaries
- Detect CPU core count automatically
- Show parallel process count during build

Performance Guide:
- Create WINDOWS_BUILD_PERFORMANCE.md with troubleshooting steps
- Document Windows Defender exclusion fix (saves 2-5 minutes)
- Provide PowerShell commands for adding exclusions
- Include benchmarking and troubleshooting commands

Expected Improvements:
- With Defender exclusions: 5+ min → 30-90 sec
- Parallel compilation: 30-50% faster on multi-core CPUs
- Trimpath flag: 10-20% faster linking

Scripts Updated:
- build.ps1: Added core detection and optimization flags
- build.bat: Added parallel build support

Addresses Jake's 5+ minute Windows build issue.
2025-12-23 20:53:43 -05:00
5f2d2c888b Extract inspect module from main.go
Refactoring:
- Create inspect_module.go (292 lines)
- Move showInspectView() and buildInspectView()
- Reduce main.go from 14,329 to 14,116 lines (-213 lines)
- Reduce main.go from 426KB to 420KB

This is the first step in modularizing main.go to improve:
- Windows build performance (currently 5+ minutes)
- Code maintainability and organization
- Following established pattern from author_module.go and subtitles_module.go

Remaining modules to extract:
- player, compare, thumb, filters, upscale, merge, convert, queue, benchmark
2025-12-23 20:51:42 -05:00
0c4af03fb5 Fix author warnings dialog thread 2025-12-23 20:49:34 -05:00
c28a0ea91e Simplify authoring error messaging 2025-12-23 20:48:45 -05:00
269a0209d3 Add authoring log/progress and queue job 2025-12-23 20:47:10 -05:00
07609406eb Link author subtitles to subtitles tool 2025-12-23 20:38:05 -05:00
179abbe8c5 Move chapter buttons to bottom 2025-12-23 20:36:58 -05:00
df83bc334a Add batch queue feature to Convert module
Convert Module:
- Add "Add All to Queue" button when multiple videos loaded
- Batch-add all loaded videos to queue with one click
- Remove confirmation dialogs for faster workflow
- Queue button updates immediately to show new count
- Button only visible when 2+ videos are loaded

Workflow improvements:
- No more clicking through videos one by one to queue
- No "OK" confirmation clicks required
- Queue count updates instantly in View Queue button
- Auto-starts queue after adding jobs
2025-12-23 20:27:59 -05:00
1294c7f156 Add DVD5/DVD9 disc size guidance 2025-12-23 20:20:15 -05:00
3a02cfcae1 Allow local DVDStyler ZIP install 2025-12-23 20:00:54 -05:00
8f34ee1f92 Add more DVDStyler mirrors 2025-12-23 20:00:54 -05:00
df23fee585 Add manual DVDStyler download hint 2025-12-23 20:00:54 -05:00
2840da0983 Prompt for optional DVD authoring deps 2025-12-23 20:00:54 -05:00
stu
8ca401f5e4 Update README.md 2025-12-24 00:31:55 +00:00
5f48e041d0 Harden DVDStyler download fallback 2025-12-23 18:41:44 -05:00
d9686b20ed Make install.sh dependencies-only 2025-12-23 18:41:12 -05:00
d54c61a8ab Polish menu header and Windows DVDStyler download 2025-12-23 18:30:35 -05:00
4cf60e2d8c Add subtitles module with offline STT 2025-12-23 18:30:27 -05:00
d51b62d1d1 Show clip-based chapters in author chapters tab 2025-12-23 17:58:45 -05:00
cf657b5b6f Add chapter naming per clip in author videos tab 2025-12-23 17:56:39 -05:00
a4c95f222a Add author chapter sources and scene detection 2025-12-23 17:54:01 -05:00
b3375dd067 Add right column for author clip duration 2025-12-23 17:40:19 -05:00
a78e986d1e Improve author subtitles layout and summary refresh 2025-12-23 17:39:47 -05:00
e0a44e56f4 Align author clip list styling with merge 2025-12-23 17:36:01 -05:00
c52f29bb54 Refresh author clip list after Add Files 2025-12-23 17:33:45 -05:00
6f0343823d Handle drag-and-drop in author module 2025-12-23 17:33:17 -05:00
f3362e37a9 Wire author module navigation 2025-12-23 17:24:50 -05:00
c70b7584fd Add drag and drop for Player module and enable Author module
Player Module Drag and Drop:
- Add handleDrop case for player module
- Drag video files onto player to load them
- Works the same way as convert module
- Auto-probe and load first video file from drop

Author Module:
- Enable Author module button in main menu
- Add "author" to enabled modules list (line 1525)
- Module is now clickable and functional
2025-12-23 17:20:07 -05:00
30479fed4a Add DVDStyler URL override for Windows installer 2025-12-23 17:16:24 -05:00
95f0300839 Improve DVDStyler download mirrors for Windows 2025-12-23 15:59:17 -05:00
848ae91b2a Fix VT_Player seeking and frame stepping
Seeking Fixes:
- Remove debouncing delay for immediate response
- Progress bar now seeks instantly when clicked or dragged
- No more 150ms lag during playback navigation

Frame Stepping Fixes:
- Calculate current frame from time position (current * fps)
- Previously used frameN which resets to 0 on every seek
- Frame stepping now accurately moves ±1 frame from actual position
- Buttons now work correctly regardless of seek history

Technical Details:
- currentFrame = int(p.current * p.fps) instead of p.frameN
- Removed seekTimer and seekMutex debouncing logic
- Immediate Seek() call in slider.OnChanged for responsive UX
2025-12-23 15:53:09 -05:00
075ce0f096 VT_Player foundation: Frame-accurate navigation and responsive scrubbing
Frame Navigation:
- Add frame-by-frame stepping with Previous/Next frame buttons
- Implement StepFrame() method for precise frame control
- Auto-pause when frame stepping for accuracy
- Display real-time frame counter during playback

Responsive Scrubbing:
- Add 150ms debounce to progress bar seeking
- Prevents rapid FFmpeg restarts during drag operations
- Smoother user experience when scrubbing through video

Player Session Improvements:
- Track frame numbers accurately with frameFunc callback
- Add duration field for proper frame calculations
- Update frame counter in real-time during playback
- Display current frame number in UI (Frame: N)

UI Enhancements:
- Frame step buttons: ◀| (previous) and |▶ (next)
- Frame counter label with monospace styling
- Integrated into existing player controls layout

Technical Details:
- Frame calculation: targetFrame = currentFrame ± delta
- Time conversion: offset = frameNumber / fps
- Clamp frame numbers to valid range [0, maxFrame]
- Call frameFunc callback on each displayed frame

Foundation ready for future enhancements (keyboard shortcuts, etc.)
2025-12-23 15:37:26 -05:00
f6e8e95b3e Harden DVDStyler download for Windows deps 2025-12-23 15:33:54 -05:00
a075495a8a Fix Windows deps script encoding for PowerShell 2025-12-23 15:02:38 -05:00
1729a0e213 Mark dev20 across metadata 2025-12-23 14:39:44 -05:00
e5ef23c094 Bump version to v0.1.0-dev20 2025-12-23 14:37:31 -05:00
3e4fa4d745 Add lightweight roadmap and clarify dev workflow 2025-12-23 14:35:05 -05:00
60fd6e93ee Finalize authoring workflow and update install docs 2025-12-23 14:24:09 -05:00
2b6be14d59 Enhance Author module structure and implement drag-and-drop support
- Add authorClips, authorSubtitles, authorOutputType fields to appState
- Create authorClip struct for video clip management
- Implement drag-and-drop support for video clips and subtitles
- Add Settings tab with output type, region, aspect ratio options
- Create Video Clips tab with file management
- Add Subtitles tab for track management
- Prepare framework for DVD/ISO generation
- Update HandleAuthor to work with drag-and-drop system
- Add comprehensive file validation and error handling
- Support for multiple video clips compilation
- Ready for chapter detection and DVD authoring implementation
2025-12-22 20:09:43 -05:00
9ae3a794b4 Implement VT_Player module with frame-accurate video playback
- Add VTPlayer interface with microsecond precision seeking
- Implement MPV controller for frame-accurate playback
- Add VLC backend support for cross-platform compatibility
- Create FFplay wrapper to bridge existing controller
- Add factory pattern for automatic backend selection
- Implement Fyne UI wrapper with real-time controls
- Add frame extraction capabilities for preview system
- Support preview mode for trim/upscale/filter modules
- Include working demo and implementation documentation
2025-12-21 16:31:44 -05:00