Page:
VT_PLAYER_IMPLEMENTATION
Pages
AUTHOR_MODULE
BUGS
BUILD
BUILD_AND_RUN
CHANGELOG
CHOCO_INSTALL
COMPARE_FULLSCREEN
COMPLETION_SUMMARY
CONVERT_MODULARIZATION_PLAN
CROSS_PLATFORM_GUIDE
DEV14_WINDOWS_IMPLEMENTATION
DEV30_FINALIZATION_CHECKLIST
DVD_IMPLEMENTATION_SUMMARY
DVD_USER_GUIDE
Documentation
GNOME_COMPATIBILITY
GSTREAMER_MIGRATION_PLAN
Home
IMPLEMENTATION_SUMMARY
INSTALLATION
INSTALL_LINUX
INSTALL_WINDOWS
INTEGRATION_GUIDE
INTERNAL_DVD_AUTHORING_SPEC
LATEST_UPDATES
LATEX_PREPARATION
LOSSLESSCUT_INSPIRATION
MODULES
PERSISTENT_VIDEO_CONTEXT
PHASE2_COMPLETE
PHASE2_INTEGRATION_PLAN
PLAYER_MODULE
PLAYER_PERFORMANCE_ISSUES
PROJECT_STATUS
QUEUE_SYSTEM_GUIDE
QUICKSTART
REFACTOR_DEV30_PLAN
ROADMAP
TESTING_CHECKLIST
TESTING_DEV13
TESTING_MODULE_CHECKLIST
TEST_DVD_CONVERSION
TODO_EXTRACTION_NOTES
TRIM_MODULE_DESIGN
VIDEO_METADATA_GUIDE
VIDEO_PLAYER
VIDEO_PLAYER_FORK
VT_PLAYER_IMPLEMENTATION
VT_PLAYER_INTEGRATION_NOTES
WINDOWS_BUILD_PERFORMANCE
WINDOWS_COMPATIBILITY
WINDOWS_PACKAGING
WINDOWS_SETUP
WORKING_ON
localization policy
No results
2
VT_PLAYER_IMPLEMENTATION
Gemini CLI edited this page 2026-03-13 11:05:17 -04:00
Table of Contents
- VT_Player Implementation Summary
- Overview
- Architecture
- Core Interface (vtplayer.go)
- Backend Support
- MPV Controller (mpv_controller.go)
- VLC Controller (vlc_controller.go)
- FFplay Wrapper (ffplay_wrapper.go)
- Factory Pattern (factory.go)
- Fyne UI Integration (fyne_ui.go)
- Key Features Implemented
- Integration Points
- Usage Example
- Future Enhancements
- Testing
- Conclusion
VT_Player Implementation Summary
Overview
We have successfully implemented the VT_Player module within VideoTools, replacing the need for an external fork. The implementation provides frame-accurate video playback with multiple backend support.
Architecture
Core Interface (vtplayer.go)
VTPlayerinterface with frame-accurate seeking support- Microsecond precision timing for trim/preview functionality
- Frame extraction capabilities for preview systems
- Callback-based event system for real-time updates
- Preview mode support for upscale/filter modules
Backend Support
MPV Controller (mpv_controller.go)
- Primary backend for best frame accuracy
- Command-line MPV integration with IPC control
- High-precision seeking with
--hr-seek=yesand--hr-seek-framedrop=no - Process management and monitoring
VLC Controller (vlc_controller.go)
- Cross-platform fallback option
- Command-line VLC integration
- Basic playback control (extensible for full RC interface)
FFplay Wrapper (ffplay_wrapper.go)
- Wraps existing ffplay controller
- Maintains compatibility with current codebase
- Bridge to new VTPlayer interface
Factory Pattern (factory.go)
- Automatic backend detection and selection
- Priority order: MPV > VLC > FFplay
- Runtime backend availability checking
- Configuration-driven backend choice
Fyne UI Integration (fyne_ui.go)
- Clean, responsive interface
- Real-time position updates
- Frame-accurate seeking controls
- Volume and speed controls
- File loading and playback management
Key Features Implemented
Frame-Accurate Functionality
SeekToTime()with microsecond precisionSeekToFrame()for direct frame navigation- High-precision backend configuration
- Frame extraction for preview generation
Preview System Support
EnablePreviewMode()for trim/upscale workflowsExtractFrame()at specific timestampsExtractCurrentFrame()for live preview- Optimized for preview performance
Microsecond Precision
- Time-based seeking with
time.Durationprecision - Frame calculation based on actual FPS
- Real-time position callbacks
- Accurate duration tracking
Integration Points
Trim Module
- Frame-accurate preview of cut points
- Microsecond-precise seeking for edit points
- Frame extraction for thumbnail generation
Upscale/Filter Modules
- Live preview with parameter changes
- Frame-by-frame comparison
- Real-time processing feedback
VideoTools Main Application
- Seamless integration with existing architecture
- Backward compatibility maintained
- Enhanced user experience
Usage Example
// Create player with auto backend selection
config := &player.Config{
Backend: player.BackendAuto,
Volume: 50.0,
AutoPlay: false,
}
factory := player.NewFactory(config)
vtPlayer, _ := factory.CreatePlayer()
// Load and play video
vtPlayer.Load("video.mp4", 0)
vtPlayer.Play()
// Frame-accurate seeking
vtPlayer.SeekToTime(10 * time.Second)
vtPlayer.SeekToFrame(300)
// Extract frame for preview
frame, _ := vtPlayer.ExtractFrame(5 * time.Second)
Future Enhancements
- Enhanced IPC Control: Full MPV/VLC RC interface integration
- Hardware Acceleration: GPU-based frame extraction
- Advanced Filters: Real-time video effects preview
- Performance Optimization: Zero-copy frame handling
- Additional Backends: DirectX/AVFoundation for Windows/macOS
Testing
The implementation has been validated:
- Backend detection and selection works correctly
- Frame-accurate seeking is functional
- UI integration is responsive
- Preview mode is operational
Conclusion
The VT_Player module is now ready for production use within VideoTools. It provides the foundation for frame-accurate video operations needed by the trim, upscale, and filter modules while maintaining compatibility with the existing codebase.
Navigation
What is VideoTools?
Project Status
Capabilities
Codecs and Frame Rates
Installation (One Command)
Alternative: Developer Setup
DVD Workflow (Optional)
Documentation
- Project Status
- Installation
- Readme
- Build And Run
- DVD User Guide
- DVD Implementation Summary
- Integration Guide
- Queue System Guide
- Localization-Policy