We turned these clips into an invitation
Four abstract animations, without text or sound. After editing: a burgundy background, pink shapes, large italics and a 120 BPM rhythm. That became our 16-second Cookie Sessions teaser. In the preview, compare the source material with the finished film, then switch to the portrait version.
Cookie Sessions is a fictional evening of music and visuals. The name, venue and date in the film belong to the example. The player controls are in English; the video titles and downloadable source project remain in Polish. The editing is real: we prepared it in Codex using FFmpeg, a tool for processing video and audio. The archive gives you clips, edit settings and a script to render it again. Start by replacing the titles.
How 32 seconds became 16
Each of the four source clips is eight seconds long, 1280 × 720, at 24 frames per second. They are silent and have no titles. We drew the animations programmatically as SVG and prepared frames with Node.js and Sharp. They did not come from a video-generation model. In before.mp4, the full clips run in order: 01, 02, 03, 04. Together they make 32 seconds.
For the trailer, we chose the order 03, 01, 02, 04. We kept 4.5 seconds from each of the first three clips and four from the last. That is 17.5 seconds of material, but three half-second crossfades overlap the ends and beginnings of shots. The final film is therefore 16 seconds. The timeline sections Light, Sound, Motion and Meet us begin at seconds 0, 4, 8 and 12.
Both exports have 24 frames per second. Landscape is 1280 × 720; portrait is 720 × 1280. We save them as MP4 with H.264 video and AAC audio.
The letters have their space; the music has its tempo
Each part has two large lines and a short supporting caption. Titles have time to enter and disappear. We chose Georgia Italic: its soft italics sit well beside geometric shapes, while a dark area underneath keeps the text readable against the moving background.
The script prepares the music too. From sound waves, it builds a kick, bass, short notes, noise and chords: our original backing track at 120 BPM. In the portrait film, we set image cropping and title positions separately. Simply shrinking the landscape composition would make the letters too small on a phone. The final scene’s supporting line splits into two at the “ · ” separator.
What you need to run it
Your computer needs Python 3, FFmpeg and ffprobe available in the terminal. FFmpeg needs the drawtext, xfade and loudnorm filters for titles, crossfades and loudness normalization. No extra Python packages are required. You do not need Node.js or Sharp at this stage either: the finished source MP4 clips are already in the archive.
The script looks for Georgia and Arial or DejaVu fonts on your computer. We do not include the fonts themselves. Point to your own TTF files with --serif-font and --sans-font. After changing typefaces, inspect the titles in both formats, since letter widths may differ.
Our script supports four scenes, 24 frames per second, half-second transitions and a 16-second result. It checks that selected ranges fit within the clips but does not automatically fit long titles. Start with short words. Adding more scenes also requires changes to the code.
Replace a title and assemble the film again
Download and extract the ZIP. Open edit.json, the edit-settings file, in a text editor. In the first entry of the scenes array, set line1 to “Night”, line2 to “of color.” and caption to “See you after dark.” Keep the remaining fields and commas. The title field at the start of the file only describes the project; it does not appear in the film.
After saving, open a terminal in the extracted folder and run the command below. On Windows, use py -3 render.py. The script creates both formats, final-16x9.mp4 and final-9x16.mp4, in the output folder. It also writes before.mp4 and thumbnails. Running it again overwrites these outputs, so move an earlier edit elsewhere if you want to keep it.
Now watch and listen
Codex can turn an idea into settings and code; FFmpeg assembles the film from them. We still need to watch and listen to the whole thing. Check whether you had time to read the titles, whether transitions fit and whether the music is too loud. That observation gives the agent a useful next request: “Increase the gap between the title and supporting line in portrait” is much more specific than “Make it better.”
You can develop the same files in Claude Code, which also edits code and runs commands. Remotion is another route if you want to build the film from React components; it provides skills and plugins for Codex and Claude Code. To render our example again, though, the source clips and script in the archive are enough.
Sources and further reading
The sources behind this article. Instructions and example scenarios are suggestions from our editorial team.
- Cookie Analytics: Cookie Sessions editing demonstration (opens in a new tab)qkianalytics.pl
- Cookie Analytics: downloadable project — clips, edit.json and render.py (opens in a new tab)qkianalytics.pl
- FFmpeg: video and audio processing and export (opens in a new tab)ffmpeg.org
- Remotion: Agent Skills for coding agents (opens in a new tab)remotion.dev
- Remotion: plugins for Codex and Claude Code (opens in a new tab)remotion.dev
- Anthropic: Claude Code — files and commands (opens in a new tab)code.claude.com