Back to Blog

I Built My Own AI B-Roll Tool — Here's What Script-to-Video Automation Actually Looks Like Under the Hood


Search "AI B-roll" right now and you'll get the same article fifty times over: a ranked list of platforms, a pricing table, a "best for beginners" pick. What you won't find much of is anyone explaining what actually happens when a script goes in and matching footage comes out. So I'm going to show you, using my own tool as the example — because I built one, and I can open the hood.

The tool is called Sceneflow. It reads a script, works out what each sentence is showing, and finds real stock footage that matches — automatically, one clip per line, saved as a single ordered ZIP. Here's exactly how that works, why it's different from most of what's being sold as "AI video" right now, and where it doesn't work as well.

What "AI B-Roll" Actually Means (It's Not One Thing)

The term gets used for two completely different things, and most articles mix them up:

Sceneflow is the second kind. That's a choice I made on purpose, not something I'm making excuses for — more on why further down.

The Real Problem: It's a Search Problem, Not a Video Problem

Before any AI is involved, here's what finding footage for a script looks like by hand: read a sentence, guess a search term, type it into a stock site, scroll, open a few tabs, download one, rename it so you remember which line it belongs to, move to the next sentence. Do that for every line of a two-minute script and you've lost most of an hour before you've even started editing.

The one thing that matters here: every sentence in a script already tells you what to search for. A person just has to turn it into a search word by hand — one line at a time. That step is the whole slow part, and it's exactly the kind of task a language model is good at.

How the Pipeline Actually Works

Sceneflow runs a script through four steps, all inside the browser — nothing gets uploaded to a server in between:

1. Split the script into sentences

Not just splitting on every full stop — short pieces under five words get joined to the sentence next to them, so a stray two-word line doesn't end up as its own leftover, hard-to-search scene.

2. An LLM turns each sentence into search words

This is the step that replaces the manual guessing. Each sentence goes to Groq's language model with a prompt shaped roughly like this:

// Simplified version of the actual prompt shape
const prompt = `
Read this sentence from a video script and return:
- primary: one visual search term (2-4 words) that
  best captures what's being described
- fallbacks: 2-3 broader alternative search terms
- safe: one generic term as a last resort

Sentence: "${sentence}"

Return only JSON: { primary, fallbacks, safe }
`;

That's it. No extra training, no special database, no complicated search system underneath. A well-written prompt sent to a fast model is enough to turn a sentence into something you could type into a search box — because that's really all the task needs.

3. Search, with automatic backup options

The first search word goes to the stock video service first. If it doesn't bring back enough usable clips, Sceneflow automatically tries the backup words, then the generic one, removing repeats along the way — so a sentence never comes up empty just because the first guess was too specific.

4. Pick clips and save them in order

You pick the clips that fit, and the whole selection downloads as one ZIP, each file named with its position and search word — so the footage arrives already sitting in script order, ready to drop into an editing timeline.

StepWhat it replaces
Splitting into sentencesDeciding by hand where one "scene" ends and the next begins
LLM search-word stepReading a line and guessing a search term yourself
Search + backup wordsTrying three different phrasings when the first search comes up empty
Ordered savingRenaming files so you remember which clip goes where

Where Matched Footage Beats Made-Up Footage

AI-made video is genuinely impressive right now, and it's the right tool for shots nobody could ever film — an impossible camera move, a made-up creature, a product that doesn't exist yet. But for most everyday narration — someone talking about a business problem, a lifestyle moment, an idea — made-up clips still tend to look a little off: skin that moves strangely, objects that bend at the edge of the frame, movement that's almost right but not quite.

Real stock footage doesn't have that problem, because it's real. The trade-off is that you're limited to what's actually been filmed. In practice, for most scripts, that limit barely shows — a good library has a shot for almost anything ordinary, and "ordinary" is most of what scripts are actually about.

Where This Approach Genuinely Falls Short

I'd rather tell you this straight than oversell it:


None of that is a reason to reach for a bigger, heavier tool. It's a reason to be honest about what problem you're actually solving. Most people staring at a finished script don't need made-up footage of things that don't exist — they need someone to stop making them read every line twice and type it into a search box themselves. That's a search problem, and search problems are exactly where an LLM does its best work.

Have a script-to-something workflow eating your time?

Sceneflow is free to search, preview, and download clips one at a time — a one-time license unlocks the full ZIP export. If your workflow needs something more specific than footage matching, that's the kind of custom automation I build.

Try Sceneflow