Skip to content

03Writing19 min read

How to Make a Short Film with AI Tools: Gemini, Claude Code and Remotion, Step by Step

No camera and no editing software. Gemini paints the frames, Claude Code edits the film as code. Nine steps, the mistakes I made, what each step cost, and a prompt you can hand to your own AI agent.

  • claude-code
  • gemini
  • remotion
  • ai-video
  • tutorial

Nothing in this 94-second film about Taiwan was shot with a camera. Every frame is a gouache-style painting made by Gemini. Claude Code edited it by writing code. I never opened an editing app.

This guide splits the work into the nine steps I actually followed. Each step includes where I got stuck, so you can skip those detours. If you would rather have your own AI agent walk you through it, there is a full prompt to copy near the end.

The three tools

Each tool handles one part of the job.

Gemini paints the images. Google’s image models draw from a text description. You can also attach a reference image and ask for the same painting style.

Remotion turns the images into a video. You describe the film in code: “this image, zoom in slowly, fade out over one second, hold for this many frames.” Remotion renders an MP4.

Claude Code writes all the code. It is an AI coding agent that creates files and runs commands on your computer. You do not need to know React. You do need to watch what it makes and say when something is wrong.

My own role was closer to a director. I set the shot list, watched every version, and rejected what did not work.

Step 1: Write the brief and pick a style reference

Before anything gets painted, decide two things: how the film should feel, and what the paintings should look like.

My brief to Claude Code was short. A slow, warm, slightly nostalgic travel film, about 90 seconds, vertical, made for phones. Only gentle camera pushes and drifts, soft dissolves between shots, almost no text.

For the style, I used 17 Taiwan illustrations I had made with AI earlier: the Alishan forest train, tea pickers, Jiufen and the Pingxi sky lanterns. Every new image was generated with one of them attached as a reference. That is the most reliable way to make 18 scenes look like one set.

If you have no reference yet, spend some time getting one or two images you like. Then use them as the reference for everything after.

Step 2: Put the shot list in a config file and batch-generate

Do not keep the shot list in the chat. Put it in a config file, one entry per shot: what to paint, the time of day, how long it holds, which reference to use. Mine looks like this (trimmed):

{
  "model": "gemini-nano-banana-2.1",
  "image_size": "2K",
  "aspect_ratio": "9:16",
  "takes": 2,
  "shots": [
    { "id": "01_train", "preset": "alishan_steam_train",
      "time": "Soft early morning light.", "beats": 6 },
    { "id": "02_tea", "preset": "alishan_tea_pickers",
      "time": "Morning, light mist on the mountains.", "beats": 5 }
  ]
}

Then ask Claude Code for a small script that sends each shot to Gemini with its reference image. The core is two lines:

contents = [types.Part.from_bytes(data=ref.read_bytes(), mime_type="image/jpeg"), prompt]
r = client.models.generate_content(model=model, contents=contents, config=config)

I generated two takes per shot and had them tiled into one contact sheet. Thirty-two images took about 12 minutes. Picking from one contact sheet is much faster than opening images one by one.

Two warnings before you start.

First, the model matters more than you would expect. My first batch used Gemini’s cheapest image model at 1K. My whole reply was: “This looks too ugly right now. I can’t accept it.” Switching to Nano Banana 2.1 gave 2K images, 1536 by 2752 pixels. That is sharper than the final 1080 by 1920 video, and the style matched my references almost exactly. It costs less than two cents more per image.

Second, do not put the same object in every scene. I wanted one sky lantern to drift through the whole film as a through-line. Claude Code cut a lantern out of my Pingxi painting and placed it over a salt field to test the idea. It looked pasted on.

A sky lantern placed over a salt field painting. It looks pasted on.

The angle could be fixed. The light could not, unless every scene was repainted and checked. A lit lantern over a salt field at noon also makes no sense. I dropped the idea and used the time of day as the through-line instead, from dawn to late night. The lantern appears once, at the end, in Pingxi where it belongs.

Think about shot length early too. Ninety seconds across 10 scenes means 9 seconds per shot, which is long on a phone. I cut it to about 6 seconds, so the scene count went from 10 to 18.

Step 3: Fix the local details the AI gets wrong

This step took the most time. The images were beautiful, but the details were often wrong in ways only a local would notice.

Bubble tea was the first case. The first version had dome lids and pastel cups. Nobody in Taiwan drinks it like that. I sent Claude Code a photo, and it wrote the details into the prompt: a tall clear 700 ml cup, a flat sealed film on top, a thick straw punched straight through, a dense layer of big pearls at the bottom. The next version was right.

