I had a personal project I wanted to show off on LinkedIn — a quiz game that runs live inside a TikTok stream. Screenshots felt flat. Screen recordings felt unpolished. I wanted something short, vertical, and actually worth watching. So I decided to generate the video programmatically with Remotion.
Here's what I ended up with and what I learned.
Why Remotion
Remotion lets you write video compositions in React. You define scenes as components, control timing with frame numbers, and render everything headlessly. That means you can feed real data into your video at render time, which is exactly what I needed — the quiz data was already in a database, and I wanted stats and scenes to reflect it, not be hardcoded.
The other reason: LinkedIn's preferred vertical format is 1080×1920 (9:16). Getting that right with a screen recorder is awkward. With Remotion you just set width and height in the config and it's done.
Setting Up the Project
I created a video/ folder in the project root and installed Remotion there.
npm init -y
npm install remotion @remotion/cli @remotion/player
The Remotion config file is where you lock in format and frame rate:
// remotion.config.ts
import { Config } from "@remotion/cli/config";
Config.setVideoImageFormat("jpeg");
Config.setOverwriteOutput(true);
And the composition itself sets the canvas size:
// src/Root.tsx
import { Composition } from "remotion";
import { VideoComposition } from "./VideoComposition";
export const RemotionRoot = () => (
<Composition
id="LinkedInClip"
component={VideoComposition}
durationInFrames={1800} // 60 s at 30 fps
fps={30}
width={1080}
height={1920}
/>
);
Structuring Scenes with Frame Timing
Each scene in my video maps to a range of frames. I wrote a small helper to convert seconds to frames and back, then built each scene as a React component that reads the current frame from useCurrentFrame().
import { useCurrentFrame, interpolate, AbsoluteFill } from "remotion";
const HookScene: React.FC<{ startFrame: number }> = ({ startFrame }) => {
const frame = useCurrentFrame();
const localFrame = frame - startFrame;
const opacity = interpolate(localFrame, [0, 15], [0, 1], {
extrapolateRight: "clamp",
});
return (
<AbsoluteFill style={{ opacity }}>
<p style={{ color: "white", fontSize: 64 }}>These are live viewers.</p>
</AbsoluteFill>
);
};
The parent composition just stacks scenes and passes each one its start frame. Remotion's <Sequence> component handles the offsets cleanly:
import { Sequence } from "remotion";
export const VideoComposition = () => (
<>
<Sequence from={0} durationInFrames={150}>
<HookScene startFrame={0} />
</Sequence>
<Sequence from={150} durationInFrames={150}>
<ProblemScene startFrame={150} />
</Sequence>
{/* … more scenes */}
</>
);
Beat-Syncing Cuts to Music
The game had its own quiz theme track at 124 BPM. At 30 fps, one beat is (60 / 124) * 30 ≈ 14.5 frames. I rounded to 14 or 15 alternately to stay in sync over the full minute. Every scene boundary landed on a beat.
const BPM = 124;
const FPS = 30;
const framesPerBeat = (60 / BPM) * FPS; // ≈ 14.5
const beatToFrame = (beat: number) => Math.round(beat * framesPerBeat);
I rendered the music separately into an AAC file, then referenced it inside a Remotion <Audio> component with a volume prop so I could adjust without re-recording.
import { Audio, staticFile } from "remotion";
<Audio src={staticFile("quiz-theme.aac")} volume={0.6} />
Kinetic Captions
For text that animates line by line I built a small Caption component. Each line has an enterAt frame and an optional exitAt. One thing I ran into: if exitAt equals enterAt, Remotion throws because the interpolation range is [n, n]. I added a guard:
const safeExitAt = exitAt > enterAt ? exitAt : enterAt + 1;
const opacity = interpolate(frame, [enterAt, enterAt + 8, safeExitAt - 8, safeExitAt], [0, 1, 1, 0], {
extrapolateLeft: "clamp",
extrapolateRight: "clamp",
});
Screen Capture as Footage
Part of the video needed real screen recordings of the overlay running. I recorded those separately as MP4 files, then dropped them into Remotion as <Video> components with startFrom to trim to the right moment. I ran the captures in test mode against a copy of the database, with generated avatars replacing any real user data.
import { Video, staticFile } from "remotion";
<Video
src={staticFile("take1.mp4")}
startFrom={90} // trim the first 3 s
style={{ width: "100%", height: "100%" }}
/>
Rendering
Remotion uses a headless browser to render each frame. On first run it downloads its own Chrome headless shell (~95 MB), which I hadn't expected — the terminal looked stuck for a few minutes. Once that download finished, renders ran at around 9 seconds per still frame.
For the final export:
npx remotion render src/index.ts LinkedInClip out/clip.mp4
The output was a 1080×1920 MP4 at 30 fps, ready to drop directly into a LinkedIn native video post.
Keeping Captions in the Safe Zone
LinkedIn sometimes crops the feed thumbnail to 4:5 instead of the full 9:16. I added a stills script that rendered key frames and drew cyan dashed guide lines at the 4:5 crop boundaries, so I could visually confirm nothing important was outside the safe area. It was a quick sanity check and caught one caption that was sitting too low.
What I'd Do Differently
A couple of things I'd change next time:
Bundle once, render many. Each still frame re-bundled the project, which made reviewing designs slow. Remotion has a bundle step you can run separately; rendering stills after that is much faster.
Check audio before the final render. I rendered the full video and only then remembered to actually play it and check the music volume. That meant one more render pass. Worth doing the audio check on a short test clip first.
Pre-calculate all frame ranges in one place. I scattered frame numbers through multiple files. By the end, changing a scene's duration meant hunting down three or four constants. A single timeline definition object at the top of the composition file would have saved that.
Overall Remotion was a genuinely good fit for this. The React model made it easy to pass data into scenes, the frame-based timing gave me precise beat-sync control, and the output format was exactly right for LinkedIn without any extra conversion step.