Commit Graph

62 Commits

Author SHA1 Message Date
320f522d85 Fix queue progress calc type 2025-12-17 02:38:55 -05:00
73e5c4940f Animate striped progress bars in queue 2025-12-17 02:25:00 -05:00
530418f3e5 Improve queue progress UI and upscale progress reporting 2025-12-17 02:21:55 -05:00
c4c41b5606 Fix 'Clear Completed' to preserve running jobs
Removed cancelRunningLocked() call from Clear() method.
Now 'Clear Completed' only removes completed/failed/cancelled jobs
and preserves pending/running/paused jobs.

Previously it was cancelling active jobs before filtering, causing
running jobs (like merges) to be removed from the queue.
2025-12-17 00:34:20 -05:00
3a9b470e81 Complete dev18: Thumbnail enhancements, Player/Filters/Upscale modules, and precise snippet generation
Enhances screenshot module with comprehensive technical metadata display including audio bitrate, adds 8px padding between thumbnails for professional contact sheets. Implements new Player module for video playback access. Adds complete Filters and Upscale modules with traditional FFmpeg scaling methods (Lanczos, Bicubic, Spline, Bilinear) and resolution presets (720p-8K). Introduces configurable snippet length (5-60s, default 20s) with batch generation capability for all loaded videos. Fixes snippet duration precision by re-encoding instead of stream copy to ensure frame-accurate cutting at configured length.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 15:36:24 -05:00
f1d445dd0a Fix thumbnail generation and add viewing capability
Fixed Thumbnail Count Issue:
- Changed frame selection from hardcoded 30fps to timestamp-based
- Now uses gte(t,timestamp) filter for accurate frame selection
- This fixes the issue where 5x8 grid only generated 34 instead of 40 thumbnails

