codecompany
All case studies

Nitro: an AI pipeline built for 25–30 history reels a day, from script to finished video

Nitro is a daily revision app for UPSC, SSC and banking aspirants, built on short cinematic reels. Its team needed 25 to 30 new videos a day, each starting as nothing more than a script. We built the AI production pipeline with them: a script goes in, and a finished Hindi video with characters, voices, dialogue and a thumbnail comes out.

Nitro is a revision app for students preparing for India’s competitive exams. Instead of three-hour lectures and 500-page PDFs, it teaches through short cinematic reels: a few minutes on the Mughal succession, the Treaty of Purandar, or how Ashoka’s empire fell apart.

That idea only works at volume. Nitro and its parent edtech company needed 25 to 30 new videos every day, each one starting as a script. We built the pipeline that turns one into the other.

Nitro on Google Play: daily revision reels for UPSC, SSC and banking, with 1 lakh+ downloads and a 4.5 rating. Nitro on Google Play: daily revision reels for UPSC, SSC and banking, with 1 lakh+ downloads and a 4.5 rating.

Six finished videos

Each of these started as a Hindi script and nothing else. Tap one to watch it in full, with sound. Every shot, voice, character and title card was made by the pipeline.

Shivaji, episode 6: Tokri se Palayan, the escape from Agra
Episode 8: Shivaji ka Ant aur Sambhaji ka Raj
Episode 5: Amitraghat, on Bindusara
Rajendra Chola: Ganga se Java tak
Gandhi, episode 1: South Africa, 1893
Episode 12: September 1939, and the end of an empire

What one video involves

A two-minute history reel in Hindi is made of 25 to 60 separate shots: wide views of forts and courts, close-ups of characters, a title card, and two or three moments where a character speaks a line on screen. Made by hand, that is a writer, an illustrator, a voice artist, an animator and an editor, for each video.

The pipeline replaces the production steps, not the writing. Nitro’s team still chooses the topic and writes the script. Everything after that is automated, with a person approving the work at the points where approval saves money.

Finished thumbnails from six videos made by the pipeline, each generated from the script alone. Finished thumbnails from six videos made by the pipeline, each generated from the script alone.

How a script becomes a video

Below, one real video is followed through every stage: the first minute of Agra ka Apmaan, about Shivaji’s visit to Aurangzeb’s court in 1666. Press play on any stage to hear it and watch it move.

Step 1: The script is the only input

Each video starts as one text file: the script, a scene-by-scene breakdown, rules, and things to avoid. The script is in Hindi, and a few simple markers tell the pipeline what is special.

input.txt

[sharply] लाल क़िला। दीवान-ए-आम। और एक मेहमान — जिसने भरे दरबार में बादशाह की आँख में आँख डाली।

Title Slate: शिवाजी और मराठा

Intro Slate: Aurangzeb: और औरंगज़ेब की पचासवीं सालगिरह थी।

Intro Slate: Shivaji: मिर्ज़ा राजा जय सिंह की संधि के बाद शिवाजी आगरा पहुँचे

Intro Slate: Sambhaji: और साथ नौ साल का संभाजी था।

…

Dialogue by Shivaji: [softly] "बादशाह सलामत, यह क़तार मेरी नहीं है।"

Title Slate marks the title card, Intro Slate a character’s first appearance, and Dialogue by a line a character says on camera. Cues like [softly] or [sharply] set how a line is delivered.

Why it matters: writers work in plain text, in the language of the video, without learning a tool. If a marker is missing or a speaker is unclear, the pipeline stops and asks instead of guessing and spending money on a wrong video.

Step 2: Cast the characters, straight from the script

Before any voice or picture exists, a language model reads the script and lists everyone in it. Each character gets a reference sheet: the same person from six angles, in period costume, on a plain background. A character seen at two ages gets two sheets.

The cast of this video, generated from the script alone: Shivaji, a nine-year-old Sambhaji, and Aurangzeb. The cast of this video, generated from the script alone: Shivaji, a nine-year-old Sambhaji, and Aurangzeb.

Why it matters: an image model has no memory. Without a reference, it invents a new face for the same king in every shot. Casting first means every later picture of Shivaji is drawn from the same sheet.

Step 3: Plan every shot

The same model turns the script into a plan: every scene in order, its type (a visual shot over narration, a character’s first appearance, a title card, or a character speaking), a concrete shot direction, and the model that should make it. The plan is checked against a fixed structure before anything is paid for.

Why it matters: a plan is text, so it is nearly free. Everything after it is paid for, image by image and second by second.

Step 4: Record the voice

