From $86 to $16 a Month: Cutting AI Short-Video Costs with Code-Driven Stickman Animation
For anyone producing short videos for overseas audiences, cost is hard to ignore. Scripts, voiceover, and editing can be localized, but generating the actual footage almost always depends on pay-as-you-go generative models. One author's bill had climbed to $86 a month, quotas burned through quickly, and results were unpredictable — faces and characters drifted between shots, and a single line change meant starting over and "gacha-rolling" again. This article follows the switch to a fully code-driven stickman explainer pipeline: a 15-second, 60fps, 900-frame clip now costs about $0.54 to render, and the monthly bill dropped to $16. It answers two questions — how to optimize AI short-video costs and what typically goes wrong with stickman animation — and walks through environment checks, skeleton baselines, joint kinematics examples, a runnable export script, and a full cost breakdown, while laying out where the approach does and doesn't apply.
For anyone making short videos for overseas audiences, cost is impossible to ignore. Scripts, voiceover, and editing can all be localized as much as possible, but generating the actual video footage is still almost entirely handled by pay-as-you-go generative models. The author’s bill had once stalled at $86 per month, with quotas that never seemed to last. More frustrating was how uncontrollable the results were: shots frequently broke faces or mixed up characters, and changing a single line of dialogue meant tearing everything down and “gacha-rolling” again and again.
Later, the author replaced the production pipeline with a purely code-driven stickman explainer animation. Using specifications defined in advance as a skill package, an AI coding tool generated and exported everything locally. In a real test, a single 15-second clip at 60fps (900 frames total) cost about $0.54 to produce, and the monthly bill dropped to $16. More importantly, because the animation is data-driven, changing a line of dialogue no longer means regenerating model assets.
Using this practice as a thread, this article answers two questions: How do you optimize costs for AI-powered overseas short videos? And what typically goes wrong with stickman animation? It also provides environment checks, skeleton baselines, joint kinematics examples, a runnable export script, and a full cost breakdown, along with the boundaries of where this approach applies.
1. Breaking Down the Problem: Where Generative Video Gets Expensive, and Why It “Always Breaks”
To decide whether a new approach is worth switching to, you first need to understand where the original solution’s costs actually went. Spending on generative video models falls into three main categories:
- Generation quota: Billed by the second or by the call. The longer the footage, the higher the resolution, and the more iterations, the greater the consumption.
- Iteration waste: When a shot is inconsistent or the dialogue changes, most of the already-generated clips are thrown away, and all the earlier compute is sunk.
- Opportunity cost: Time spent waiting for generation and picking results directly slows down the content team’s release cadence.
Harder than cost is “controllability.” Generative models are essentially probabilistic: with the same prompt, a different random seed can change a character’s facial features, hairstyle, or clothing, and camera moves and pacing may not match expectations either. For short videos that need continuous narrative, consistent character appearance, and repeated output within the same series, this uncertainty only gets amplified.
The author’s proposed solution: hand control over the visuals back from the “probabilistic model” to “deterministic code.” Stickman figures are made of simple lines and geometric shapes, with no facial detail and no need for realistic lighting, which makes them ideal for precise description in code. Bone proportions, joint angles, and motion paths are all written as data, so every rendered frame is reproducible, auditable, and rollback-able.
2. The Core Tension: Getting an LLM to Write Code Is Easy; Getting It to Follow the Rules Is Hard
It’s worth clearing up a common misconception: code-driven animation doesn’t mean abandoning large models entirely. Quite the opposite — in this pipeline, the AI coding tool acts as the “orchestrator”: understanding requirements, breaking them into scenes, writing scene and motion code, and calling local tools to complete rendering and export.
The problem is that large models aren’t reliable when left to “improvise.” The author ran a deliberate comparison: without attaching any skill package, they had the tool write a stickman animation webpage from scratch.
The prompt for the comparison could be written like this:
First check whether the current directory's skill folder .agent\skills contains anystickman-animation-related skills (only look in the current directory).If there are none, do not call any skill yet. Write a single-page 15-second stickmanexplainer animation in stickman-demo\v1-no-skill.html in the current directory. The topicis "the pain points of a solo business making short videos for overseas audiences." Split itinto 3 scenes, design it for a 16:9 desktop landscape screen, and skip any unnecessarydecoration. When you're done, tell me the result and how long it took.
After confirming there were no relevant skills in the current directory, the tool produced a single-file webpage of about 11.6 KB in roughly 64 seconds. Opening it in a browser and playing it back, the content cards for topic selection, shooting, and editing did appear, but the problems were also obvious:
- Stiff head-to-body proportions: The character was sometimes tall and sometimes short across shots, with no consistent baseline.
- Crooked arm lines: Joint positions were picked arbitrarily, producing arm angles that shouldn’t exist and arm lengths that varied.
- Mixed-up logic: Animation logic and page structure were tangled together, so adjusting a single pose often dragged in the whole block of code.
- Out-of-control pacing: Scene durations were all improvised on the spot, making it hard to align with the voiceover.
This is the typical cost of “no spec”: every time, the large model re-imagines what a stickman should look like, with nothing constraining its spatial and motion intuition.
An effective skill package solves exactly this problem. It is essentially a set of structured instructions for a specific task, usually centered on a specification document and bundled with reusable scripts, templates, and reference material. When a task begins, the AI coding tool loads the relevant skills on demand, effectively turning scattered requirements that used to live inside the prompt into an iterable engineering standard.
In this practice, the skill package enforces four kinds of constraints:
- Format constraints: Unified bone proportions, line widths, and coordinate origins, so the character “always looks the same.”
- Motion constraints: Defined joint rotation methods and easing curves, so movements look natural and don’t clip through the body.
- Process constraints: A fixed pipeline of “write scene data → render frame by frame → composite audio and video → self-check,” avoiding improvisation.
- Tool constraints: A clearly defined local runtime environment and command-line invocation, so the export step can be automated.
The floor of generation quality depends largely on how granular the specification is, not on how “smart” the model itself is. The closer the spec gets to an engineering standard, the more stable the output.
It’s a good idea to add a minimal acceptance checklist once the skill package is in place:
- Are head-to-body proportions, line widths, and coordinate origins consistent?
- Are any joint angles out of range? Do the arms clip through the body?
- Is each scene’s duration aligned with the voiceover?
- Is the export resolution 1920×1080?
- Is the export frame rate 60fps?
- Does the 15-second clip correspond to 900 frames?
- Does the output avoid overwriting previous versions?
3. Pre-Flight Environment Check: Get Your Local Rendering Environment Ready First
This approach renders entirely locally, and the export step needs to call the local runtime and command-line tools. Before you start, confirm:
- Node.js: Node.js 18 or newer is recommended for running skeleton definitions, scene data, and export scripts;
- npm: Bundled with Node.js, used to install dependencies;
- ffmpeg: Version 4.4 or newer is recommended for combining frame images into video and muxing in the voiceover;
- Headless browser: Puppeteer or Playwright, used to render the animation frame by frame into images.
Check commands:
node -v# Expect output like v18.19.0 or newernpm -vffmpeg -version# Check that it shows ffmpeg version 4.4 or newernpm ls puppeteer# If not installed yet, you can install it later with npm install puppeteer
Installation commands by platform:
# Initialize the projectnpm init -y# Install the headless browser rendering dependencynpm install puppeteer
Installing ffmpeg:
# macOSbrew install ffmpeg# Ubuntu / Debiansudo apt update && sudo apt install -y ffmpeg# Windows can use wingetwinget install Gyan.FFmpeg
If you need to install Node.js:
# macOSbrew install node@18# Windowswinget install OpenJS.NodeJS.LTS
Once all tools are installed, make sure node, npm, and ffmpeg can all be called directly from the command line.
4. Step 1: Define the Skeleton Baseline — Turn “Proportions” into Math
The first cornerstone of the skill package is a skeleton definition that locks every dimension to a single baseline. The illustrative code below uses body height as the baseline unit and normalizes the lengths of the head, torso, and limbs to relative proportions:
// Skeleton baseline: all lengths are based on body height H, so proportions stay constant in every shotconst RIG = {H: 100, // normalized heightheadR: 14, // head radius = 0.14Hneck: 86, // neck y coordinatehip: 50, // hip y coordinateshoulder: 80, // shoulder y coordinateshoulderW: 20, // left-right shoulder widthupperArm: 22, // upper arm lengthforeArm: 20, // forearm lengththigh: 26, // thigh lengthshin: 24, // shin length};
A note on the coordinate system and angle units: the example above uses vertical coordinates to describe proportions; if your rendering engine uses a downward y-axis, you only need to flip it consistently. Angles in the scene data are best written as “degrees” for readability, then converted to “radians” before kinematics calculations.
// Degree to radian: if the scene specifies 30 degrees, convert before calculatingconst rad = deg => deg * Math.PI / 180;const armL = rad(30);
Then use forward kinematics to compute joint coordinates. Each limb segment starts from its parent joint and derives the next segment’s position by its joint angle:
// Forward kinematics: from the parent joint and two angles, compute the end joint coordinates// a1, a2 are joint angles relative to the vertical, in radiansfunction chain(origin, len1, len2, a1, a2) {const mid = {x: origin.x + len1 * Math.sin(a1),y: origin.y + len1 * Math.cos(a1),};const end = {x: mid.x + len2 * Math.sin(a1 + a2),y: mid.y + len2 * Math.cos(a1 + a2),};return { mid, end };}
Once the skeleton is defined, the character’s height, head-to-body ratio, and limb lengths are all determined by the same data across every scene. Switching shots or changing poses only changes the joint angles, not “what he looks like.”
5. Step 2: Package the Spec and Tools into a Skill Package
Back in the AI coding tool’s command-line interface, enter the prompt to create the skill. What matters isn’t the wording but making the acceptance criteria explicit:
In .agent\skills\stickman-animator in the current directory, create a skill package for making60fps stickman explainer short clips. Besides writing the SKILL.md spec, bundle two kinds ofscripts: first, a skeleton and joint-kinematics module to unify bone proportions and motioncalculations; second, an export module that supports headless frame-by-frame rendering and callsa command-line transcoder to composite the video and mix in the voiceover. The spec must specify:unified bone proportions, line widths, and coordinate origins; joints may only rotate in thepredefined way; each action must be described with an easing function; scene durations must beconfigurable; final export at 1920x1080 resolution, 60fps, H.264 encoding; a 15-second clip mustexport 900 frames.
Once the skill package is in place, scenes and actions are reduced to pure data, and the part that actually needs “creation” is compressed to a minimum.
Below is the scene data module scenes.js from the runnable example:
// scenes.jsmodule.exports = {scenes: [{duration: 5, // secondspose: { armL: 30, armR: 30, lean: 0 },text: "Monthly quota burns fast",},{duration: 5,pose: { armL: 130, armR: 20, lean: -8 },text: "Faces break, characters clash",},{duration: 5,pose: { armL: 40, armR: 140, lean: 6 },text: "One line edit means re-rendering",},],};
The three scenes total 15 seconds. At 60fps:
15 seconds x 60fps = 900 frames
Transitions between poses should be controlled by easing functions in the full skill package, to avoid mechanical, constant-speed motion:
const ease = {linear: t => t,inOutCubic: t => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2),outBack: t => 1 + 2.70158 * Math.pow(t - 1, 3) + 1.70158 * Math.pow(t - 1, 2),};
6. Step 3: Solidify the Export Pipeline so the Example Actually Runs
The example below provides a minimal runnable pipeline. It reads scenes.js, generates PNGs frame by frame through Puppeteer, then calls ffmpeg to composite the video and mix in the voiceover.
6.1 Prepare the voiceover file voice.wav
The voiceover can be generated with a text-to-speech tool or recorded locally. Recommended:
- File name:
voice.wav - Duration: close to 15 seconds, or slightly shorter;
- Sample rate: 44100 Hz or 48000 Hz;
- Format: WAV.
If you don’t have a voiceover yet, you can first use ffmpeg to generate 15 seconds of silence to get the pipeline running:
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -t 15 voice.wav
For real production, replace it with the actual voiceover.
6.2 Minimal render module render.js
// render.jsconst fs = require("fs");const path = require("path");const puppeteer = require("puppeteer");function sceneAt(scenes, t) {let acc = 0;for (const s of scenes) {acc += s.duration;if (t < acc) return s;}return scenes[scenes.length - 1];}function xmlSafe(str) {return String(str || "").replace(/[<>&']/g, c => ({"<": "<",">": ">","&": "&","'": "'",}[c]));}function svgForFrame(scene) {const pose = scene.pose || {};const armL = Number(pose.armL || 0);const armR = Number(pose.armR || 0);const lean = Number(pose.lean || 0);const text = xmlSafe(scene.text || "");return `<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080"><rect width="100%" height="100%" fill="#0f172a"/><text x="120" y="220" fill="#ffffff" font-size="72" font-family="sans-serif">${text}</text><g transform="translate(960 420) rotate(${lean}) scale(5)"><line x1="0" y1="0" x2="0" y2="-80" stroke="#fff" stroke-width="3"/><circle cx="0" cy="-96" r="14" fill="none" stroke="#fff" stroke-width="3"/><g transform="translate(0 -65) rotate(${armL})"><line x1="0" y1="0" x2="-38" y2="0" stroke="#fff" stroke-width="3"/><line x1="-38" y1="0" x2="-60" y2="20" stroke="#fff" stroke-width="3"/></g><g transform="translate(0 -65) rotate(${armR})"><line x1="0" y1="0" x2="38" y2="0" stroke="#fff" stroke-width="3"/><line x1="38" y1="0" x2="60" y2="20" stroke="#fff" stroke-width="3"/></g><line x1="0" y1="0" x2="0" y2="70" stroke="#fff" stroke-width="3"/><line x1="0" y1="0" x2="-24" y2="70" stroke="#fff" stroke-width="3"/><line x1="0" y1="0" x2="24" y2="70" stroke="#fff" stroke-width="3"/></g></svg>`;}async function renderFrames({ scenes, fps, totalFrames, outDir }) {fs.mkdirSync(outDir, { recursive: true });const browser = await puppeteer.launch({headless: true,args: ["--no-sandbox"],});const page = await browser.newPage();await page.setViewport({width: 1920,height: 1080,deviceScaleFactor: 1,});for (let i = 0; i < totalFrames; i++) {const t = i / fps;const scene = sceneAt(scenes, t);const svg = svgForFrame(scene);await page.setContent(svg, { waitUntil: "load" });const name = `frame_${String(i).padStart(5, "0")}.png`;await page.screenshot({ path: path.join(outDir, name) });}await browser.close();}module.exports = { renderFrames };
This minimal implementation uses SVG to simplify drawing the stickman, in order to demonstrate the complete chain of “scene data → frame-by-frame images → video.” The full skill package can be replaced with Canvas, SVG animation, or a more complex skeleton system, but the export logic stays the same.
6.3 Export script export.js
// export.jsconst path = require("path");const { execFileSync } = require("child_process");const { scenes } = require("./scenes");const { renderFrames } = require("./render");const FPS = 60;// 15 seconds x 60fps = 900 framesconst totalFrames = scenes.reduce((sum, s) => sum + Math.round(s.duration * FPS),0);(async () => {const stamp = new Date().toISOString().replace(/[:.]/g, "-");// Use a timestamp directory to avoid overwriting previous frame filesconst outDir = path.join(process.cwd(), `frames-${stamp}`);const output = path.join(process.cwd(), `out-${stamp}.mp4`);await renderFrames({scenes,fps: FPS,totalFrames,outDir,});execFileSync("ffmpeg", ["-y", // Overwrites same-named output, so a timestamped name is used here"-framerate", String(FPS),"-i", path.join(outDir, "frame_%05d.png"),"-i", "./voice.wav","-c:v", "libx264","-pix_fmt", "yuv420p","-crf", "18","-c:a", "aac","-shortest",output,], { stdio: "inherit" });console.log("Output file:", output);})().catch(err => {console.error(err);process.exit(1);});
Run it like this:
node export.js
After a successful run, the current directory will contain something like:
out-2025-01-01T10-00-00-000Z.mp4
along with a frames-... directory containing 900 PNGs.
Note: the -y parameter in ffmpeg overwrites output files with the same name. The example already uses a timestamp directory and a timestamped output file; for real production, it’s best to keep a backup strategy to avoid accidental overwrites.
7. Results and Costs: Where the Savings Come From, and Where the Capability Ends
In terms of output, once the skill package is in play, the head-to-body proportions and line widths stay consistent across scenes, transitions are natural, and the scene and logic layers are clearly separated, making changes and reuse easy. The overall look may not match a polished 2D animation, but as an explainer short with high information density and a fast update cadence, it’s already stable and reliable enough.
In terms of cost, it’s important to distinguish two kinds of resources: compute resources and the AI coding tool’s usage resources. The main expense of code-driven animation is the local compute needed for rendering — a one-time hardware investment with relatively low marginal cost for repeated production. Generative video compute, by contrast, is billed by the cloud on demand, so every extra clip means another bill.
The author’s real-world results for a single clip:
- Spec: 15 seconds, 60fps, 1920×1080, 900 frames total;
- Cost: about $0.54, mainly from the AI coding tool’s understanding, coding, and debugging calls;
- Comparison: for the same information density, repeatedly “gacha-rolling” with a generative model often costs several times this per clip — not even counting the time cost of rework.
The cost basis needs a special note, so that $0.54 and $16 aren’t mistaken for universal results:
- Number of clips per month: Assuming 30 15-second clips per month, 30 × $0.54 ≈ $16.2, which roughly matches the $16 monthly bill mentioned here.
- AI coding tool billing: The $0.54 mainly includes tool calls, code generation, and debugging costs; different tools and different plans significantly affect the unit price.
- Local compute and electricity: The example doesn’t count local electricity or hardware depreciation. If counted, an ordinary office computer’s monthly electricity cost is usually low, but it should be stated honestly.
- Rework rate: Changing dialogue no longer requires regenerating model assets, but it still needs re-rendering and re-export, which incur local compute and possible tool-call costs. If there’s an average of 0.5 re-renders per clip, the monthly cost may be slightly higher than $16, but still well below $86.
- Asset licensing costs: If voiceover, music, fonts, or textures are purchased, they need to be counted separately.
A simplified table compares three approaches:
| Approach | Main cost | Rework cost | Best fit |
|---|---|---|---|
| Generative video | Billed by the second or call; quotas are easy to overspend | Broken faces, mixed-up characters, and dialogue changes can all require re-rolling, at high cost | Realistic people, complex lighting, real scenes |
| Code-driven animation | Local compute, AI coding tool calls | Dialogue changes need re-rendering, but no model assets are generated | Explainers, knowledge content, episodic shorts |
| Hybrid approach | A little generated footage + a code-animation main body | Smaller rework scope, predictable cost | Intro atmosphere + main explanation |
If you move production capacity to the cloud for batch scheduling, you can also combine general cloud services like object storage, message queues, logging, and monitoring/alerting: tasks enter a queue and are consumed in parallel by rendering nodes, outputs are returned to storage, and failed tasks enter retry and alert workflows. This scales horizontally and makes overall costs easier to control.
But the boundary must be clear: code-driven animation excels at “explaining clearly,” not at “looking real.” For realistic people, complex lighting, or real-scene camera moves, you still need generative models or even a 3D rendering pipeline. A more practical approach is hybrid orchestration: use a generative model to produce a few atmosphere clips or intro shots, and let code-driven animation handle the main explainer, with the two balanced by cost and benefit.
8. Conclusion: Hand the Deterministic Visuals to Code
What’s really worth borrowing from this practice isn’t the specific “stickman” topic, but a way of thinking: whatever can be described by rules and data should be handed to code for deterministic execution, leaving only the parts that genuinely need creativity to the model.
The next time you’re frustrated by a video-generation bill, start by asking yourself: does this shot really have to come from “gacha-rolling”? If the answer is “no,” then writing the bones, proportions, scenes, durations, and export scripts into a skill package may be more stable, cheaper, and more repeatable than continuing to expand your generative-video budget.
