Skip to main content
The timeline system in OpenCut provides multi-track editing capabilities through the TimelineManager. It manages tracks, elements, and all timeline operations.

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:
Use the preview system for drag operations or real-time adjustments. It saves the original state and allows you to commit or discard 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

  • 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