The narration is generated in Hindi by a voice model that follows the cues in the script. This is the raw recording for the first part of this video.

Why it matters: the voice decides the rhythm of the whole video. Everything that follows is cut to it.

Step 5: Split the voice into scenes

A second model transcribes the recording back, word by word, with exact timings. That is enough to cut it into lines, one per scene. Each coloured section below is one future shot. Lines 13 and 15 are marked as dialogue: Shivaji will say them on screen himself.

Why it matters: these cut points are where the pictures will change. Getting them from the voice means a shot never changes in the middle of a word.

Step 6: Lay the voice on the video’s timeline

Each line becomes a block on the video timeline. The blocks are not always the same length as the voice: a shot needs room to breathe, and video models only make clips of certain lengths. The title card is inserted where the script asked for it, and the voice simply waits for it.

The result is first rendered as a timing preview: just coloured blocks and the real audio, before a single picture has been paid for.

Sample: the timing preview. What the reviewer actually watches at this stage: colour blocks, captions and the real voice.

Why it matters: most problems in a video are timing problems, and they are cheapest to catch when the video is still coloured blocks.

Step 7: Fill each block with a frame

An image model draws the opening frame of every block, using the cast sheets for anyone in it. These frames are reviewed as a still preview, with each block numbered, so a reviewer can say “redo 9” instead of describing a shot.

Sample: the still preview. Every frame numbered and labelled with its scene type, over the real voice.

Why it matters: a still image costs a fraction of a video clip. The expensive step only ever starts from a frame that is already approved.

Step 8: Turn each frame into a clip

Each approved frame becomes a moving clip. Scenes go to different video models depending on what they need: wide visual shots to one, title cards to another, and dialogue to a model that handles faces and lip movement. That model is given Shivaji’s line in Hindi, so in blocks 13 and 15 he actually says it.

Sample: one clip, straight from the video model. Shivaji's introduction: five seconds, before any editing.

Why it matters: no single video model is best at everything. Routing each shot to the right one gives better results and avoids paying for abilities a shot does not need.

Step 9: Lay the sound

Sound is built in lanes under the picture. The narration plays under each scene, trimmed at the pauses in the voice so no word is clipped. In dialogue scenes the narration steps aside and the character’s own voice, made with the clip, takes over. The title card brings its own sound design.

Why it matters: each sound is placed against the picture, not just laid underneath it. A line never runs into the next shot, and the voice never talks over a title card.

Step 10: Assemble, review by number, fix only what is wrong

Everything is stitched into one vertical video, locked to the length of the narration so nothing drifts out of sync. Here is the finished cut, with the same timeline underneath it.

Before a video goes out, a copy is made with each clip’s number burned into the corner. The reviewer flags a weak clip by number, and only that clip is made again.

One video at three stages. Top: the timing preview. Middle: the still preview, every block numbered. Bottom: the finished video. One video at three stages. Top: the timing preview. Middle: the still preview, every block numbered. Bottom: the finished video.

Sample: the review copy. Each clip carries its number and scene type, so a bad one can be named and redone. (From Shaap ki Wapsi.)
Sample: the finished video. The same stretch of Agra ka Apmaan as in the walkthrough above.

Why it matters: in generated video, a few shots in any batch come out wrong. Redoing two clips instead of the whole video is the difference between a small fix and starting over.

Step 11: Thumbnail and the app plug

The pipeline also makes the video’s thumbnail in the series’ style, and can add a short spoken plug for the Nitro app at the end. Each video is exported three ways: with the plug, without it, and the plug alone, so the same video can run in the app, on social channels and as an ad.

What it took to make 25–30 a day possible

  • Work in parallel. Up to 20 clips are generated at the same time, so a video’s dozens of shots do not wait in line.
  • Never stop on one failure. Every request is retried, and if a video model is unavailable the pipeline falls back to the next one on its list.
  • Stop before spending. The stages that cost money each need an explicit approval. “Continue” in passing does not count.
  • Know what everything cost. Every paid request is logged with its ID, so the cost of each video can be added up afterwards.
  • Keep every version. Each run is saved as a numbered version, so a redo never overwrites a video that was already approved.
  • Nothing story-specific in the code. Characters, shots and timings all come from the script and the plan, so the same pipeline makes a video on the Cholas as easily as one on Aurangzeb.

The result

Across nine finished history videos made with it, the pipeline produced 438 clips and 28 character sheets, with finished videos running about two minutes on average. Each one started as a single Hindi script.

For Nitro, the bottleneck moved from production to writing. The team decides what students should remember tomorrow, writes it, and the video follows.

More case studies
Get in touch