Taipei 101 was also fixed with a photo. The color was wrong and the fireworks were scattered across the sky. After the photo, the tower turned dark navy-teal at night, and the fireworks shot from the tower’s corners and drooped down, like a real New Year’s Eve.

Images with text were the hardest. The lottery shop sign said 彩券 (lottery) correctly. The posters next to it were full of fake Chinese, characters that look real at a glance and are not.

Two lottery shops whose posters are covered in characters that look Chinese but do not exist.

In the election scene, the first round had 凍蒜 (a campaign chant meaning “get elected”) on almost every flag, sometimes only half of it. One candidate looked a lot like a real politician, and another image had someone waving a national flag. I am not showing that round, for the same reasons I rejected it.

For any scene with text, I ended up using two fixes. One: hard rules for the writing. Flags carry only a circled number. 凍蒜 appears exactly once, on the side of the sound truck. Every candidate gets clearly invented features. Two: a different model. These two scenes moved to the pricier Gemini 3 Pro Image, which writes Chinese far more accurately. The lottery shop worked on the first try. The election took two rounds.

The second election round: numbers only on the flags, 凍蒜 once on the truck, every candidate invented.

I also tried a map of Taiwan as the opening. Both versions added English place names I had asked it to leave out, and one put the Meinong paper umbrellas on the east coast. I did not use it.

Two map openings. The one on the right puts the umbrellas on the east coast.

The lesson was the same every time. The model’s idea of a place is a tourist’s idea. What worked was a photo plus a specific description. Rewording the prompt alone almost never helped.

Step 4: Turn the images into a film with Remotion

Once the images are picked, ask Claude Code to set up a Remotion project. Each shot is a component: one image with a slow push or drift, joined to the next with a one-second fade. The skeleton of the whole film looks like this:

<TransitionSeries>
  {SHOTS.flatMap((s, i) => [
    i > 0 ? <TransitionSeries.Transition presentation={fade()}
              timing={linearTiming({ durationInFrames: 30 })} /> : null,
    <TransitionSeries.Sequence durationInFrames={s.frames}>
      <Shot src={s.src} move={s.move} />
    </TransitionSeries.Sequence>,
  ])}
</TransitionSeries>

Do not build the whole film first. I asked for a 10-second sample with two shots to check the camera speed, the transition and the type. Only then did we assemble the full film. Render previews at half resolution; it is much faster.

One small thing to ask for: a new file name for every preview. At one point I kept thinking a change had not worked. My player was still showing the old file.

Step 5: Add music and cut on the beat

I found the music on Pixabay, a free library: “Sentimental Emotional Piano & Strings” by Tunetank. Claude Code suggested slow piano and strings. It also suggested avoiding guzheng and erhu, because foreign audiences tend to hear those as Chinese first.

This next trick made the biggest difference in feel. Claude Code analyzed the track in code and found a steady beat about every 0.83 seconds. It set every shot to a whole number of beats, so every cut lands on the beat. That is what the beats field in the config is for. Busy shots get fewer beats, quiet ones more. The cut to Taipei 101 lands on the loudest moment of the song.

One catch: Claude Code cannot hear. It can measure where the track is loudest, but volume is your call. It started the music at 90% of the original level. I said “too loud” three times before it settled at 15%.

Step 6: Overlay text in code, and draw the position for the AI

I wanted “I ♥ TW” on Taipei 101, the way the tower lights up messages on New Year’s Eve. Do not ask the image model to paint text like this. Ask Claude Code to overlay it in code. The letters are then always correct, they can light up one by one, and changing the message is a one-line edit.

Placing it was another story. It took six tries: vertical, horizontal, two lines, then vertical again on the seam between two faces of the tower. My reply to that one was: “Even more crooked…”

The problem was that it kept guessing where the seam was. First it used the exact center of the tower, then a darker line to the right. In the end I drew a line on a screenshot and said, “Put the letters on this line.” The next version was right.

Taipei 101 with a grid, used to find the seam between two faces.

The final tower: I, a red heart, T and W running down the seam.

So for anything about position, stop describing it in words. Draw it on a screenshot. My “middle line” and its “middle line” were never the same line.

This is also when the small motion effects went in: steam from the train, flickering lanterns, embers under the Pingxi lanterns, glints on the sea at Lanyu, and a faint paper texture over everything so the 18 images feel like one set. Expect to tune the strength. My first reaction was “too subtle.” After it was turned up, the steam over the night market food looked wrong, so it came out.

