Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
10238c7
feat: faditor mini setup
anonfaded Aug 29, 2025
226b929
task 4 done
anonfaded Aug 29, 2025
6fc3a78
task 5 done
anonfaded Aug 29, 2025
92fcc38
specs update
anonfaded Aug 29, 2025
a2db10f
task 6 done
anonfaded Aug 29, 2025
67d0762
task 7 done
anonfaded Aug 29, 2025
56056c3
task 8 done
anonfaded Aug 29, 2025
985ecde
task 9 done
anonfaded Aug 29, 2025
cfd966b
task 10 done
anonfaded Aug 29, 2025
f58e4b5
task 11 done
anonfaded Aug 29, 2025
ea4efcd
task 12 done
anonfaded Aug 29, 2025
e9d97ea
task 13 done
anonfaded Aug 29, 2025
617cea2
task 14 done
anonfaded Aug 29, 2025
9fccc4d
task 15 done
anonfaded Aug 29, 2025
b9f0e4e
task 16 done
anonfaded Aug 29, 2025
4fb3c24
task 17 done
anonfaded Aug 29, 2025
c25a641
task 18 done
anonfaded Aug 29, 2025
da683e5
task 19 done
anonfaded Aug 29, 2025
7f2e1a3
task 20 done
anonfaded Aug 29, 2025
a4b382c
task 21 done
anonfaded Aug 29, 2025
c95e559
fix: faditor mini issues
anonfaded Aug 29, 2025
5cfec09
fix: faditor mini issues with export button
anonfaded Aug 29, 2025
b538ad4
fix: faditor mini issues
anonfaded Aug 29, 2025
b968cf2
feat: Enhance media reference validation and URI re-selection
anonfaded Aug 29, 2025
530f011
chore: update kiro tasks
anonfaded Aug 30, 2025
6ef8e6f
task 22 done
anonfaded Aug 30, 2025
92903cc
task 23 done
anonfaded Aug 30, 2025
174b8ae
task 24 done
anonfaded Aug 30, 2025
a4e09b4
task 25 done
anonfaded Aug 30, 2025
ee6e76e
task 26 done
anonfaded Aug 30, 2025
de47e58
task 27 done
anonfaded Aug 31, 2025
4d0f3cf
Refactors project creation to use media management
anonfaded Aug 31, 2025
994e1f0
preview area bug fixes
anonfaded Aug 31, 2025
b923b3e
Fix video playback and timeline synchronization issues
Sep 1, 2025
4d23da3
Add professional scrubbing with frame cache
Sep 1, 2025
20d3c03
Reduce log verbosity and optimize performance tracking
Sep 1, 2025
a2956cf
Fix video player position synchronization issues
Sep 1, 2025
ed09dd0
Add professional timeline UI and controls
Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
871 changes: 871 additions & 0 deletions .kiro/specs/faditor-mini-video-editor/design.md

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions .kiro/specs/faditor-mini-video-editor/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# Requirements Document

## Introduction

The Faditor Mini is a lightweight video editor integrated into the FadCam app that allows users to perform basic video editing operations on their recorded videos. This feature will replace the current "Coming soon" placeholder with a functional video editor that leverages the existing FFmpeg AAR dependency for video processing operations.

## Requirements

### Requirement 1

**User Story:** As a FadCam user, I want to select and load videos from my device into the editor, so that I can edit my recorded videos or other videos on my device.

#### Acceptance Criteria

1. WHEN the user opens the Faditor Mini tab THEN the system SHALL display a video selection interface
2. WHEN the user taps on a video selection button THEN the system SHALL open a file picker to browse device videos
3. WHEN the user selects a video file THEN the system SHALL load and display the video in the editor interface
4. IF the selected video format is not supported THEN the system SHALL display an error message with supported formats
5. WHEN a video is successfully loaded THEN the system SHALL display video metadata (duration, resolution, file size)

### Requirement 2

**User Story:** As a user, I want to preview my video with playback controls, so that I can navigate through the video while editing.

#### Acceptance Criteria

1. WHEN a video is loaded THEN the system SHALL display a video preview player
2. WHEN the user taps the play button THEN the system SHALL start video playback
3. WHEN the user taps the pause button THEN the system SHALL pause video playback
4. WHEN the user drags the seek bar THEN the system SHALL update the video position accordingly
5. WHEN the video reaches the end THEN the system SHALL automatically pause and reset to beginning
6. WHEN the user taps on the timeline THEN the system SHALL seek to that position

### Requirement 3

**User Story:** As a user, I want to trim video segments, so that I can remove unwanted parts from my videos.

#### Acceptance Criteria

