Timeline structure
The timeline is organized hierarchically:Track types
OpenCut supports four track types:Video tracks
Hold video and image elements. Support muting and visibility toggling.
Audio tracks
Hold audio elements. Support muting.
Text tracks
Hold text overlay elements. Support visibility toggling.
Sticker tracks
Hold sticker elements. Support visibility toggling.
Track interface
apps/web/src/types/timeline.ts
Timeline elements
All timeline elements share a common base structure:apps/web/src/types/timeline.ts
The
duration field represents the visible duration on the timeline, while trimStart and trimEnd control which portion of the source media is shown.TimelineManager API
The TimelineManager provides methods for all timeline operations:Managing tracks
Managing elements
Editing operations
Batch updates
Update multiple elements efficiently:Preview system
The TimelineManager includes a preview system for temporary changes:Implementation example
Here’s how the TimelineManager implements splitting:apps/web/src/lib/commands/timeline/element/split-elements.ts
Clipboard operations
Copy and paste elements between tracks:Getting timeline data
Related concepts
- EditorCore - Understanding the singleton architecture
- Scenes - Timeline data is stored per scene
- Commands - All timeline operations use commands for undo/redo
- Actions - User-triggered timeline operations