Step 7: The opening and the ending

I made the opening three times. It is the easiest part to underestimate.

Version one was a still title card held for 4.5 seconds. People scrolling social media decide in about two seconds. Version two had the title rising out of white steam before revealing the train. It still felt abrupt. Version three added a painting of the Alishan sunrise over a sea of clouds before the train. The film opens in white mist, the title surfaces, and the mist clears to reveal the sunrise. That one stayed.

The opening: white mist, the title, the sunrise, then the train.

The ending was easier. The last shot shrinks into a postcard wall of all 18 scenes, and the same title returns in the middle.

The postcard-wall ending.

Step 8: Export for sharpness and a sane file size

My first real export was 132 MB and looked slightly soft. Claude Code looked for the cause before touching any settings.

It ruled out the usual suspects. The frames were just as soft before compression, so compression was not the cause. Removing the paper texture changed nothing. Rendering at twice the resolution did not help either. It found two causes. The Gemini images are only 1536 pixels wide, and the camera push enlarges them by about 10%. And Remotion saves every frame as a compressed image before building the video, which loses a little more.

The fix was to capture every frame at maximum quality and add a light sharpening pass. The picture improved, but the file grew to 335 MB. My reaction: “It’s a 90-second video and it’s that big? I can’t accept that.”

File size is controlled by a number called CRF. A lower number keeps more detail and makes a bigger file. Claude Code tried three settings and measured how close each one was to the sharpened version, where 1 means identical.

File size Similarity to the sharpened version
145 MB 0.975
97 MB 0.966
50 MB 0.956

The scores are close. Side by side and zoomed in, I could not see a difference, and the night scenes showed no color banding. I went with 50 MB, using an encoder mode tuned for animation that saves space on large flat areas of color.

To do it in one pass, use these two commands:

npx remotion render src/index.ts Film raw.mp4 --jpeg-quality=100 --crf=10
ffmpeg -i raw.mp4 -vf "unsharp=5:5:0.8:5:5:0" \
  -c:v libx264 -preset slow -tune animation -crf 26 \
  -pix_fmt yuv420p -movflags +faststart -c:a aac -b:a 192k final.mp4

The first renders at maximum quality, which makes a large file. The second sharpens lightly and compresses to a normal size.

Step 9: Don’t let the transfer ruin it

When I sent the finished file to my phone, it looked soft again. This time the file was fine. The app I used to transfer it had compressed it on the way. Resending it with AirDrop brought the quality back.

Here is the same frame of the umbrella maker four ways. The old files were deleted during the project, so panels 1 and 2 are re-renders with the settings used at the time. Panel 4 is a screenshot from my phone, scaled to the same size, so it went through a different path from the other three.

The same frame four ways: half-resolution preview, first export, final version, phone screenshot.

Panel 1 is the half-resolution preview. Panel 2 is the first export. Panel 3 is the final sharpened 50 MB version. Panel 4 is the phone screenshot after the transfer app compressed it. Sharpening helped a little. The transfer did the most damage.

So when you post to X or LinkedIn, upload the original file from a computer. If you post from your phone, move the original there with AirDrop or cloud storage, not a messaging app.

Hand it to your AI agent

To make your own, copy the whole block below and paste it into Claude Code, or any AI agent that can create files and run commands on your computer. It follows the nine steps in this guide, one at a time, and stops after each step for your approval.

You need two things first: a Gemini API key (the pass that lets a program call Gemini, free to create in Google AI Studio), and Node.js, Python and ffmpeg installed. If anything is missing, the agent checks in step 0 and helps you install it.

You are my short-film production assistant. We will make a 60 to 90 second vertical (9:16) film, with AI-generated images and editing done in code.
Tools: a Gemini image model for the images, Remotion for editing, ffmpeg for the final export. You write and run the code. I make the decisions and review the results.

Working rules:
- Do one step at a time. After each step, show me the result (the path to the image, contact sheet or preview video) and wait until I say "OK" before the next step.
- Before each step, explain in two or three sentences what it does and roughly what it costs.
- Before anything that costs money (calling Gemini), tell me the number of images and the estimated cost, and run it only after I agree.
- Never print the API key. Keep it in a .env file and make sure .env is not committed to git.
- Give every preview a new file name (for example preview_v3.mp4). Never overwrite an old one.

