Screen recordings of a product stutter, blur on fast moves and change every time someone re-records them. A launch film built in code does not, but only if one rule holds: the picture at frame i depends on t = i / fps and nothing else.
1. No state carried between frames
Most animation code integrates physics step by step, so frame 731 needs frame 730. That breaks parallel rendering and makes a scrubbed preview differ from the final render. A damped spring has a closed-form solution, so it can be evaluated at any time directly:
def spring(t, stiffness=240.0, damping=22.0, mass=1.0):
"""Closed-form damped spring from 0 to 1. Depends only on t, never on the previous frame."""
if t <= 0.0:
return 0.0
w0 = math.sqrt(stiffness / mass)
zeta = damping / (2.0 * math.sqrt(stiffness * mass))
if zeta < 1.0: # under-damped: a small settle
wd = w0 * math.sqrt(1.0 - zeta * zeta)
env = math.exp(-zeta * w0 * t)
return 1.0 - env * (math.cos(wd * t) + (zeta * w0 / wd) * math.sin(wd * t))
env = math.exp(-w0 * t) # critically damped
return 1.0 - env * (1.0 + w0 * t)
def render_frame(i, fps=60):
t = i / fps # the only input
x = lerp(-420, 0, spring(t - 0.40))
...The same rule in Remotion: read the frame, divide by fps, and drive every value from that one clock.
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const t = frame / fps; // same clock as the Python renderer
const prog = clamp01(deterministicSpring(t - (startSec + idx * staggerSec), {
stiffness: 240,
damping: 23,
}));
// translateY((1 - prog) * 42px): line slides up and settles, frame-exact2. Render in chunks, in parallel
Because no frame depends on another, the timeline can be split into contiguous chunks. Each worker renders and encodes its own segment, and ffmpeg joins them without re-encoding.
total = int(round(duration_s * fps)) # 20 s x 60 = 1,200 frames
per = total // workers
tasks = [(start, min(total, start + per)) for start in range(0, total, per)]
with mp.Pool(len(tasks)) as pool: # each worker encodes its own segment
segments = pool.map(render_segment, tasks)
# join without re-encoding, then add the mastered audio
# ffmpeg -f concat -safe 0 -i concat.txt -i master.wav \
# -map 0:v -map 1:a -c:v copy -c:a aac -b:a 256k -shortest -movflags +faststart reel.mp4The QFXLAB launch reel is 1,200 frames at 1920×1080 and 60 fps. On a 12-core machine it renders in 15.3 seconds, about 78 frames a second.
3. Put sound on the same clock
Cuts and sound cues share one grid. At 120 BPM a beat is 0.5 s, which is exactly 30 frames at 60 fps, so a whoosh scheduled for beat 7 lands on frame 210 every time. The reel places 23 cues this way, then masters the mix (see two-pass loudnorm).