# Kit · GTA 6 style video with AI

marbuilds.dev/resources/en/gta-ai-video · @itsmarbuilds

Turns your generated clips into a video with a game HUD (mission, objectives, countdown,
stars, minimap, +XP), subtitles, music and a closing card with your brand. It all comes from a single file:
`montaje.json`.

The code and the config fields are in Spanish (`montaje.py`, `planos`, `rotulos`...): that's how the kit was built, and
this guide explains each field. What you write inside them (captions, subtitles) can be in any language.

## What's here

| File | What for |
|---|---|
| `montaje.py` | Does everything: base video, music, audio, HUD and final video |
| `montaje.ejemplo.json` | The whole grandma video, as a template to copy |
| `hud.html` | The HUD design (colors and sizes in its `<style>`) |
| `render_hud.mjs` | Paints the HUD frame by frame. `montaje.py` calls it |
| `musica.py` | Composes an original beat and the effects (yours, with no third-party rights) |
| `prompts.md` | All the prompts, from the idea to the edit |

## Install (once, 10 minutes)

1. **ffmpeg, Python 3 and numpy**: on a Mac, `brew install ffmpeg python numpy`.
   (With Homebrew's Python, `pip3 install numpy` gives an "externally-managed-environment" error: install it with brew.)
2. **Node 20 or later** and Playwright, inside this folder:
   ```
   npm init -y && npm i playwright && npx playwright install chromium
   ```
3. **The transcriber** (to review the clips and get the subtitle timings):
   ```
   brew install whisper-cpp
   curl -L -o ggml-small.en.bin https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin
   ```
   If the characters speak Spanish or another language, download `ggml-small.bin` instead of `ggml-small.en.bin`.
4. **The Pricedown font** (by Typodermic, free for this use). Download it yourself from DaFont, which is
   an authorized download source: https://www.dafont.com/pricedown.font. Unzip it and leave the file
   `Pricedown Bl.otf` inside `fuentes/`, **as is, without renaming it**. If it's missing, `montaje.py` stops and tells you.
   Its desktop license (v260817) allows using it in commercial video ("rendered audiovisual content",
   clause 2.2) and forbids sharing the file or putting it on a website or in a template for others (4.1 and 4.3).
   That's why it isn't inside this kit, and you shouldn't upload it to any repository either.

To generate the images and videos from Claude Code (optional but recommended):
```
claude mcp add --transport http higgsfield https://mcp.higgsfield.ai/mcp
claude mcp add nanobanana -e GOOGLE_AI_API_KEY=your_key -e NANOBANANA_MODEL=gemini-3.1-flash-image-preview -- npx -y @ycse/nanobanana-mcp
```
Higgsfield asks you to sign in the first time (in `/mcp`). **Then open a new Claude Code session**: its tools don't show up in the session where you authorized it. And don't remove `--transport http`: without it, it's saved as a local program and fails to start. You get the Google AI key at https://aistudio.google.com/apikey.

The HUD loads two Google Fonts typefaces (Barlow and Inter): **the first time, you need a connection**.

## Use

```
cp montaje.ejemplo.json montaje.json      # and edit it with your shots
python3 montaje.py revisar montaje.json   # 6 frames with the HUD on top in build/<formato>/revision/
python3 montaje.py todo montaje.json      # the final video (about 5-8 min per minute of video)
```

The clips go in `clips/` and the closing logo wherever `cierre.logo` says.

## montaje.json, field by field

**Timings.** Everything is written relative to a shot: `["G", 1.5]` is second 1.5 of shot G (not counting
its initial freeze; with negative numbers you go into it), `["G", "fin"]` is where G ends,
`["inicio"]` is second 0 and `["final"]` the last one. If you change a shot's length, everything that comes
after it rearranges itself.

**At the very top**
- `formato`: `"wide"` (1920x1080, everything inside the frame) or `"vertical"` (1080x1920, the video in a strip and the HUD in the bands).
- `fps`: 30. `clips`: the clips folder. `salida`: the final video's name.

**`planos`** (the shots, in order of appearance)
- `id`: a letter or a short word, unique.
- `tipo`: `"plano"` (generated clip), `"movil"` (vertical screen recording, no audio) or `"cierre"` (closing card, optional).
- `fuente`, `desde`, `hasta`: which part of the file, in seconds.
- `velocidad`: 3 = three times as fast (for typing on the phone). The shot's audio speeds up the same way.
- `congelar_inicio` / `congelar_final`: seconds with the image frozen (for stingers).
- `silenciar`: `true` removes the clip's audio (use it on shots without dialogue: the AI adds music).
- `recorte_movil`: `[width, height, x, y]` to crop the screen recording (remove the status bar or whatever you don't want to show).

**`hud`**
- `serie`: small text at the top (accepts `<b>`). `nivel`: for example `"LVL 99"`. `moneda`: `"$"`.
- `mision`: `etiqueta`, `titulo` and `en` (when the box is visible).
- `juego`: sections where stars, money and XP are visible.
- `objetivos`: `texto`, `falta` (when it turns red) and `hecho` (when it gets crossed out).
- `reloj`: `etiqueta` and `claves` = `[[moment, seconds it shows], ...]`. Between keys it counts down on its own; under 60 it blinks.
- `estrellas`, `dinero`, `xp`: `[[moment, value], ...]`.
- `minimapa`: `en`, `etiqueta` (the neighborhood) and `desplazamiento` (how far the pink route moves).
- `botones`: `en`, `tecla` (R2, △, ✕...) and `texto`.
- `npc`: `en`, `nombre`, `nivel`, `x`, `y`. **x and y are measured on a 1080x608 video**: put the tag above the character's head and out of the top left corner, which belongs to the mission box.
- `rotulos`: `en`, `grande` (e.g. "+50 XP"), `texto` (e.g. "NEAR MISS"), `y` (height on the 1080x608 video), and optionally `tam_grande` and `tam_texto` in pixels (64 and 28 by default). With `sobre_movil: true` they're placed over the phone recording (y measured on a 1080x1920 canvas).
- `stingers`: big full-screen titles. `html` with the classes `k` (pink overline), `big` (yellow Pricedown), `sub`, `stars5` and `money`. In vertical, `subir` (60 by default) places it higher or lower.
- `subtitulos`: `en`, `quien`, `texto` and the name's `color` (yellow by default).
- `cierre`: `logo`, `marca`, `lema` and `brillo` (the glow color, e.g. `"rgba(14,230,204,.18)"`).

**`audio`**
- `musica`: `"sintetizar"` or the path to your song (licensed). With your own song, the effects are still generated.
- `fin_gancho`: how long the full beat plays at the start. `arranca_beat`: from where it comes back after the intro.
- `hueco_final`: where the drums go quiet and the mission passed fanfare plays. `outro`: where that gap ends.
- `volumen_musica`: `[[moment, gain], ...]`. **0.3 under dialogue**: any louder and it drowns out the voice.
- `efectos`: `true` adds a whoosh on every cut, a ding on every caption and objective, stars and the fanfare.

## If something fails

- **"Falta la fuente"** (the font is missing; the message says "ver LEEME.md", which is this README): step 4 of the install. The file has to be inside `fuentes/`.
- **"externally-managed-environment" when installing numpy**: use `brew install numpy`.
- **`Cannot find package 'playwright'`**: step 2, inside this folder.
- **The audio is ahead of or behind the image**: it doesn't happen if you use `montaje.py`. Every shot is cut in whole frames; if you edit by hand, do the same.
- **A caption covers a face**: change its `y` or its `en` section and run `revisar` again (it takes seconds).
