Frame-perfect gameplay videos from Godot 4 without a screen recorder
We make small mobile puzzle games in Godot, and we need a steady supply of vertical gameplay clips for YouTube Shorts and TikTok. Screen recorders gave us dropped frames, desktop notifications in the shot and a different result on every take. So we moved the camera inside the engine. The game renders into an offscreen viewport, and every frame is saved to disk. Then ffmpeg turns the frames into a…
Godot 4 developers found a solution to create seamless gameplay videos without screen recorders. Small mobile puzzle games require frequent vertical gameplay clips for social media platforms like YouTube Shorts and TikTok. Traditional screen recorders caused dropped frames and inconsistent results. To overcome these issues, the team placed the camera inside the engine.
The game renders to an offscreen viewport, saving each frame to disk. The frames are then compiled into a video using ffmpeg. To ensure stability, Godot is run with a fixed frame rate and disabled vsync. The game's SceneTree script controls the game's execution, and a custom script manipulates the viewport to capture frames. The script sets the scene size, renders mode, and writes frames to disk.
By running the game in a throwaway copy with private save paths, the capture process ensures that no player data is affected. The script also seeds the game's generator for deterministic results and deletes frames after encoding. This method produces consistent stutter-free footage, enabling easy re-editing and adaptation for various platforms and screen sizes.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.