Steps:
0. Check the environment: Node.js, Python, ffmpeg, and whether the Gemini key works. Help me install whatever is missing.
1. Ask me three things: the film's subject, the feeling I want, and whether I have a style reference image. If I don't, generate two or three options and let me pick one as the reference.
2. Write a shot list config, film.json: one entry per shot with what to paint, the time of day, how long it holds and the reference image. 90 seconds is about 15 to 18 shots of 5 to 6 seconds each.
   Write a Python script to generate the images in a batch: attach the reference image to every call, 9:16, 2K resolution, 2 takes per shot.
   Tile the results into one contact sheet for me to pick from. Don't repeat the same object across scenes; if the light doesn't match, it looks pasted on.
3. Check the details with me. Whenever a scene has something local (food, buildings, signs), ask me for a photo, write its specific features into the prompt, and regenerate.
   When a scene needs text: state in the prompt exactly which characters may appear and where, keep everything else blank, and switch to a model that is better at writing text.
4. Set up a Remotion project: one component per shot, a slow push or pan, a 1-second fade between shots. First build a 10-second sample with two shots and render it at half resolution for me to review.
5. Ask me for a track that is licensed for commercial use. Analyze its beat in code, set every shot to a whole number of beats so the cuts land on the beat, and line up the loudest section with the most important shot.
   You cannot hear audio, so always ask me about volume and adjust to the percentage I give you.
6. Wherever text is needed, overlay it in code; never ask the image model to paint it. If the text is in the wrong place, ask me to draw the position on a screenshot instead of guessing from a description.
   Add small motion effects (steam, flickering lights, embers) one kind at a time and let me approve the strength.
7. The first two seconds must move; no still title card. The ending can echo the opening title.
8. Export the final version with these two commands:
   npx remotion render src/index.ts <CompositionName> raw.mp4 --jpeg-quality=100 --crf=10
   ffmpeg -i raw.mp4 -vf "unsharp=5:5:0.8:5:5:0" -c:v libx264 -preset slow -tune animation -crf 26 -pix_fmt yuv420p -movflags +faststart -c:a aac -b:a 192k final.mp4
   Tell me the file size. If I say it looks soft, find the cause first (source resolution, frame capture quality, compression) instead of just making the file bigger.
9. Remind me: move the file to a phone with AirDrop or cloud storage, not a messaging app, and upload the original file to social media.

Start with step 0.

Every mistake in this guide is built into that prompt. The agent asks you for photos, quotes the cost before spending, uses new file names, and never asks the image model to write text. You only need to watch the results and make the calls.

Cost per task

The whole film had a Cost per Task of about $22: $4.15 for images and $18.07 for Claude Code. These are list prices, not an actual bill. The 17 reference images I made earlier are not included.

The images came to about $4, for 79 images in total.

Model Images Price each Subtotal
Gemini 3.1 Flash Lite Image, 1K (first batch) 25 $0.034 $0.84
Nano Banana 2.1, 2K (most scenes) 47 $0.050 $2.37
Gemini 3 Pro Image, 2K (scenes with text) 7 $0.134 $0.94

Claude Code came to about $18, converted at Claude API prices per token (the unit AI models use to count text). Most of it ran on Opus 5.5, for $16.95. Early on, one call to the stronger Fable 5.2 to review the plan added $1.12. The count stops when I approved the finished film.

Most of that money went to re-reading. Every time Claude Code replies, it reads the whole conversation again. With caching, which stores what it has already read, each re-read token is cheap. But by the time the film was done, it had re-read about 35 million tokens. By step, it breaks down like this:

Task Cost per task
Setup, first batch, the failed lantern idea (incl. one plan review) $4.17
Generating 16 scenes, picking takes $0.96
Fixing bubble tea, 101, the lottery shop, the election $2.21
Sample, music, opening and ending $1.96
Placing “I ♥ TW” on 101 $2.00
Volume, motion effects, beat sync, three openings $3.09
First export, drafting the post $1.09
Chasing the blur, compressing the file $2.59

Later work costs more per message, because there is more conversation to re-read. Those four letters on Taipei 101 cost $2, about half as much as all 79 images.

Nothing else cost money. The music is from Pixabay, and rendering and compression ran on my laptop. Remotion is free for individuals and small companies; larger companies need a paid license, see its license page.

If you make your own, the money goes to revisions, not images. Images are cheap enough to generate two takes per scene and throw one away. Save your budget and patience for the local details and the few letters that will not sit straight.

The caption I posted with it was my own line: “90 seconds of Taiwan. We’re more than stinky tofu!” The stinky tofu is on the table in the night market scene, next to a plate of pickled cabbage.

A Chinese version of this guide is on jazzlien.com.

Want to talk about this? Find me on LinkedIn, or email me.