Skip to content

Transitions ​

A transition blends one clip into the next: a crossfade, a dip to black, a wipe, an iris. This page shows how to put one between two clips, which types there are, how to bring a single element in or out, and how to play a flash, a light leak or a whoosh over a cut without changing it.

See it in: An edit (a wipe and a slide), Effects and transitions (every transition playing).

Write a <Transition> between the two clips it joins on a sequence track:

tsx
<Clip id="hook" src="asset:founder" in="word:12" out="word:23.end" />
<Transition id="x1" type="crossfade" duration={0.4} />
<Clip id="broll" src="asset:product" in="shot:1" out="shot:1.end" />

Between two clips ​

The two clips overlap by the transition's duration, so both need that much extra footage at the join.

PropDoes
typeWhich transition: a built-in one, or one you declared.
durationSeconds it takes, which is also how much the clips overlap.
paramsThe type's own settings.

Choose a type ​

Each type's page shows it playing and lists its params.

TypeDoesParams
crossfadeFades one clip into the next.curve
dipToBlackFades out to black, then in to the next clip.holdDuration
dipToWhiteFades out to white, then in to the next clip.holdDuration
wipeWipes the next clip over the first, edge first.direction
slideSlides the next clip in over the first.direction, pushOut
pushPushes the first clip out as the next comes in.direction

Six more are drawn as shaders:

TypeDoesParams
irisOpens the next clip through a growing circle, polygon or star.sides, star, rotation, center, feather
clockWipeSweeps the next clip in around a centre, like a clock hand.startAngle, direction, center, softness
blindsOpens the next clip through turning slats.slats, angle, softness
filmBurnBurns through the film into the next clip.seed, center, size, edge, color
pixelDissolveDissolves into the next clip square by square.columns, rows, seed, softness
zoomZooms through the first clip into the next, with a blur.center, scale, blur

Params go in params:

tsx
<Transition id="x2" type="iris" duration={0.8} params={{ sides: 5, star: 0.45, feather: 4 }} />
Where the shader transitions fall back

The shader transitions need WebGL, which the player and the export have; where it is missing they play as a crossfade. At the edge of a title or another overlay they play as a fade.

At one edge of an element ​

A transition can also bring one element in or take it out, with nothing on the other side. Give it on, the id of the element, and edge, "in" or "out". It plays at that edge, against whatever is beneath the element.

tsx
<Track id="over" layout="free">
  <Clip id="pip" src="asset:product" in="shot:1" out="shot:1.end" start={{ at: "hook", offset: 1 }} />
  <Transition id="pip-in" on="pip" edge="in" type="wipe" duration={0.6} />
  <Transition id="pip-out" on="pip" edge="out" type="crossfade" duration={0.6} />
</Track>
Between two clipsAt one edge
WrittenBetween the clips, on a sequence trackAnywhere in the track, with on and edge
Plays againstThe other clipThe tracks below, or the background
Extra footageBoth clips, by durationNone: it plays inside the element's own time

Use it on a free track, where nothing sits next to the element to blend with, or on a sequence track to open on the first clip or close on the last. on and edge always go together.

Make your own ​

Any other look is a few lines of GLSL that you declare with transition() (Effects and transitions of your own). A type that is neither built in nor declared is an error.

Over a cut: light leaks, flashes and whooshes ​

Something that plays over a cut, without moving the cut, goes on a free track and anchors to the clip that comes in. A negative offset starts it before the cut. Here a warm flare peaks as the founder cuts to the product shot:

tsx
import { Clip, Composition, Motion, Track } from "@cutcraft/kit";

// A warm flare over the cut from the founder to the product shot. It sits on a free track, anchored to the clip that
// comes in, starting 0.4 s before it: the cut does not move and the video stays as long as its clips. Trim "talk"
// and the flare follows the cut.
export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        <Clip id="talk" src="asset:founder" in="word:0" out="word:5.end" fit="cover" />
        <Clip id="product" src="asset:product" in={0} out={2.5} fit="cover" />
      </Track>
      <Track id="fx" layout="free">
        <Motion
          id="flare"
          anchor="product"
          offset={-0.4}
          duration={0.8}
          sequence={[[".flare", { opacity: [0, 0.7, 0] }, { duration: 0.8, ease: "easeInOut" }]]}
        >
          <div
            className="flare"
            style={{
              position: "absolute",
              inset: 0,
              background:
                "radial-gradient(circle at 78% 25%, rgba(255, 210, 140, 0.95), rgba(255, 130, 60, 0.35) 30%, transparent 55%)",
            }}
          />
        </Motion>
      </Track>
    </Composition>
  );
}

Trim talk and the cut moves, and the flare moves with it. Nothing is added to the main track, so the video stays as long as its clips.

The flare here is a <Motion> layer. It can as well be:

  • footage: a light-leak or flash clip, usually with blend="screen" or blend="add";
  • any <Layer> of free code;
  • a clip with an effect you declared.

Sound effects at a cut ​

A sound effect is an <Audio> element, and anchors the same way:

tsx
<Track id="sfx" layout="free" role="effects">
  <Audio id="whoosh" src="asset:whoosh" anchor="product" offset={-0.2} />
</Track>

A sound can also anchor to a transition, and then starts when the transition does:

tsx
<Transition id="x1" type="crossfade" duration={0.4} />
<Audio id="swish" src="asset:swish" anchor="x1" />

A track with role="effects" keeps sound effects apart from dialogue and music in the mix (Track roles).

Next ​

MIT licensed.