Create a React + TypeScript text-based video editor web application with the following specifications:
- React 18+ with javaScript
- Vite for build tooling
- Shadcn/ui components
- Tailwind CSS for styling
- FFmpeg.wasm for video processing
- @huggingface/transformers (Whisper) for transcription
- Zustand for state management
- Lucide React for icons
src/ ├── components/ │ ├── ui/ # Shadcn components │ ├── VideoUploader.jsx # Drag & drop video upload │ ├── VideoPlayer.jsx # Video player with controls │ ├── TranscriptEditor.jsx # Editable transcript with word sync │ ├── Timeline.jsx # Visual timeline representation │ ├── ExportPanel.jsx # Export settings and progress │ └── Header.jsx # App header with actions ├── lib/ │ ├── ffmpeg.js # FFmpeg.wasm utilities │ ├── transcription.js # Whisper transcription logic │ ├── video-processor.js # Video editing operations │ └── utils.js # Helper functions ├── # ├── types/ │ └── index.ts # TypeScript interfaces └── App.jsx
- Drag-and-drop area with file input fallback
- Accept common video formats (MP4, MOV, WebM, AVI)
- Show file size and duration
- Display video preview thumbnail
- Loading state during upload
_ use Video.js
- Play/pause, seek, volume controls
- Playback speed adjustment (0.5x, 1x, 1.5x, 2x)
- Current time / total duration display
- Keyboard shortcuts (Space = play/pause, Arrow keys = seek)
- Click on timeline to jump to timestamp
- Auto-generate transcript using Whisper (Transformers.js)
- Display transcript with word-level timestamps
- Each word is clickable:
- Click word → jump to that moment in video
- Click word → highlight it as selected
- Editable text (contentEditable or textarea)
- Delete text → mark that segment for removal from video
- Word highlighting syncs with video playback (current word highlighted)
- Show confidence scores (low confidence = different color)
- Language detection and display
- Manual language selector dropdown
- Search within transcript
- Undo/redo for text edits
- Visual representation of video segments
- Show kept vs. deleted segments (different colors)
- Segments created from transcript edits
- Draggable playhead
- Zoom in/out controls
- Minimap for long videos
- Extract audio from video
- Apply cuts based on transcript deletions
- Process in Web Worker (non-blocking)
- Show real-time progress bar
- Concatenate remaining segments
- Maintain audio-video sync
- Export settings:
- Format selection (MP4, WebM)
- Quality presets (High, Medium, Low)
- Resolution options (Original, 1080p, 720p)
- Export button with loading state
- Progress indicator (percentage, time remaining)
- Download button when complete
- Option to export transcript as SRT/VTT subtitle file
- Keyboard shortcuts panel (? key to toggle)
- Clear project / Reset button
- Dark mode support
- Responsive design (desktop-first, mobile-friendly)
- Error handling with toast notifications
┌─────────────────────────────────────────────────┐
│ Header (Logo, Export Button, Settings) │
├──────────────────┬──────────────────────────────┤
│ │ │
│ Transcript │ Video Player │
│ Editor │ │
│ (Scrollable) │ ┌────────────────────┐ │
│ │ │ │ │
│ [Editable │ │ Video Preview │ │
│ Text with │ │ │ │
│ timestamps] │ └────────────────────┘ │
│ │ │
│ Search: [___] │ [Controls:
- Button
- Card
- Dialog
- Dropdown Menu
- Input
- Label
- Progress
- Scroll Area
- Select
- Separator
- Slider
- Tabs
- Textarea
- Toast
- Tooltip
- Use Tailwind utility classes
- Shadcn default theme (customize if needed)
- Consistent spacing (4, 8, 16, 24px)
- Smooth transitions (transition-all duration-200)
- Focus states for accessibility
- Hover effects on interactive elements
- Loading skeletons for async operations
- Load FFmpeg once on app mount
- Use Web Worker for processing
- Show progress updates every 100ms
- Handle memory efficiently (clean up after processing)
- Use "Xenova/whisper-small" model initially
- Allow model selection (small, medium, large)
- Process audio in chunks for long videos
- Cache model after first load
- Show transcription progress
- Convert deleted text segments to time ranges
- Merge adjacent deleted segments
- Generate FFmpeg filter_complex command
- Example: Keep 0-10s, 15-30s, 35-end
- Virtualize transcript list for long transcripts
- Debounce transcript edits
- Lazy load FFmpeg.wasm
- Use React.memo for heavy components
- Implement request animation frame for playhead updates
- File type validation
- File size limits (warn if >500MB)
- Browser compatibility checks (WebAssembly, Web Workers)
- FFmpeg errors with user-friendly messages
- Transcription failures with retry option
- Network errors (if using external APIs)
- ARIA labels on all interactive elements
- Keyboard navigation support
- Focus management (modals, dialogs)
- Screen reader friendly
- High contrast mode support
- Alt text for icons
npm create vite@latest video-editor -- --template react-ts cd video-editor npm install npx shadcn-ui@latest init npx shadcn-ui@latest add button card dialog input progress select slider tabs toast npm install @ffmpeg/ffmpeg @ffmpeg/util npm install @huggingface/transformers
npm install lucide-react npm install clsx tailwind-merge
- Basic video upload and playback
- Transcription generation
- Transcript display with word sync
- Text editing → video segment deletion
- Timeline visualization
- Video export with FFmpeg
- Polish UI/UX
- Add keyboard shortcuts
- Performance optimizations
- Error handling and edge cases
- User can upload a video
- Transcript generates automatically
- Clicking words jumps to video timestamp
- Deleting text removes video segments
- Export produces correct trimmed video
- UI is responsive and intuitive
- Processing happens without page freezes
- Works offline after initial model load
Please implement this application following React best practices, with clean component separation, proper TypeScript typing, and a focus on user experience.