Improved Contact Sheet Display:
- Reduced thumbnail width from 320px to 200px for better window fit
- Changed background color from black to app theme (#0B0F1A)
- Contact sheets now match the VideoTools dark blue theme

Added Viewing Capability:
- New "View Results" button in thumbnail module
- Contact sheet mode: Shows image in full-screen dialog (900x700)
- Individual mode: Opens thumbnail folder in file manager
- Button checks if output exists before showing
- Provides user-friendly messages when no results found

Benefits:
- Correct number of thumbnails generated for any grid size
- Contact sheets fit better in display window
- Visual consistency with app theme
- Easy access to view generated results within the app

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 20:56:05 -05:00
a40f7ad795 Fix thumbnail generation and add preview window
Fixed Issues:
- Exit 234 error: Added font parameter to drawtext filter for individual
  thumbnails (was missing, causing FFmpeg to fail)
- Output directory: Changed from temp to video's directory, creating a
  folder named "{video}_thumbnails" next to the source file

New Features:
- Added video preview window to thumbnail module (640x360)
- Split layout: preview on left (55%), settings on right (45%)
- Preview uses same buildVideoPane as other modules for consistency

The thumbnail module now has a proper preview window for reviewing
the loaded video before generating thumbnails, and outputs are saved
in a logical location next to the source file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 20:40:06 -05:00
37fa9d1a5c Use monospace font for contact sheet metadata
Updated FFmpeg drawtext filter to use DejaVu Sans Mono for metadata
text on contact sheets. This matches the monospace font style used
throughout the VideoTools UI.

DejaVu Sans Mono is widely available across Linux, macOS, and Windows,
ensuring consistent appearance across platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 20:38:11 -05:00
93c5d0d6d4 Add metadata header to thumbnail contact sheets
Implemented metadata header rendering on contact sheets showing:
- Filename and file size
- Video resolution and duration

Uses FFmpeg pad and drawtext filters to create an 80px header area
with white text on black background.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 18:56:39 -05:00
4e66b317bc Add Thumbnail Generation Module (dev17)
New Features:
- Thumbnail extraction package with FFmpeg integration
- Individual thumbnails or contact sheet generation
- Configurable thumbnail count (3-50 thumbnails)
- Adjustable thumbnail width (160-640 pixels)
- Contact sheet mode with customizable grid (2-10 columns/rows)
- Timestamp overlay on thumbnails
- Auto-open generated thumbnails folder

Technical Implementation:
- internal/thumbnail package with generator
- FFmpeg-based frame extraction
- Video duration and dimension detection
- Aspect ratio preservation
- JPEG quality control
- PNG lossless option support

UI Features:
- Thumbnail module in main menu (Orange tile)
- Load video via file picker
- Real-time configuration sliders
- Contact sheet toggle with grid controls
- Generate button with progress feedback
- Success dialog with folder open option

Integration:
- Added to module routing system
- State management for thumb module
- Proper Fyne threading with DoFromGoroutine
- Cross-platform folder opening support

Module is fully functional and ready for testing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 18:43:34 -05:00
2acf568cc2 Add interlacing analysis UI to Convert module
Integrated interlacing detection into the Convert module with:

Features:
- "Analyze Interlacing" button in metadata panel
- Real-time analysis using FFmpeg idet filter (first 500 frames)
- Color-coded results card showing:
  - Status (Progressive/Interlaced/Mixed)
  - Interlacing percentage
  - Field order (TFF/BFF/Unknown)
  - Confidence level
  - Recommendation text
  - Detailed frame counts

Auto-updates:
- Automatically suggests enabling deinterlacing if needed
- Updates Convert deinterlace setting from "Off" to "Auto" when interlacing detected

UI States:
- Initial: Just "Analyze Interlacing" button
- Analyzing: Shows progress message
- Complete: Shows colored results card with full analysis

Analysis runs in background goroutine with proper thread-safe UI updates.

Next: Add to simple menu and Inspect module

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 16:43:05 -05:00
49c865b1e3 Add interlacing detection analyzer
Created core interlacing detection system using FFmpeg's idet filter.

Features:
- Analyze videos for interlacing using FFmpeg idet filter
- Parse TFF, BFF, Progressive, and Undetermined frame counts
- Calculate interlacing percentage and confidence level
- Determine field order (TFF/BFF/Mixed/Progressive)
- Generate recommendations for deinterlacing
- Quick analysis mode (first 500 frames) for speed
- Full video analysis option
- Preview generation: deinterlaced frame or side-by-side comparison

Detection Results include:
- Status: Progressive / Interlaced / Mixed Content
- Interlacing %: Portion of frames that are interlaced
- Field Order: Top Field First, Bottom Field First, or Unknown
- Confidence: High/Medium/Low based on undetermined frames
- Recommendation: Human-readable guidance
- Suggested filter: yadif, bwdif, etc.

Next: UI integration in Convert and Inspect modules

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 16:30:54 -05:00
b01e83b97c Fix benchmark progress bar percentage calculation
The progress bar was configured with Max=100 but we were setting
values in the 0.0-1.0 range, causing it to always show ~0%.

Fixed by multiplying the percentage by 100 before setting the value,
so 4/22 = 0.18 becomes 18% instead of 0.18%.

Also fixed SetComplete() to set 100.0 instead of 1.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 14:04:20 -05:00
1447e1478f Fix Fyne threading errors in benchmark progress updates
All UI updates from the benchmark goroutine were causing threading
errors because they weren't wrapped in DoFromGoroutine. Fixed:

- UpdateProgress: progress bar and label updates
- AddResult: adding result cards to the display
- SetComplete: final status updates

These methods are called from background goroutines running the
benchmark tests, so all UI updates must be dispatched to the main
thread using fyne.CurrentApp().Driver().DoFromGoroutine().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 13:33:18 -05:00
4d99f6ec78 Add benchmark history tracking and results browser
Extended the benchmark system to maintain a complete history of all
benchmark runs (up to last 10) with full results for each encoder/preset
combination tested.

Features:
- Stores complete benchmark run data including all test results
- History browser UI to view past benchmark runs
- Click any run to see detailed results for all encoders tested
- Compare performance across different presets and encoders
- Apply recommendations from past benchmarks
- Automatic history limit (keeps last 10 runs)

UI Changes:
- Renamed "Benchmark" button to "Run Benchmark"
- Added "View Results" button to main menu
- New benchmark history view showing all past runs
- Each run displays timestamp, recommended encoder, and test count
- Clicking a run shows full results with all encoder/preset combinations

Data Structure:
- benchmarkRun: stores single test run with all results
- benchmarkConfig: maintains array of benchmark runs
- Saves to ~/.config/VideoTools/benchmark.json

This allows users to review past benchmark results and make informed
decisions about which encoder settings to use by comparing FPS across
all available options on their hardware.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 13:07:51 -05:00
87c2d28e9f Add comprehensive hardware encoder benchmarking system
Implemented a full benchmark system that automatically detects available
hardware encoders, tests them with different presets, measures FPS
performance, and recommends optimal settings for the user's system.

Features:
- Automatic test video generation (30s 1080p test pattern)
- Hardware encoder detection (NVENC, QSV, AMF, VideoToolbox)
- Comprehensive encoder testing across multiple presets
- Real-time progress UI with live results
- Performance scoring based on FPS metrics
- Top 10 results display with recommendation
- Config persistence for benchmark results
- One-click apply to use recommended settings

UI Components:
- Benchmark button in main menu header
- Progress view showing current test and results
- Final results view with ranked encoders
- Apply/Close actions for recommendation

Integration:
- Added to main menu between "Benchmark" and "Logs" buttons
- Saves results to ~/.config/VideoTools/benchmark.json
- Comprehensive debug logging for troubleshooting

This allows users to optimize their encoding settings based on their
specific hardware capabilities rather than guessing which encoder
will work best.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 09:16:36 -05:00
e5ea8d13c8 Fix merge job progress reporting jumping to 100% immediately
The issue was that FFmpeg's out_time_ms field is actually in microseconds
(not milliseconds despite the name). We were dividing by 1,000 when we
should have been dividing by 1,000,000 to convert to seconds.

This caused the progress calculation to be off by 1000x, making it
immediately jump to 100% even though the job was just starting.

Also added comprehensive debug logging to track progress samples and
identify calculation issues in the future.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 09:12:18 -05:00
1367a7e492 Truncate long error messages in queue view to prevent UI overflow
Long FFmpeg error messages were pushing the queue UI off screen, making
the interface unusable when jobs failed with verbose errors.

Changes:
- Truncate error messages to 150 characters maximum in status text
- Add helpful message indicating full error is available via Copy Error button
- Enable text wrapping on status labels to handle multi-line content gracefully
- Prevents UI layout breakage while maintaining error visibility

Users can still access the full error message via:
- Copy Error button (copies full error to clipboard)
- View Log button (opens per-job conversion log)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-13 08:45:08 -05:00
10c1ef04c1 Simplify droppable to match fyne drop signature 2025-12-11 07:22:36 -05:00
158b4d9217 Use fyne drop signatures to fix build 2025-12-11 06:59:50 -05:00
b40129c2f9 Fix build by updating droppable drop handling 2025-12-11 06:58:01 -05:00
fb5c63cd29 Fix droppable signature and dependency handling 2025-12-11 06:53:49 -05:00
0221c04a4f Add droppable merge empty state 2025-12-10 16:43:20 -05:00
f94629e55e Add in-module cancel for running jobs 2025-12-10 15:46:18 -05:00
0c86d9c793 Enforce DVD presets and optional merge chapters 2025-12-10 14:53:09 -05:00
d14225f402 Persist convert config and tidy queue UI 2025-12-09 13:24:39 -05:00
e124fe4d1a Remove unused import in dvd adapter 2025-12-09 11:41:07 -05:00
038c1567eb Queue snippets and honor user aspect; skip HW accel if unavailable 2025-12-09 01:33:05 -05:00
20a2fa7110 Show bitrate in kbps/Mbps and expand presets 2025-12-08 23:53:40 -05:00
d094010440 Add simple bitrate/resolution/aspect controls and cache helper 2025-12-08 23:22:28 -05:00
2f16d4af36 Fallback bitrate uses source bitrate; add size/bitrate delta helpers 2025-12-08 22:26:06 -05:00
4f4ecc450d Fix formatting helpers: add math import and self-contained reduction formatting 2025-12-08 20:43:17 -05:00
bd49952800 Normalize MP4 format label, improve log readability, and prep reduction display 2025-12-08 18:46:34 -05:00
6ad72ecc46 Shorten queue descriptions and wrap text to keep controls visible 2025-12-08 18:13:18 -05:00
4f6746594a Fix feedback bundler export and use utils.NewFeedbackBundler 2025-12-08 16:06:58 -05:00
eb349f8365 Add metadata map to VideoSource and add MP4 H.265 preset 2025-12-08 16:02:53 -05:00
01af78debc Fix feedback bundler import to restore build 2025-12-08 15:13:24 -05:00
25235e3ec6 Fix imports for grouped main menu build 2025-12-08 12:26:01 -05:00
8c84aa6fc6 Add sort import for grouped main menu 2025-12-08 12:18:17 -05:00
c7a18e89c8 Group main menu by category and add logs access 2025-12-08 12:07:58 -05:00
8e601bc7d2 Add per-conversion logs and surface them in queue UI 2025-12-08 11:31:12 -05:00
f900f6804d Hide ffmpeg console windows on Windows and fix inspect clear button 2025-12-08 11:26:14 -05:00
53b1b839c5 Add queue error copy, auto naming helper, and metadata templating 2025-12-07 12:03:21 -05:00
7341cf70ce Add dev14 fixes: progress tracking, AMD AMF support, DVD resolution fix, and Windows build automation
This commit includes three critical bug fixes and Windows build improvements:

**Bug Fixes:**

1. **Queue Conversion Progress Tracking** (main.go:1471-1534)
   - Enhanced executeConvertJob() to parse FPS, speed, and ETA from FFmpeg output
   - Queue jobs now show detailed progress metrics matching direct conversions
   - Stats stored in job.Config for display in the conversion stats bar

2. **AMD AMF Hardware Acceleration** (main.go)
   - Added "amf" to hardware acceleration options
   - Support for h264_amf, hevc_amf, and av1_amf encoders
   - Added AMF-specific error detection in FFmpeg output parsing

3. **DVD Format Resolution Forcing** (main.go:1080-1103, 4504-4517)
   - Removed automatic resolution forcing when DVD format is selected
   - Removed -target parameter usage which was forcing 720×480/720×576
   - Resolution now defaults to "Source" unless explicitly changed
   - DVD compliance maintained through manual bitrate/GOP/codec parameters

**Windows Build Improvements:**

- Updated build.bat to enable CGO (required for Fyne/OpenGL)
- Added automatic GCC/MinGW-w64 detection and installation
- Automated setup via winget for one-command Windows builds
- Improved error messages with fallback manual instructions

**Documentation:**

- Added comprehensive Windows setup guides
- Created platform.go for future platform-specific code
- Updated .gitignore for Windows build artifacts

All changes tested and working. Ready for production use.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:11:15 -05:00
5b8fc452af Add FPS counter, queue improvements, Compare fixes, and comprehensive documentation
Features:
- FPS counter in conversion status showing real-time encoding speed
- Job queue now displays FPS, encoding speed (e.g., "1.2x"), and ETA for running conversions
- Copy Comparison button exports side-by-side metadata comparison report
- Auto-compare checkbox in Convert module - automatically loads Compare view after conversion
- Convert Now properly adds job to queue and displays in Job Queue with live stats
- Module badge colors in job queue now match main menu tile colors
- Fixed fullscreen compare window sizing (reduced player dimensions to prevent overflow)

Bug Fixes:
- Fixed queue state management - only one job runs at a time (prevents multiple jobs showing "running")
- Fixed Compare module slot assignment - single video drops now fill empty slot instead of overwriting
- Fixed job queue scroll rubber banding (no longer jumps back to top)
- Enhanced crop detection validation for WMV/AVI formats with dimension clamping and bounds checking

Documentation:
- VT_Player integration notes with API requirements for keyframing and trim features
- LosslessCut feature analysis for Trim module inspiration
- Video metadata guide covering MP4/MKV custom fields and NFO generation
- Trim module design specification
- Compare fullscreen mode documentation
- Updated VIDEO_PLAYER_FORK.md to mark fork as completed

Technical Changes:
- Added state tracking for FPS, speed, and ETA (main.go:197-199)
- Enhanced queue processJobs() to check for running jobs before starting new ones
- Improved Compare module drag-and-drop logic with smart slot assignment (both code paths)
- Added deferred scroll position restoration to prevent UI jumping
- Job queue Config map now carries conversion stats for display

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 07:35:48 -05:00
71a282b828 Add Compare module and Target File Size encoding feature
This commit implements two new features:

1. Compare Module:
   - New UI module for side-by-side video comparison
   - Loads two video files and displays detailed metadata comparison
   - Shows format, resolution, codecs, bitrates, frame rate, color info, etc.
   - Accessible via GUI module button or CLI: videotools compare <file1> <file2>
   - Added formatBitrate() helper function for consistent bitrate display

2. Target File Size Encoding Mode:
   - New bitrate mode "Target Size" for convert module
   - Allows users to specify desired output file size (e.g., "25MB", "100MB", "8MB")
   - Automatically calculates required video bitrate based on:
     * Target file size
     * Video duration
     * Audio bitrate
     * Container overhead (3% reserved)
   - Implemented ParseFileSize() to parse size strings (KB, MB, GB)
   - Implemented CalculateBitrateForTargetSize() for bitrate calculation
   - Works in both GUI convert view and job queue execution

Additional changes:
- Updated printUsage() to include compare command
- Added compare button to module grid with pink color
- Added compareFile1 and compareFile2 to appState
- Consistent "Target Size" naming throughout (UI and code)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 20:14:31 -05:00
6a2f1fff3f Add target file size feature and fix multiple encoding issues
- Add TargetFileSize mode with automatic bitrate calculation
- Add CalculateBitrateForTargetSize and ParseFileSize utility functions
- Fix NVENC hardware encoding (remove incorrect -hwaccel cuda flag)
- Fix auto-detection override when hardware accel set to none
- Fix 10-bit pixel format incompatibility (change to 8-bit yuv420p)
- Add enhanced video metadata display (PAR, color space, GOP size, audio bitrate, chapters)
- Improve error reporting with FFmpeg stderr capture and exit code interpretation
- Add interpretFFmpegError function for human-readable error messages
2025-12-03 10:00:14 -05:00
e0e7c33445 Preserve queue scroll and show active conversion inline 2025-11-30 00:48:56 -05:00
c237cb8a8e Fix queue scroll jump and DVD format codec selection 2025-11-30 00:15:04 -05:00
1187a77f43 Fix convert layout stacking and cgo build 2025-11-30 00:01:06 -05:00