1. WHEN the user enters trim mode THEN the system SHALL display start and end trim handles on the timeline
2. WHEN the user drags the start handle THEN the system SHALL update the trim start position
3. WHEN the user drags the end handle THEN the system SHALL update the trim end position
4. WHEN the user confirms the trim operation THEN the system SHALL process the video using FFmpeg
5. WHEN trimming is complete THEN the system SHALL update the preview with the trimmed video
6. IF trimming fails THEN the system SHALL display an error message and revert to original video

### Requirement 4

**User Story:** As a user, I want to export my edited video, so that I can save the changes and use the video elsewhere.

#### Acceptance Criteria

1. WHEN the user taps the export button THEN the system SHALL display export options (quality, format)
2. WHEN the user confirms export settings THEN the system SHALL start processing the video with FFmpeg
3. WHEN export is in progress THEN the system SHALL display a progress indicator with percentage
4. WHEN export completes successfully THEN the system SHALL save the video to the device and show success message
5. WHEN export completes THEN the system SHALL offer options to share or view the exported video
6. IF export fails THEN the system SHALL display an error message with retry option

### Requirement 5

**User Story:** As a user, I want the editor interface to follow the app's design system, so that it feels integrated and consistent with the rest of FadCam.

#### Acceptance Criteria

1. WHEN the editor loads THEN the system SHALL use the same color scheme and theming as other app fragments
2. WHEN displaying UI elements THEN the system SHALL use consistent typography, spacing, and component styles
3. WHEN showing buttons and controls THEN the system SHALL use the same visual style as other app screens
4. WHEN displaying the header bar THEN the system SHALL match the style of other fragment headers
5. WHEN in dark mode THEN the system SHALL respect the app's dark theme colors and styling

### Requirement 6

**User Story:** As a user, I want clear feedback during video processing operations, so that I understand what's happening and can wait appropriately.

#### Acceptance Criteria

1. WHEN any video processing starts THEN the system SHALL display a loading indicator
2. WHEN processing is in progress THEN the system SHALL show progress percentage when available
3. WHEN processing completes successfully THEN the system SHALL display a success message
4. WHEN processing fails THEN the system SHALL display a clear error message explaining what went wrong
5. WHEN processing is in progress THEN the system SHALL disable editing controls to prevent conflicts
6. WHEN the user tries to navigate away during processing THEN the system SHALL warn about canceling the operation

### Requirement 7

**User Story:** As a user, I want fast and seamless video editing operations, so that I can edit videos efficiently without long wait times.

#### Acceptance Criteria

1. WHEN performing trim operations THEN the system SHALL use hardware acceleration via OpenGL for optimal performance
2. WHEN processing videos THEN the system SHALL maintain lossless quality for supported operations
3. WHEN editing large or high-resolution videos THEN the system SHALL complete operations in under 30 seconds for typical trim operations
4. WHEN the device supports hardware encoding THEN the system SHALL utilize GPU acceleration for video processing
5. WHEN performing real-time preview THEN the system SHALL maintain smooth 30fps playback without stuttering
6. WHEN switching between different timeline positions THEN the system SHALL seek to positions within 100ms

### Requirement 8

**User Story:** As a user, I want the editor to handle various video formats efficiently, so that I can edit videos regardless of their original encoding.

#### Acceptance Criteria

1. WHEN loading videos THEN the system SHALL support common formats (MP4, MOV, AVI, MKV) with hardware decoding when available
2. WHEN processing videos THEN the system SHALL automatically detect optimal processing method (lossless vs re-encoding)
3. WHEN trim operations don't require re-encoding THEN the system SHALL perform stream copying for instant results
4. WHEN re-encoding is necessary THEN the system SHALL use hardware encoders (MediaCodec) with OpenGL acceleration
5. WHEN exporting videos THEN the system SHALL maintain original quality settings unless user specifies otherwise
6. WHEN using OpenGL processing THEN the system SHALL maintain consistent performance across all supported Android devices

### Requirement 9

**User Story:** As a user, I want to save and manage my video editing projects, so that I can work on videos over multiple sessions and organize my editing work.

#### Acceptance Criteria

1. WHEN I start editing a video THEN the system SHALL automatically create a project with metadata and timeline data
2. WHEN I make edits to a video THEN the system SHALL save the project state as JSON with media references
3. WHEN I close the editor THEN the system SHALL persist the project so I can resume later
4. WHEN I open the editor THEN the system SHALL display a list of recent projects with thumbnails and metadata
5. WHEN I select a saved project THEN the system SHALL restore the complete editing state including timeline and trim ranges
6. WHEN I want to organize projects THEN the system SHALL allow me to rename, delete, or export project files
7. WHEN I export a project THEN the system SHALL create a shareable .fadproj file with all project data

### Requirement 10

