<Clip>
A stretch of a video or image asset, trimmed by seconds, transcript words or camera shots, with speed, fit and transform.
tsx
import { Clip, Composition, Track } from "@cutcraft/kit";
export default function Video() {
return (
<Composition fps={30} width={960} height={540}>
<Track id="main">
{/* Seconds 1 to 3 of the file, then 4 seconds of another played at double speed. */}
<Clip id="first" src="asset:spiral" in={1} out={3} fit="cover" />
<Clip id="fast" src="asset:cells" in={0} out={4} speed={2} fit="cover" />
</Track>
</Composition>
);
}Used in: Product launch · Kinetic type · Data story · An edit · Captions and key points · the walkthrough · Brand spot in any theme · Multicam highlights · Product demo with zoom-ins · Slideshow with motion · Stats with handles · Talking-head cut · Variants from one file · Vertical clip from a podcast
Props
| prop | type | default | required | description |
|---|---|---|---|---|
id | string | yes | The element's name: unique in the file, and what anchors, ducking and the editor refer to it by. | |
start | number (0..∞) | Seconds from the start of the video. Free-layout tracks only; on a sequence track the element follows the one before it. | ||
anchor | "start" | string | Overlays: start relative to another element's start, or to its end with id.end. | ||
at | string | With anchor: a word, shot or silence of the anchor's source (word:14655); the start is where the anchor plays it, plus offset. | ||
offset | number | Seconds added to the start that anchor and at give; negative starts earlier. | ||
duration | number (> 0) | "fill" | "source" | { match } | | How long it plays: seconds; "source" for the whole trimmed source; "fill" to run to the end of the composition; { match: id } for as long as another element; { until: id } to end when another element ends. | ||
src | string | yes | The media, as asset:<id> from the manifest. | |
in | number (0..∞) | string | Where in the source it starts: seconds, or a word, shot or silence of its transcript (word:12). | ||
out | number (0..∞) | string | Where in the source it ends, as in; word:40.end ends after the word is said. | ||
speed | number (0.1..20) | 1 | Playback rate: 2 plays twice as fast and half as long. | |
reverse | boolean | false | Plays the trimmed source backwards. | |
transform | Where it sits and how it is turned: position, scale, rotation, anchor, opacity, rounded corners and crop. | |||
fit | "contain" | "cover" | "stretch" | "none" | How it fills the frame: contain shows all of it, cover fills the frame and crops, stretch distorts to fill, none keeps its own size. | ||
blend | "normal" | "multiply" | "screen" | "overlay" | "darken" | … 13 more | How it mixes with what is under it, as CSS mix-blend-mode does. | ||
blendOpacity | number (0..1) | How strongly it blends: multiplied into its opacity. | ||
volume | number (0..4) | A gain: 1 plays the source as it is, 0 mutes it, 2 is twice as loud. | ||
fade | Seconds the sound fades in at the start and out at the end. | |||
automation | Volume and pan over time, as [seconds into the element, value] points; pan runs from -1 (left) to 1 (right). | |||
duck | Turns this sound down while another plays: under is a track id or a track role (dialogue), to the volume it falls to, attack and release the seconds it takes to fall and recover. | |||
frame | Reframe to the composition's aspect: the resolver writes transform.crop from the source size and this focus, unless a crop is written. |
Timed, visual, audible, trims its source, transformable. Children: effect, keyframe, mask, speedKey, freeze. All elements