techstackbro avatar
@techstackbro
ai se video kaise banaye · part 3 ▶ part 3 reel dekho

Animation kaise kaam karta hai (code se video)

Reel mein promise kiya tha: ready mobile scene template. Ye raha. Download karo, apne brand ke rang daalo, aur reel ke scenes code se banao.

Na After Effects, na timeline pe drag-drop 🎬

series · part 3 of 5

AI se video kaise banaye

Ye guide part 3 ka hai. Pehle reel dekho, phir yahan se step by step karo.

  1. 1Poora setup: Claude Code + exact prompt + free voice clone
  2. 2Apna 2D character kaise banaye
  3. 3Animation kaise kaam karta hai (code se video)tum yahan ho
  4. 4Captions perfectly sync kaise hote hain
  5. 5Ek reel ka asli kharcha, aur free mein kaise banayejaldi aa raha
raaz

Video = frames

Video asal mein photos ki line hai. Reel mein 30 photos har second. 6 second ka reel = 180 photos. Animation bas itna hai: har photo mein cheez thodi si alag jagah ya alag size pe.

  1. Har frame ek web page hai. Remotion mein scene React se likhte ho. Page ko bas ek cheez pata hoti hai: abhi kaunsa frame hai.
  2. Headless browser kholta hai. Chrome bina window ke, frame 0, 1, 2... har ek ko load karta hai aur screenshot leta hai.
  3. Sab jod ke MP4. Saare screenshots aur awaaz ko FFmpeg ek video mein silta hai.
pura animation, 2 line mein
// frame = 0, 1, 2 ... 179
const frame = useCurrentFrame();
// frame 15 pe 0 se 1 tak jaata hai, thode bounce ke saath
const pop = spring({ frame: frame - 15, fps: 30 });

Phir scale(pop) laga do: cheez frame 15 pe uchhal ke aati hai. Har frame same code, sirf frame number badalta hai. Isliye result har baar same aata hai.

Gehraai mein padhna hai? Remotion fundamentals dekho.

step 1 · timing trick

Cheez us word pe aaye jab bola jaaye

Reel tab "professional" lagta hai jab number wahi pal aata hai jab tum number bolte ho. Iske liye har word ka time chahiye. Whisper (free) awaaz sun ke deta hai:

words.json
[
  { "word": "Five", "start": 0.20, "end": 0.50 },
  { "word": "tips", "start": 0.50, "end": 0.85 },
  ...
]

Template mein ek chhota helper hai: word ka number do, frame milta hai.

src/timing.ts (template se)
export const atWord = (n: number, fallbackSec = 0) => {
  const w = WORDS[n];
  return w ? sec(w.start) : sec(fallbackSec);
};

// scene mein:
<Title text="5 tips for better reels" at={atWord(0)} />
<BigNumber to={5} at={atText("tips")} />
<Sticker text="save this" at={atText("pop.", 1.75)} />
Abhi voiceover nahi hai? Koi baat nahi. Har helper ek fallback seconds leta hai, aur template ek demo words.json ke saath aata hai, toh bina awaaz ke bhi render ho jaata hai.
step 2 · download

Ready mobile scene template

1080x1920, 30fps, Remotion + TypeScript. Ek "5 tips" example scene ready hai.

⬇ reel-scene-template.zip ~55 KB, MIT licence

Andar kya hai

3 commands

Pehle Node.js install ho. Zip kholo, us folder mein terminal kholo:

terminal
npm i
npx remotion studio
npx remotion render

studio browser mein live preview kholta hai. render composition poochta hai aur out/ mein MP4 bana deta hai.

Render pe "browser not found" aaya?

Apna Chrome use karwa do (Mac pe):

npx remotion render Scene out/scene.mp4 --browser-executable="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

Template MIT hai. Remotion ka apna licence hai: individuals aur chhoti teams ke liye free, badi company ho toh remotion.dev/license dekh lo.

step 3 · asli game

Apne brand mein badlo

Saare rang aur font ek hi file mein hain. Isko badlo, pura template re-skin ho jaata hai:

src/brand.ts
export const brand: Brand = {
  colors: {
    bg: "#F5F5F2",      // background
    surface: "#FFFFFF", // cards, captions
    text: "#14161A",
    accent: "#2B6CF6",  // number, highlight word
    accent2: "#12B886", // stickers
  },
  font: "Inter",        // ya "SpaceGrotesk", ya apna Google font
  radius: 32,           // 0 = sharp corners
  shadow: true,
  handle: "@yourhandle",
};

Khud nahi karna? Template folder mein Claude Code kholo aur ye prompt paste karo. Brackets [ ] bharo:

make it mine · paste in claude code
I downloaded this reel scene template (Remotion, 1080x1920 vertical). Make it mine.

MY BRAND (fill these in)
- Colours: background [#...], cards [#...], text [#...], accent [#...], second accent [#...]
- Font: [any Google font, e.g. Poppins]
- Handle: [@yourhandle]
- Character: [an image in public/, e.g. public/me.png, OR describe one: "a simple SVG cat with round glasses"]
- Scenes I want: [e.g. 1) hook with a big number, 2) three tips one by one, 3) follow call to action]
- Voiceover: [public/vo.wav + public/words.json from Whisper, OR "no audio yet, time it in seconds"]

WHAT TO DO
1. Read README.md and everything in src/ first.
2. Re-skin only through src/brand.ts (add my font in src/fonts.ts). Do not hard-code colours or fonts inside components.
3. Put my character inside CharacterSlot.
4. Build my scenes as new compositions in src/Root.tsx, reusing the existing components. Every element pops in on the word where it is spoken, using atWord / atText from src/timing.ts.
5. Keep all text, numbers and faces inside SAFE_BOX from src/layout.ts. Do not change the safe zone values.
6. Render a still of each scene, once with debugSafeZones on and once off (npx remotion still). Look at every image yourself and fix: text overflowing, things overlapping, low contrast, anything inside the red zones. Then show me the stills.
7. After I say ok, render the MP4 with npx remotion render.
Stills dekh ke seedha bolo: "number bada karo", "sticker left mein le jao", "caption thoda upar". 2 se 3 rounds mein apna look set ho jaata hai.
safe zones

Instagram tumhara reel dhak deta hai

Reel ke upar Instagram apne buttons aur caption chipka deta hai. Agar tumhara text wahan hai, toh koi padh nahi paayega. Template mein ye zones pehle se set hain (approx, phone aur app version ke hisaab se thoda badalte hain):

zonesizewahan kya hai
upar~220pxReels header, camera icon
neeche~380pxusername, caption, audio, comment box
right~120pxlike, comment, share, save
Template scene with red overlays marking the top, bottom and right areas that Instagram covers, and a green safe box in the middle

Laal = Instagram ka UI yahan aa sakta hai. Hara dabba = safe. Check karne ke liye: --props='{"debugSafeZones":true}'

preview

Same scene, 2 brands

Code ek hi hai. Sirf brand badla:

Clean light preset: blue number 5 on a white card, light background
clean light · Inter
Bold dark preset: yellow number 5 on a dark card, dark background
bold dark · Space Grotesk
aage kya

Series mein aage aa raha hai

Miss na ho, isliye follow kar lo 🔔

Ye "AI se video kaise banaye" series ka part 3 hai. Setup nahi kiya? Part 1 se shuru karo. Character chahiye? Part 2.

follow karo @techstackbro 👀