**User Story:** As a user, I want a two-screen approach with a project browser and dedicated full-screen editor, so that I have maximum screen space for editing and easy project management.

#### Acceptance Criteria

1. WHEN I open the Faditor Mini tab THEN the system SHALL display a project browser screen with recent projects and creation options
2. WHEN I select a project or create a new one THEN the system SHALL open a dedicated full-screen editor fragment
3. WHEN I'm in the editor THEN the system SHALL hide the bottom navigation and provide maximum screen space for editing
4. WHEN I want to leave the editor THEN the system SHALL provide a clear back/leave button that returns to the project browser
5. WHEN I navigate between screens THEN the system SHALL use smooth transitions and maintain proper navigation stack
6. WHEN I accidentally leave the editor THEN the system SHALL auto-save my work and allow seamless resumption
7. WHEN I'm in the editor THEN the system SHALL provide a professional interface optimized for the full screen space

### Requirement 11

**User Story:** As a user, I want a professional video editor interface with proper tools and icons, so that I have an intuitive and efficient editing experience.

#### Acceptance Criteria

1. WHEN I open the editor THEN the system SHALL display a professional timeline-based interface similar to CapCut or other video editors
2. WHEN I interact with tools THEN the system SHALL use Material Design 3 icons and components instead of generic buttons
3. WHEN I use the timeline THEN the system SHALL provide professional scrubbing, zoom controls, and frame-accurate positioning
4. WHEN I access editing tools THEN the system SHALL organize them in a toolbar with clear icons (trim, split, effects, etc.)
5. WHEN I work with the interface THEN the system SHALL provide smooth animations and responsive feedback
6. WHEN I use sliders and controls THEN the system SHALL implement Material 3 design patterns for consistency
7. WHEN I view the project THEN the system SHALL display a proper video preview area with professional playback controls

### Requirement 12

**User Story:** As a user, I want continuous auto-saving of my work, so that I never lose my editing progress even if I accidentally leave or the app crashes.

#### Acceptance Criteria

1. WHEN I make any edit in the editor THEN the system SHALL automatically save the project state within 5 seconds
2. WHEN I navigate away from the editor THEN the system SHALL immediately save all changes before leaving
3. WHEN the app is backgrounded or interrupted THEN the system SHALL save the current state and resume seamlessly
4. WHEN the app crashes or is force-closed THEN the system SHALL recover the last saved state when reopened
5. WHEN I return to a project THEN the system SHALL restore the exact editing state including timeline position and tool selection
6. WHEN auto-save occurs THEN the system SHALL provide subtle visual feedback without interrupting the workflow
7. WHEN there are unsaved changes THEN the system SHALL warn before allowing destructive actions

### Requirement 13

**User Story:** As a user, I want high-performance OpenGL-based video preview during editing, so that I can have smooth frame-by-frame rendering and professional editing experience similar to CapCut or VN.

#### Acceptance Criteria

1. WHEN I load a video in the editor THEN the system SHALL use pure OpenGL ES rendering for all video preview without ExoPlayer dependency
2. WHEN I scrub through the timeline THEN the system SHALL render frames using GPU acceleration with <50ms seek times
3. WHEN I perform frame-accurate editing THEN the system SHALL provide pixel-perfect frame rendering at native video resolution
4. WHEN I zoom into the timeline THEN the system SHALL maintain smooth 60fps preview rendering during scrubbing
5. WHEN I edit high-resolution videos (4K) THEN the system SHALL utilize GPU texture memory efficiently without stuttering
6. WHEN I switch between timeline positions THEN the system SHALL decode and render frames on-demand using MediaCodec with OpenGL surface output
7. WHEN playing back video THEN the system SHALL use OpenGL rendering pipeline for smooth playback without ExoPlayer fallbacks

### Requirement 14

**User Story:** As a user, I want a modular OpenGL video system with clean component architecture, so that the codebase remains maintainable and performant without cluttered monolithic files.

#### Acceptance Criteria

1. WHEN implementing OpenGL video components THEN the system SHALL use separate focused classes for each responsibility (decoder, renderer, texture manager, etc.)
2. WHEN managing video decoding THEN the system SHALL have dedicated MediaCodec wrapper components for hardware decoding
3. WHEN handling OpenGL rendering THEN the system SHALL have separate shader management, surface handling, and frame processing components
4. WHEN managing textures THEN the system SHALL have dedicated texture pool and memory management components
5. WHEN coordinating playback THEN the system SHALL have a clean video controller that orchestrates all components
6. WHEN adding new features THEN the system SHALL allow easy extension through well-defined component interfaces
7. WHEN maintaining code THEN the system SHALL keep individual component files focused and under 300 lines each
Loading