VT_Player/docs/FEATURE_ROADMAP.md
Stu 5e2c07ad21 Create custom timeline widget with keyframe markers (Commit 6)
Implements visual timeline with smooth interaction and keyframe visualization:

Timeline Widget Features:
- Custom Fyne widget in internal/ui/timeline.go
- Visual keyframe markers (yellow 1px vertical lines)
- Current position scrubber (white 2px line with circle handle)
- Progress fill showing played portion (gray)
- Mouse click/drag for smooth seeking
- In/out point marker support (for future cut functionality)

Rendering Performance:
- Cached rendering objects to minimize redraws
- Only scrubber position updates on playback
- Full redraw only on resize or keyframe data change
- Optimized for 1000+ keyframes without lag

UI Integration:
- Timeline replaces slider when keyframing mode is enabled
- Automatically loads keyframe timestamps from Index
- Integrates with existing updateProgress callback
- Maintains current time/total time labels

Technical Implementation:
- TimelineWidget extends widget.BaseWidget
- Custom renderer implements fyne.WidgetRenderer
- SetOnChange() for seek callback
- SetPosition() for playback updates
- SetKeyframes() for keyframe marker display
- Desktop mouse events for hover and drag

Visual Design:
- Dark gray background (#282828)
- Lighter gray progress fill (#3C3C3C)
- Yellow keyframe markers (#FFDC00 with transparency)
- White scrubber with circular handle
- Blue in-point marker for cuts
- Red out-point marker for cuts

References: DEV_SPEC lines 192-241

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 12:07:45 -05:00

8.6 KiB

VT_Player Feature Implementation Roadmap

This document tracks feature implementation with one git commit per feature. Each feature will be implemented according to the DEV_SPEC_FRAME_ACCURATE_PLAYBACK.md.

Commit Strategy

  • One feature = One commit
  • Descriptive commit messages following format: Add [feature]: [brief description]
  • Test each feature before committing
  • Update this file to track completion status

Phase 1: Core Playback Foundation ✓ (Partially Complete)

Commit 1: Fix video loading and display

Status: COMPLETED

  • Fix drag-and-drop video loading (s.source not set)
  • Show initial thumbnail/preview frame
  • Improve ffprobe error messages Commit: Ready to commit

Commit 2: Improve player layout

Status: COMPLETED

  • Move playlist to right side
  • Add playlist toggle button
  • Make window properly resizable Commit: Ready to commit

Phase 2: Frame-Accurate Navigation ✓ (COMPLETED)

Commit 3: Implement keyframe detection system

Status: COMPLETED (Commit 1618558)

  • Create internal/keyframe/detector.go
  • Implement DetectKeyframes() using ffprobe
  • Implement keyframe caching (~/.cache/vt_player/)
  • Add FindNearestKeyframe() function
  • Performance target: <5s for 1-hour video (achieved: 441 kf/sec) References: DEV_SPEC lines 54-119

Commit 4: Implement keyframe detection system (Combined with Commit 3)

Status: COMPLETED (Commit 1618558)

  • Note: Commits 3 and 4 were combined into a single implementation
  • Keyframe detection system fully implemented with caching and binary search

Commit 5: Add frame-accurate navigation controls

Status: COMPLETED (Commit 3a5b1a1)

  • Add frame step buttons (previous/next frame)
  • Implement StepFrame() in player controller
  • Add keyboard shortcuts (Left/Right arrows for frames, Up/Down for keyframes)
  • Add keyframe navigation buttons (<<KF, KF>>)
  • Implement keyframe jump functionality
  • Display frame counter in UI
  • Update position tracking
  • Automatic keyframe index loading when enabling frame mode References: DEV_SPEC lines 121-190, 246-295

Phase 3: Timeline & Visualization (DEV_SPEC Phase 3)

Commit 6: Create custom timeline widget

Priority: HIGH

  • Create internal/ui/timeline.go
  • Implement custom Fyne widget with keyframe markers
  • Add visual keyframe indicators (yellow lines)
  • Smooth seeking via timeline drag References: DEV_SPEC lines 192-241

Commit 7: Add timeline markers and display

Priority: HIGH

  • Display keyframe markers on timeline
  • Add in-point marker (blue line)
  • Add out-point marker (red line)
  • Show current position scrubber References: DEV_SPEC lines 217-233

Phase 4: Lossless Cut Features (DEV_SPEC Phase 5)

Commit 8: Implement in/out point marking

Priority: HIGH (Core LosslessCut feature)

  • Add "Set In" button (keyboard: I)
  • Add "Set Out" button (keyboard: O)
  • Add "Clear" button (keyboard: X)
  • Visual feedback on timeline References: DEV_SPEC lines 296-311

Commit 9: Create cut export system

Priority: HIGH

  • Create internal/cut/export.go
  • Implement Export() with FFmpeg stream copy
  • Add export validation (keyframe proximity check)
  • Add progress reporting References: DEV_SPEC lines 351-495

Commit 10: Add export UI and dialogs

Priority: HIGH

  • Add "Export Cut" button (keyboard: E)
  • File save dialog
  • Progress dialog with cancel
  • Success/error feedback
  • Auto-snap to keyframe option References: DEV_SPEC lines 432-495

Phase 5: Subtitle Support

Commit 11: Add subtitle track detection

Priority: MEDIUM

  • Extend probeVideo() to detect subtitle streams
  • Store subtitle track metadata
  • Create subtitle track selection UI

Commit 12: Implement subtitle rendering

Priority: MEDIUM

  • Add subtitle extraction via ffmpeg
  • Parse subtitle formats (SRT, ASS, WebVTT)
  • Render subtitles over video
  • Add subtitle toggle button/shortcut

Commit 13: Add subtitle styling controls

Priority: LOW

  • Font size adjustment
  • Font color/background options
  • Position adjustment
  • Save subtitle preferences

Phase 6: Advanced Playback Features

Commit 14: Add playback speed control

Priority: MEDIUM

  • Speed control widget (0.25x - 2x)
  • Keyboard shortcuts (+/- for speed)
  • Maintain pitch correction option
  • Display current speed in UI

Commit 15: Implement A-B loop functionality

Priority: MEDIUM

  • Set loop start point (A)
  • Set loop end point (B)
  • Enable/disable loop mode
  • Visual indicators on timeline
  • Keyboard shortcuts (A, B, L keys)

Commit 16: Add screenshot capture

Priority: MEDIUM

  • Capture current frame as PNG
  • File save dialog
  • Keyboard shortcut (S or F12)
  • Show success notification
  • Filename with timestamp

Phase 7: Multiple Audio/Video Tracks

Commit 17: Add audio track detection

Priority: MEDIUM

  • Detect all audio streams in video
  • Store audio track metadata (language, codec)
  • Create audio track selection menu

Commit 18: Implement audio track switching

Priority: MEDIUM

  • Switch audio track during playback
  • Remember selected track per video
  • Keyboard shortcut for cycling tracks

Commit 19: Add video track selection (for multi-angle)

Priority: LOW

  • Detect multiple video streams
  • Video track selection UI
  • Switch video tracks

Phase 8: Chapter Support (VideoTools Integration)

Commit 20: Add chapter detection

Priority: MEDIUM (Required for VideoTools integration)

  • Extend probeVideo() to detect chapters
  • Parse chapter metadata (title, timestamp)
  • Store chapter information in videoSource

Commit 21: Create chapter navigation UI

Priority: MEDIUM

  • Chapter list widget/menu
  • Chapter markers on timeline
  • Click chapter to jump
  • Display current chapter

Commit 22: Add chapter navigation controls

Priority: MEDIUM

  • Previous chapter button
  • Next chapter button
  • Keyboard shortcuts (PgUp/PgDn)
  • Chapter information overlay

Phase 9: Enhanced UI/UX

Commit 23: Add fullscreen mode

Priority: MEDIUM

  • Fullscreen toggle (F11 or double-click)
  • Auto-hide controls after 3 seconds
  • Mouse movement shows controls
  • Exit fullscreen (Escape or F11)

Commit 24: Implement aspect ratio controls

Priority: MEDIUM

  • Detect source aspect ratio
  • Aspect ratio menu (Auto, 16:9, 4:3, 21:9, etc.)
  • Crop/letterbox options
  • Remember preference per video

Commit 25: Add video information overlay

Priority: LOW

  • Show codec, resolution, bitrate
  • Show current frame number
  • Show keyframe indicator
  • Toggle with keyboard (I key)

Commit 26: Create settings dialog

Priority: MEDIUM

  • Hardware acceleration toggle
  • Default volume setting
  • Cache size limit
  • Screenshot save location
  • Keyboard shortcut configuration

Phase 10: Performance & Polish

Commit 27: Optimize keyframe detection caching

Priority: MEDIUM

  • Implement persistent disk cache
  • Cache invalidation on file modification
  • Limit cache size (50MB default)
  • Cache cleanup on startup

Commit 28: Add keyboard shortcuts help

Priority: LOW

  • Create shortcuts overlay (? or F1)
  • List all shortcuts
  • Searchable/filterable
  • Printable reference

Commit 29: Implement recent files list

Priority: LOW

  • Track recently opened files
  • Recent files menu
  • Limit to 10 most recent
  • Clear recent files option

Commit 30: Add drag-and-drop enhancements

Priority: LOW

  • Visual drop zone highlight
  • Support for subtitle file drops
  • Support for playlist file drops (M3U, etc.)
  • Feedback during drop operation

Summary

Total Commits Planned: 30 Completed: 5 (Commits 1-5) In Progress: 1 (Commit 6) Remaining: 25

Priority Breakdown:

  • HIGH: 11 features (Core frame-accurate playback)
  • MEDIUM: 14 features (Extended functionality)
  • LOW: 5 features (Polish and convenience)

Estimated Timeline:

  • Phase 2-4 (Frame-accurate + Cut): ~2-3 weeks (Priority features)
  • Phase 5-8 (Subtitles, Tracks, Chapters): ~2-3 weeks
  • Phase 9-10 (Polish): ~1 week

Dependencies:

  • Chapters (Commit 20-22) must be compatible with VideoTools format
  • Keyframe detection (Commit 3) is required before timeline (Commit 6)
  • Timeline (Commit 6-7) is required before cut markers (Commit 8)