vidmake v0.2.1
Download

Docs/CompositionsPage 09 / 45

Series and transitions

Play scenes back to back with a series group, and overlap them with fade, slide, wipe, zoom and blur transitions. vidmake computes every start time and the total length.

View .md Ask Claude Ask ChatGPT

A group with "series": true plays its children one after another, like Remotion's <Series> and <TransitionSeries>. You give each scene a duration; vidmake works out when each one starts, overlaps neighbors that have a transition, and sums up the total. Reorder, lengthen or remove a scene and everything after it moves.

00:00.0 · f 000
A series of five scenes: each scene's transition plays as it hands over to the nextDownload

#A basic series

json
{ "id": "show", "type": "group", "series": true, "children": [  { "id": "intro", "type": "group", "duration": "3s", "children": [] },  { "id": "demo", "type": "video", "src": "assets/clip.mp4", "muted": true },  { "id": "outro", "type": "group", "duration": "2s", "children": [] }] }

intro plays from 0 to 3 s, the 6-second demo clip from 3 to 9 s, and outro from 9 to 11 s. The series group lasts 11 seconds, and with the default "duration": "auto" so does the composition.

Each child is usually a group holding one scene's layers. Inside it, everything is timed relative to the scene's start (local time), so a scene can be written, checked and moved on its own.

#Every child needs a fixed length

A series can't place a child without knowing how long it is. Each child needs one of:

  • an explicit duration (or end),
  • media: a video or audio layer's own length, unless it loops,
  • a use layer: the referenced composition's length,
  • a nested series group: its own total,
  • a captions layer: the end of its last caption.

A child without one is an error that names it:

output
✗ main: layer `show` (main > layers[0]): layer `b` is inside a series group and needs a `duration`

#Transitions

Add transition to a child to overlap it with the next child. The transition plays during the overlap: the outgoing scene animates out while the incoming one animates in.

json
{ "id": "a", "type": "group", "duration": "3s", "transition": "fade", "children": [] }{ "id": "a", "type": "group", "duration": "3s", "transition": { "type": "slideLeft", "duration": "0.8s" }, "children": [] }

A transition is a name, or an object with type, duration (default 0.5s) and ease (default easeInOutCubic, any easing). motion sets both at once from a motion, built in or from your theme: { "type": "slideLeft", "motion": "gentle" } is a 1.2 s spring with no bounce. duration and ease override the motion's. Wipes also take feather and edge, below.

transitionoutgoing sceneincoming scene
fade (alias crossfade)fades outfades in
slideLeft, slideRight, slideUp, slideDownpushed out in that direction by the full width or heightpushed in from the opposite side
wipeLeft, wipeRight, wipeUp, wipeDownstays in place underneathrevealed by an edge moving in that direction
zoomfades outscales down from 1.2× to 1× while fading in
blurblurs and fades outun-blurs and fades in
none (alias cut)no overlap: a hard cut, the same as no transition

Later children are drawn above earlier ones, so the incoming scene is on top during the overlap.

#Wipe edges and feathering

A plain wipe is a hard, moving line. Two options dress it up:

  • edge draws a band of color riding the edge of the incoming scene: "edge": "#c92a26" or { "color": "#c92a26", "width": 16 } (px, default 12). A brand color here makes a scene change feel designed.
  • feather softens the edge into a ramp that many px wide, so the incoming scene fades in along the line.
