How lo-kith/captionflow works
CaptionFlow is a browser-based video subtitling product. Its primary workflow is upload and validation, audio extraction and Whisper transcription, interactive subtitle editing and preview, then subtitle-file or burned-video export. The graph includes the editor’s state and interaction layer as well as the documented processing and export stages. Some implementation files were not excerpted; relationships for those parts are included only where the README or source index supports them.
Main entry points: page.tsx Editor workspace · editorStore.ts Editor state · ExportDialog.tsx Export options · UploadZone.tsx Upload zone
Components 24
Video processing
- Upload zone
components/upload/UploadZone.tsx - Upload validation
app/api/upload/route.ts - Video metadata
lib/ffmpeg/getMetadata.ts - Transcription route
app/api/transcribe/route.ts - Audio extraction
lib/ffmpeg/extractAudio.ts - Whisper provider
lib/transcription/whisper.ts - Provider contract
lib/transcription/service.ts
Subtitle editor
- Editor workspace
app/editor/page.tsx - Video preview
components/video/VideoPlayer.tsx - Subtitle editor
components/editor/SubtitleEditor.tsx - Subtitle timeline
components/editor/Timeline.tsx - Timeline controls
components/editor/TimelineControls.tsx - Caption styling
components/editor/StylePanel.tsx - Keyboard shortcuts
hooks/useKeyboardShortcuts.ts - Editor state
store/editorStore.ts
Export pipeline
- Export options
components/export/ExportDialog.tsx - SRT formatter
lib/subtitles/srt.ts - VTT formatter
lib/subtitles/vtt.ts - Video export route
app/api/export/route.ts - Subtitle burn-in
lib/ffmpeg/burnSubtitles.ts - Video download
app/api/download/[id]/route.ts
Shared runtime
- Subtitle operations
lib/subtitles/utils.ts - Temporary files
lib/utils/tempFiles.ts
Other components
- Video editor
Connections 33
- Video editor → Upload zone: selects video
README.md - Upload zone → Upload validation: uploads video
components/upload/UploadZone.tsx - Upload validation → Video metadata: reads metadata
app/api/upload/route.ts - Upload validation → Temporary files: stores upload
app/api/upload/route.ts - Upload zone → Transcription route: requests transcription
components/upload/UploadZone.tsx - Transcription route → Audio extraction: extracts audio
app/api/transcribe/route.ts - Transcription route → Whisper provider: transcribes audio
app/api/transcribe/route.ts - Whisper provider → Provider contract: implements
README.md - Transcription route → Temporary files: manages audio files
app/api/transcribe/route.ts - Upload zone → Editor workspace: opens editor
README.md - Editor workspace → Video preview: renders
app/editor/page.tsx - Editor workspace → Subtitle editor: renders
app/editor/page.tsx - Editor workspace → Subtitle timeline: renders
app/editor/page.tsx - Editor workspace → Timeline controls: renders
app/editor/page.tsx - Editor workspace → Caption styling: renders
app/editor/page.tsx - Editor workspace → Export options: opens
app/editor/page.tsx - Editor workspace → Keyboard shortcuts: registers
app/editor/page.tsx - Video preview → Editor state: reads and updates
components/video/VideoPlayer.tsx - Subtitle editor → Editor state: edits state
app/editor/page.tsx - Subtitle timeline → Editor state: edits state
components/editor/Timeline.tsx - Timeline controls → Editor state: controls playback
- Caption styling → Editor state: updates style
components/editor/StylePanel.tsx - Keyboard shortcuts → Editor state: dispatches actions
hooks/useKeyboardShortcuts.ts - Editor state → Subtitle operations: uses operations
store/editorStore.ts - Export options → Editor state: reads export state
components/export/ExportDialog.tsx - Export options → SRT formatter: generates SRT
components/export/ExportDialog.tsx - Export options → VTT formatter: generates VTT
components/export/ExportDialog.tsx - Export options → Video export route: requests video export
components/export/ExportDialog.tsx - Video export route → Subtitle burn-in: renders captions
app/api/export/route.ts - Video export route → Temporary files: manages export files
app/api/export/route.ts - Subtitle burn-in → SRT formatter: formats subtitles
lib/ffmpeg/burnSubtitles.ts - Video export route → Video download: returns output path
- Video editor → Video download: downloads video
README.md