VideoFlowcodeGitHubStudioTry itCoreRenderersReact Video EditorPlaygroundExamplesDocscodeGitHubStudioTry it
Getting started
InstallationQuick startCore conceptsYour first video
Builder
Builder APITime formatsParallel & wait
Layers
TextImageVideoAudioCaptionsShapeGroups
Animation
Animate & keyframesEasing functionsTransitionsEffects
Renderers
Browser rendererServer rendererDOM preview
React Video Editor
QuickstartThemingUploadsCustom panelsHooks & commandsKeyboard shortcuts
API reference
Overview@videoflow/core@videoflow/renderer-browser@videoflow/renderer-server@videoflow/renderer-dom@videoflow/react-video-editor

Video layers

Add a video clip to the timeline. VideoFlow reads its duration (if autoDetectDurations is on), decodes frames on demand, and lets you trim, offset, and animate transforms over it.

const $ = new VideoFlow({ width: 512, height: 512, fps: 30, backgroundColor: '#000' });

const clip = $.addVideo(
  { fit: 'cover' },
  { source: 'https://videoflow.dev/samples/sample.mp4' },
);
$.wait('4s');
clip.remove();
return $;
Compiling00:00
const clip = $.addVideo(
  { fit: 'cover', volume: 0.8, mute: false },
  {
    source: 'https://videoflow.dev/samples/sample.mp4',
    sourceStart: '2s', // skip the first 2s of the source
  },
);
clip.animate({ scale: 1 }, { scale: 1.05 }, { duration: '10s', easing: 'linear', wait: false });

// Stop the clip after 10s of timeline play instead of letting it run to its
// own end. .remove() is the preferred way to bound a media layer's duration.
$.wait('10s');
clip.remove();

Properties

PropType / defaultNotes
source (setting)stringMP4 / WebM / MOV. Must be decodable by the chosen renderer.
sourceStart (setting)Time / 0In source-media seconds.
sourceEnd (setting)Time / 0Trim from the END of the source (source seconds).
sourceDuration (setting)TimeAuto-detected from the file. Set it only when you need to clip a sub-segment.
speed (setting)number / 1Playback speed multiplier.
volume0–1 / 1Animatable.
muteboolean
fit`covercontain/contain`
position / anchor / scale / rotationAnimatable.
opacity / filterBlur / filterBrightnessAnimatable.

Source-media seconds. Animations on a video layer are keyed in source-media seconds, not timeline seconds. If you sourceStart: '5s' and then animate(from, to, { duration: '3s' }), the animation runs from source 5s → source 8s.

Decoding

Frames decode through WebCodecs, and the decoder adapts to how the layer is read. Playing forward — which is every export — decodes each packet at most once. Playing in reverse (speed below zero) decodes forward windows and serves them backwards. Scrubbing re-seeks, which is unavoidable.

This matters more than it sounds. A seek re-decodes from the preceding keyframe, so stepping through a clip one frame at a time costs O(frames × GOP): on a 1080p H.264 clip with the 250-frame GOP a stock encode produces, that is 207 ms per frame against 15.6 ms decoding the same frames in order.

Nothing to configure. A source whose codec has no WebCodecs decoder on the current platform falls back to a <video> element automatically, so unusual formats still render — just more slowly.

Re-encoding your sources with a denser GOP helps scrubbing, not export. Export is sequential and already optimal; only random access pays the keyframe-distance cost.

VideoFlow

Open-source toolkit for composing videos from code.

Product

CoreRenderersReact Video EditorPlaygroundStudio

Learn

DocsAPI referenceExamplesvs. Remotionvs. FFmpeg

Project

GitHubLicenseContactTermsPrivacy

From the blog

All posts →Building a "Canva for Video" with the @videoflow/react-video-editorAutomating Social Media Captions: A Developer's Guide to Frame-Perfect SubtitlesBeyond Node: How to Render Cinematic Videos from Python and GoBuilding a Video Rendering API with Node.js and VideoFlow (No FFmpeg Required)Mastering Programmatic Video Transitions: A Developer's GuideProgrammatic Video Storage: Why Your MP4s Should Live as Version-Controlled JSONThe Video Markdown Pattern: Turning Static Content into Automated MP4sZero-Cost Video Rendering: How to Export MP4s Directly in the Browser
© 2026 VideoFlow. Apache-2.0 core.