00:00.0 · f 000
Wipe transitions: an edge band of color, then a feathered edgeDownload
series-wipe-edge.jsonjson
{  "fonts": [{ "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }],  "compositions": [{    "id": "edges", "description": "Wipe transitions: an edge band of color, then a feathered edge",    "width": 1280, "height": 720, "fps": 30, "duration": "auto",    "layers": [      { "id": "show", "type": "group", "series": true, "children": [        { "id": "one", "type": "group", "duration": "1.4s",          "transition": { "type": "wipeUp", "duration": "0.6s", "edge": { "color": "#c92a26", "width": 16 } },          "children": [            { "id": "one-bg", "type": "rect", "fill": "#f4f1ea" },            { "id": "one-t", "type": "text", "text": "wipe transitions", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 80, "letterSpacing": -3.5, "fill": "#161412" } ] },        { "id": "two", "type": "group", "duration": "1.6s",          "transition": { "type": "wipeLeft", "duration": "0.8s", "feather": 260, "ease": "easeInOutQuart", "edge": { "color": "#c92a26", "width": 6 } },          "children": [            { "id": "two-bg", "type": "rect", "fill": "#161412" },            { "id": "two-t", "type": "text", "text": "edge: a band of color", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 80, "letterSpacing": -3.5, "fill": "#f4f1ea" } ] },        { "id": "three", "type": "group", "duration": "1.4s", "children": [          { "id": "three-bg", "type": "rect", "fill": "#e9e4d8" },          { "id": "three-t", "type": "text", "text": "feather: a soft edge", "font": "Schibsted Grotesk", "fontWeight": 860, "fontSize": 80, "letterSpacing": -3.5, "fill": "#161412" } ] }      ] }    ]  }]}
json
"transition": { "type": "wipeUp", "duration": "0.6s", "edge": { "color": "#c92a26", "width": 16 } }"transition": { "type": "wipeLeft", "duration": "0.8s", "ease": "easeInOutQuart", "feather": 260, "edge": { "color": "#c92a26", "width": 6 } }

Both also work on a wipe* preset of any layer.

Note

With fade, both scenes are partly transparent at the midpoint, so whatever is behind the series (the composition background) shows through briefly. Give the composition a background close to your scenes' colors, or use wipe or slide for a transition with no dip.

#Transitions and presets

A transition works by giving the outgoing child an exit and the incoming child an enter for the length of the overlap. It only does so when the child doesn't already have its own: an explicit exit on the outgoing child or enter on the incoming one wins. timeline and inspect show the generated presets as exit:transition and enter:transition.

A transition on the last child has nothing to hand over to and is ignored.

#How start times are computed

vidmake walks the children in order with a cursor that starts at 0:

  1. A child starts at cursor + start (its own start, default 0, is an offset).
  2. The cursor moves to that child's end.
  3. If the child has a transition, the cursor steps back by the overlap, which is the transition's duration, capped at the child's own duration.

So the series length is the sum of the durations, plus any gaps, minus the overlaps. For the demo at the top of the page, five 1.4-second scenes with transitions of 0.5, 0.5, 0.6 and 0.5 seconds:

output
5 × 1.4s − (0.5s + 0.5s + 0.6s + 0.5s) = 7.0s − 2.1s = 4.9s
vidmake timeline series-transitions.json
$ vidmake timeline series-transitions.json
Composition `transitions` — 1280x720 @ 30fps, 147 frames (4.90s)

ID       TYPE         START      END      DUR  DETAILS
show     group        0.00s    4.90s    4.90s  "5 children"
  s1     group        0.00s    1.40s    1.40s  exit:transition "3 children"
    bg1  rect         0.00s    1.40s    1.40s  
    t1   text         0.00s    1.40s    1.40s  "fade"
    c1   text         0.00s    1.40s    1.40s  ""transition": "fade""
  s2     group        0.90s    2.30s    1.40s  enter:transition exit:transition "3 children"
    bg2  rect         0.90s    2.30s    1.40s  
    t2   text         0.90s    2.30s    1.40s  "slideLeft"
    c2   text         0.90s    2.30s    1.40s  ""transition": "slideLeft""
  s3     group        1.80s    3.20s    1.40s  enter:transition "3 children"
    bg3  rect         1.80s    3.20s    1.40s  
    t3   text         1.80s    3.20s    1.40s  "wipeRight"
    c3   text         1.80s    3.20s    1.40s  ""transition": "wipeRight""
  s4     group        2.60s    4.00s    1.40s  enter:transition exit:transition "3 children"
    bg4  rect         2.60s    4.00s    1.40s  
    t4   text         2.60s    4.00s    1.40s  "zoom"
    c4   text         2.60s    4.00s    1.40s  ""transition": "zoom""
  s5     group        3.50s    4.90s    1.40s  enter:transition "2 children"
    bg5  rect         3.50s    4.90s    1.40s  
    t5   text         3.50s    4.90s    1.40s  "the end"

         |0s          1s          2s          3s          4s          |
show     |████████████████████████████████████████████████████████████|
  s1     |██████████████████··········································|
    bg1  |██████████████████··········································|
    t1   |██████████████████··········································|
    c1   |██████████████████··········································|
  s2     |···········██████████████████·······························|
    bg2  |···········██████████████████·······························|
    t2   |···········██████████████████·······························|
    c2   |···········██████████████████·······························|
  s3     |······················██████████████████····················|
    bg3  |······················██████████████████····················|
    t3   |······················██████████████████····················|
    c3   |······················██████████████████····················|
  s4     |·······························██████████████████···········|
    bg4  |·······························██████████████████···········|
    t4   |·······························██████████████████···········|
    c4   |·······························██████████████████···········|
  s5     |··········································██████████████████|
    bg5  |··········································██████████████████|
    t5   |··········································██████████████████|

The bars show each scene starting before the previous one ends. Scrub through the overlaps here:

Tip

Use vidmake storyboard project.json --at with times inside each overlap (for example the midpoint of each transition) to see the transitions themselves; evenly spaced frames tend to land between them.

#Gaps

A child's start adds a gap before it. The composition background, or whatever is behind the series, shows during the gap. Here each chapter title fades out, and the next one comes in after half a second of empty paper:

00:00.0 · f 000
A child's start in a series is a gap after the previous child: a beat of empty paper between chaptersDownload
series-gap.jsonjson
{  "fonts": [{ "family": "Schibsted Grotesk", "path": "fonts/SchibstedGrotesk.ttf" }],  "compositions": [{    "id": "chapters", "description": "A child's start in a series is a gap after the previous child: a beat of empty paper between chapters",    "width": 1280, "height": 720, "fps": 30, "background": "#f4f1ea",    "layers": [      { "id": "chapters", "type": "group", "series": true, "children": [        { "id": "one", "type": "text", "text": "Chapter one", "duration": "1.5s", "font": "Schibsted Grotesk", "fontWeight": 860,          "fontSize": 110, "letterSpacing": -5, "fill": "#161412", "enter": "fadeUp", "exit": "fade" },        { "id": "two", "type": "text", "text": "Chapter two", "start": "0.5s", "duration": "1.5s", "font": "Schibsted Grotesk",          "fontWeight": 860, "fontSize": 110, "letterSpacing": -5, "fill": "#161412", "enter": "fadeUp", "exit": "fade" },        { "id": "three", "type": "text", "text": "Chapter three", "start": "0.5s", "duration": "1.5s", "font": "Schibsted Grotesk",          "fontWeight": 860, "fontSize": 110, "letterSpacing": -5, "fill": "#161412", "enter": "fadeUp", "exit": "fade" }      ] },      { "id": "progress", "type": "rect", "anchor": "left", "x": 0, "y": 716, "height": 8, "fill": "#c92a26",        "width": "=pw * p" }    ]  }]}
json
{ "id": "two", "type": "text", "text": "Chapter two", "start": "0.5s", "duration": "1.5s", "enter": "fadeUp", "exit": "fade" }
vidmake timeline series-gap.json
$ vidmake timeline series-gap.json
Composition `chapters` — 1280x720 @ 30fps, 165 frames (5.50s)

ID        TYPE         START      END      DUR  DETAILS
chapters  group        0.00s    5.50s    5.50s  "3 children"
  one     text         0.00s    1.50s    1.50s  enter:fadeUp exit:fade "Chapter one"
  two     text         2.00s    3.50s    1.50s  enter:fadeUp exit:fade "Chapter two"
  three   text         4.00s    5.50s    1.50s  enter:fadeUp exit:fade "Chapter three"
progress  rect         0.00s    5.50s    5.50s  

          |0s        1s         2s         3s         4s         5s    |
chapters  |████████████████████████████████████████████████████████████|
  one     |█████████████████···········································|
  two     |·····················██████████████████·····················|
  three   |···········································█████████████████|
progress  |████████████████████████████████████████████████████████████|

Three 1.5-second chapters and two 0.5-second gaps make 5.5 seconds.

Warning

A gap after a transition cancels the overlap. If scene A has "transition": "fade" and scene B has "start": "1s", B starts 0.5 s after A ends: A fades out, the screen is empty, then B fades in. Use either a transition or a gap between two scenes, not both.

A negative start overlaps a child with the previous one without any transition: "start": "-0.5s" makes it begin half a second before the previous child ends, drawn on top.

#The series group itself

A series group is an ordinary group in every other way:

  • start on the series group offsets the whole sequence; a series can begin at 2 s, after an intro.
  • Its duration defaults to the computed total. Setting a shorter duration cuts the end off.
  • x, y, width, height, scale, opacity, effects, enter and exit apply to the whole sequence. A series inside a 960×540 group plays as a picture-in-picture.
  • Only its direct children are sequenced. A child can itself be a series group, which counts as one scene.

Layers next to the series group in the composition (a logo, music, a progress bar) run on the composition's clock as usual, so they stay on screen across scene changes. The progress bar in the gap demo above is such a layer.

#A complete example

scenes.jsonjson
{  "id": "main", "width": 1280, "height": 720, "background": "#f4f1ea",  "layers": [    { "id": "scenes", "type": "group", "series": true, "children": [      { "id": "title", "type": "group", "duration": "2.5s", "transition": { "type": "wipeLeft", "duration": "0.6s" },        "children": [          { "id": "titleBg", "type": "rect", "fill": "#e9e4d8" },          { "id": "titleText", "type": "text", "text": "Q3 in review", "fontSize": 96, "fill": "#161412", "enter": "fadeUp" }        ] },      { "id": "clip", "type": "video", "src": "assets/clip.mp4", "trimStart": "1s", "duration": "3s",        "width": "100%", "height": "100%", "muted": true, "transition": "fade" },      { "id": "end", "type": "group", "duration": "2s", "children": [          { "id": "endBg", "type": "rect", "fill": "#e9e4d8" },          { "id": "endText", "type": "text", "text": "Thanks", "fontSize": 96, "fill": "#c92a26" }        ] }    ] },    { "id": "music", "type": "audio", "src": "assets/music.mp3", "fadeOut": "1s" }  ]}

The scenes last 2.5 + 3 + 2 − 0.6 − 0.5 = 6.4 seconds. The music is 12 seconds long and also has a fixed length, so set "duration": "6.4s" on the composition (or "duration" on the audio layer) if the video should end with the last scene.

#Next steps