Media — Image & Video
ONDA draws raster media as first-class scene nodes — composite, grade, blur, matte, and animate them like any other layer. The author layer never decodes: it places a node and resolves a time, and the renderer (or the player) decodes the pixels.
<Image>
Section titled “<Image>”import { Image } from 'onda-engine/react'
<Image src="/plate.jpg" width={1280} height={720} fit="cover" blur={0} />src— path, URL, ordata:URI.width/height— target box in px. The renderer measures the decoded image and fits it into the box perfit, so you don’t pass the intrinsic size. Omit both for the image’s native pixels.fit—'cover'(default),'contain', or'fill'.blur— Gaussian blur (sigma, in source px) applied by the image pass. Animateblurfrom high →0for a soft-focus entrance. Identical on every backend.
The engine right-sizes the decoded image to its display box, so large source files don’t blow the GPU texture budget.
<Video>
Section titled “<Video>”A video clip on the timeline. At composition frame f it shows the source frame at startFrom + (f / fps) × playbackRate seconds; the renderer draws that frame like an image.
import { Video, Sequence } from 'onda-engine/react'
<Sequence from={0} durationInFrames={120}> <Video src="/clip.mp4" startFrom={2} // trim 2s into the source playbackRate={1} // 1 = realtime, 2 = 2× fast, 0.5 = slow-mo endAt={6} // stop at 6s loop // repeat the [startFrom, endAt) span width={1920} height={1080} fit="cover" /></Sequence>startFrom— seconds into the source shown at the clip’s frame 0 (trim head). Default0.playbackRate— source seconds advanced per composition second. Default1.endAt— seconds into the source to stop at (trim tail); past it the clip holds its last frame unlessloopis set.loop— loop the trimmed[startFrom, endAt)span (requiresendAt).width/height/fit— as for<Image>.previewFallback— preview-only behaviour when the browser can’t composite a source (a cross-origin video without CORS):'skip'(default, blank + a one-time hint) or'element'(overlay a plain<video>so it still plays, display-only). Never affectsonda export.
How decoding works
Section titled “How decoding works”| Browser preview | Native export (onda export) | |
|---|---|---|
<Image> | decoded in-page | image crate |
<Video> | off-screen <video> / WebCodecs | ffmpeg (behind the video feature) |
See also
Section titled “See also”- Effects & finishing — grade, matte, and finish your media.
- Authoring with React — placing and animating nodes.
- Rendering & export — exporting MP4 with audio.