Recreate a Reference Video
Turn a clip you like into a Motion SDK scene. Break it into shots, block it out, then match the look.
This is how the benchmark scenes were made. Each one rebuilds a viral Three.js animation from its video alone, since none of the sources were published. It works the same for any reference.
Break the Clip Into Shots
Find the cuts. Scene detection gives exact frames, so you can turn them into durations.
ffmpeg -i reference.mp4 -vf "select='gt(scene,0.3)',showinfo" -f null - 2>&1 | grep pts_time
ffmpeg -i reference.mp4 -vf fps=1 frames/%03d.pngWrite down each shot's framing and movement, the frame rate, the aspect ratio, and whether the clip loops.
Set Up the Canvas, Timeline and Shots
Match the frame rate and aspect first. Then add one shot per cut. Shot durations must add up to the timeline duration, and each cut should land on a whole frame. The validator checks both, with shots_length and cut_between_frames.
{
"canvas": { "width": 1920, "height": 1080, "fps": 24 },
"timeline": { "duration": 8 },
"shots": [
{ "duration": 4, "camera": { "position": [30, 25, 30], "target": [0, 0, 0] }, "to": { "position": [24, 18, 26] } },
{ "duration": 4, "camera": { "position": [0, 1.6, 12], "target": [0, 1, 0], "fov": 35 } }
],
"exports": { "x": { "preset": "x_16x9" } }
}Block Out the Scene
Put down big shapes before any detail. Use prefabs and repeat for anything that appears more than once, like buildings, lamps or cars. A city block of 18 buildings is one node with repeat.each.
Render stills at each shot's midpoint and put them next to the reference frames.
motion-sdk render scene.json -t 2 -o blockout-1.png
motion-sdk render scene.json -t 6 -o blockout-2.pngMatch the Look
Work from big to small. Sky and fog set the mood. Then lighting and shadows, then materials, then post.
Three.js artifacts often have a washed-out look. Set post.color_management to legacy and post.tone_mapping to none to match it.
Add Motion
Use paths and signals for traffic and crowds, timeline tracks for one-off moves, and particles for smoke, snow and sparks. Give expressions a rand(k) seed so every render is the same.
Validate, Export and Compare
motion-sdk validate scene.json --final
motion-sdk render scene.json --export x
ffmpeg -i reference.mp4 -i scene-x.mp4 -filter_complex hstack side-by-side.mp4Look at the side-by-side, write down what's still off, and loop back to the step that owns it.
Tips
- Keep the scene hand-written and small. The benchmark scenes are 146 to 402 lines. An earlier generated version of the city block was 4,551 lines and rendered slower.
- Prefer presets and expressions over long keyframe lists. They cost fewer tokens and leave less to get wrong.
- Write down what you can't match, and why. Every benchmark has a "where it falls short" list. That's how engine gaps get found.
- The recreate-a-reference skill gives an agent this whole loop.