This small Python script recursively transcribes entire video folders with Whisper — locally, privately, and without paying for a transcription API.

Video is a terrible archive format.
Not because video itself is bad.
Because once you have enough of it, finding anything inside it becomes painful.
A folder containing fifty videos might contain hours of useful information.
A tutorial you recorded.
A screen capture.
A meeting.
An old presentation.
A demo.
A lecture.
Somewhere inside one of those files is the exact sentence or idea you’re looking for.
But your file system can’t search spoken words.
So unless you remember which video contains it — and approximately where — the information may as well be invisible.
I kept running into this problem with my own video files.
And I didn’t really want another cloud service where I would:
- upload the video,
- wait for processing,
- download the transcript,
- repeat for every file,
- potentially pay based on minutes processed.
I already had the videos.
I already had a computer.
And Whisper can run locally.
So I built a small Python script that does exactly what I wanted:
Point it at a folder and transcribe every video inside it.
No cloud API.
No account.
No per-minute fee.
And the videos never need to leave the machine.
The Real Problem Wasn’t Transcribing One Video
Transcribing a single video with Whisper isn’t particularly difficult.
There are plenty of ways to do it.
The problem starts when you have something like this:
Videos/
├── tutorials/
│ ├── docker-intro.mp4
│ ├── nginx-setup.mp4
│ └── postgres-demo.mov
│
├── recordings/
│ ├── meeting-01.mkv
│ └── meeting-02.mp4
│
└── old-projects/
├── demo.avi
└── walkthrough.webm
I didn’t want to manually type a command for every video.
And I definitely didn’t want to flatten my existing folder structure just to process them.
What I wanted was:
Start here. Search everything underneath it. Transcribe whatever still needs transcription.
That’s what transcribe_folder.py does.
The script recursively scans the directory and its subdirectories for common video formats, including:
- MP4
- MOV
- MKV
- AVI
- WMV
- FLV
- WebM
- MPEG
- MPG
- M4V
For each video it finds, Whisper generates a plain-text transcript.
The Transcript Lives Beside the Video
I deliberately kept the output structure simple.
If the input file is:
tutorials/docker-intro.mp4
the transcript becomes:
tutorials/docker-intro.txt
No separate transcript database.
No proprietary library format.
No application required to read it later.
Just a UTF-8 text file sitting beside the original video.
That gives me something extremely useful almost for free:
my existing video archive becomes searchable using normal file tools.
Depending on the operating system and indexing setup, those text files can then be searched with tools like:
- Windows Search
grepripgrep- IDE search
- desktop indexers
- scripts
- knowledge-management tools
- local AI workflows
The transcription isn’t the final product.
It’s the layer that makes the rest of the archive usable.
It Doesn’t Transcribe Everything Again Every Time
Batch tools have an annoying failure mode.
You run them once.
Half the folder finishes.
Something crashes.
Then you restart the process and the application begins again from zero.
I didn’t want that.
So before transcribing a video, the script checks whether a matching .txt transcript already exists.
If it does, that video is skipped.
Imagine the first run finds 100 videos.
You successfully transcribe 73 before stopping the script.
The next run doesn’t need to redo those 73.
It can continue with the remaining files.
That also makes the script useful as the video archive grows.
Drop five more videos into one of the directories.
Run the same command again.
The existing transcripts are ignored and only the new files need processing.
Simple state management:
the transcript itself is the state.
Unless I Actually Want to Re-Transcribe Something
Sometimes skipping existing files isn’t what you want.
Maybe you previously used the tiny Whisper model and now want better accuracy with medium.
Maybe you used automatic language detection and want to explicitly force English.
Or maybe the transcript simply wasn’t good enough.
For that, the script includes a --force option.
For example:
python transcribe_folder.py "./videos" --force
Existing transcript files can then be regenerated rather than skipped.
It’s a small option, but it’s useful because transcription quality is not static.
You can generate quick transcripts first and replace them later with higher-quality versions.
Whisper Gives You a Speed vs. Accuracy Choice
OpenAI Whisper comes in multiple model sizes:
tinybasesmallmediumlarge
The smaller models require fewer resources and generally run faster.
The larger models demand more compute but can produce better transcription results.
My script defaults to the medium model, but you can choose another model directly from the command line.
For example:
python transcribe_folder.py "./videos" --model small
Or:
python transcribe_folder.py "./videos" --model large
That means I don’t need separate scripts for different machines or workloads.
I can use a lighter model when I care about speed and increase the model size when transcription quality matters more.
The Script Checks the Machine Before You Start
One issue with local AI tools is knowing what model your machine can realistically handle.
Downloading the biggest model because “bigger must be better” isn’t particularly helpful if your hardware can’t run it efficiently.
So the script includes a hardware advisory step.
It looks at the available hardware, including CUDA GPU memory when available or system RAM, and recommends an appropriate Whisper model size.
The idea isn’t to automatically make every performance decision for you.
It’s more of a guardrail.
Before committing to a long batch transcription job, you get a better idea of what is reasonable for the machine you’re using.
That matters much more when processing dozens or hundreds of videos than when testing a single two-minute clip.
If You Have an NVIDIA GPU, Use It
Whisper inference can be computationally expensive.
Running it entirely on a CPU works, but processing a large video collection can take time.
If the machine has a compatible NVIDIA GPU and PyTorch with CUDA support, the script can route Whisper inference through CUDA.
You can explicitly request it:
python transcribe_folder.py "./videos" --model large --device cuda
Or force CPU execution:
python transcribe_folder.py "./videos" --model small --device cpu
If no device is explicitly provided, the script can detect CUDA availability and select the appropriate execution path.
This is where local transcription becomes especially interesting.
A GPU that might normally sit idle can spend a few hours converting an old video collection into searchable text.
No API bill accumulating in the background.
Language Detection Is Optional
Whisper can identify the spoken language itself, so for many collections you don’t have to specify anything.
But automatic detection isn’t always what I want.
If I know every file in a directory is English, I can explicitly tell the script:
python transcribe_folder.py "./videos" --language English
That becomes even more useful when organizing collections by language.
For example:
recordings/
├── english/
├── french/
└── spanish/
Each directory can be processed with an explicit language when needed.
One Broken Video Shouldn’t Kill the Entire Queue
Batch processing always eventually encounters the weird file.
A damaged video.
A codec FFmpeg doesn’t like.
An incomplete recording.
Something created fifteen years ago by software you’ve forgotten existed.
If one of those files crashes the entire job, the script isn’t very useful.
So transcribe_folder.py is designed to continue when an individual video fails.
The failed file is reported, and processing continues with the next video in the queue.
Again, this isn’t a glamorous feature.
But these boring details are what separate:
I can transcribe a video.
from:
I can point this at an actual archive and leave it running.
At the End, I Want a Summary
After a batch finishes, the script prints a simple report.
Something like:
============================================================
SUMMARY
============================================================
Total videos found: 42
Successfully transcribed: 37
Skipped (already done): 4
Failed: 1
Total execution time: 58m 21s
============================================================
That gives me enough information to know whether I need to investigate anything without scrolling through an hour of terminal output.
For a utility like this, that’s enough.
I don’t need an analytics dashboard.
I need to know:
Did it finish?
Why Local Transcription?
The obvious question is:
Why not just upload the videos to an online AI transcription service?
For plenty of situations, that’s completely reasonable.
Cloud transcription can be extremely convenient.
But local processing has some advantages that matter to me.
Privacy
A private recording doesn’t need to leave the computer just because I want to search what was said inside it.
This can matter for:
- personal recordings
- internal meetings
- unpublished videos
- client material
- research
- private archives
The script uses the open-source Whisper model locally. It doesn’t require an external transcription API.
Cost
There is no per-minute cloud transcription charge.
The cost is the electricity and compute time of the machine already doing the work.
For one short recording, that difference may be irrelevant.
For hundreds of hours of archived video, it becomes more interesting.
Automation
The important part for me is that this is a script.
I can put it into another workflow.
I can schedule it.
I can modify it.
I can process network storage.
I can run another command against the generated transcripts.
The transcription isn’t trapped inside a service.
It’s just another step in a pipeline.
Search Is Only the Beginning
This is where the project becomes more useful than it initially appears.
Once a video becomes text, it becomes compatible with an enormous number of tools.
Imagine a collection containing years of tutorials or recorded meetings.
After transcription, I could:
Search everything
rg "PostgreSQL backup" ./videos
Summarize old recordings with an LLM
Instead of sending a multi-gigabyte video somewhere, I can work from its text representation.
Build a local knowledge base
The transcript can be indexed alongside Markdown files, PDFs, notes, and documentation.
Generate descriptions
Old video content can become the basis of documentation, blog posts, YouTube descriptions, or internal notes.
Find forgotten information
The original filename may tell me almost nothing.
The transcript tells me what is actually inside the recording.
This is one reason I increasingly like workflows that turn opaque media into open formats.
A video is difficult to inspect automatically.
A .txt file is incredibly easy.
Setup Is Pretty Small
The project lives in my public Atomik Scripts repository.
You’ll need:
- Python 3.9 or newer
- FFmpeg
- OpenAI Whisper
- PyTorch
psutil
FFmpeg is used by Whisper to decode the video and audio streams.
Clone the repository:
git clone https://github.com/atomikfactory/atomik-scripts.git
cd atomik-scripts
Create a virtual environment:
python -m venv .venv
On macOS or Linux:
source .venv/bin/activate
Then install the main dependencies:
pip install torch
pip install -U openai-whisper psutil
If you’re running Windows with a supported NVIDIA GPU, install the appropriate CUDA-enabled PyTorch build instead. The repository README includes an example CUDA setup.
Then Point It at a Folder
The basic command is:
python python/video/transcribe_folder.py "/path/to/videos"
Or from inside the script directory:
python transcribe_folder.py "/path/to/videos"
That’s really the workflow.
The script finds the videos.
Whisper transcribes them.
The transcripts are written next to the original files.
Existing transcripts are skipped.
And at the end, you get a report showing what happened.
This Is Exactly the Kind of Script I Like Building
There is no UI.
No SaaS.
No authentication.
No database.
No monthly plan.
It’s a Python script that does one job.
And I think that’s part of its appeal.
A lot of useful automation doesn’t need to become a product.
Sometimes the correct solution is simply:
folder of videos
│
▼
Python script
│
▼
Whisper
│
▼
folder of searchable transcripts
A few hundred lines of code can remove a repetitive task permanently.
That’s a pretty good trade.
Video Archives Should Be Searchable
The more digital content I accumulate, the more I care about whether I can actually retrieve information from it later.
Saving something isn’t the same as preserving its usefulness.
A video sitting on a NAS for ten years is technically preserved.
But if I can’t remember what’s inside it, much of its value is lost.
Transcription changes that.
The original video remains exactly where it was.
But now it has a searchable text companion.
And because Whisper can run locally, I don’t have to choose between:
keeping the archive private
and
making the archive searchable.
I can do both.
That’s why I built this script.
Not because video transcription is new.
But because I wanted the simplest possible workflow for pointing at a folder and saying:
Turn all of this into searchable text.
Atomik Factory is where I document the tools, scripts, experiments, and software I build for everyday use — around AI, technology, automation, privacy, finance, and productivity.
Most projects start with a problem I keep encountering.
Then I build the smallest thing that makes it disappear.
Build. Learn. Share.
If you have a folder full of videos that you’ve been meaning to organize someday, the local transcriber is available in the Atomik Scripts repository on GitHub.
And once those videos become searchable text, you may discover that the archive contains more useful information than you remembered.