Skip to main content

Featured

Free Text-to-Speech for YouTube Videos: My Kokoro TTS Pipeline

Every tutorial and Short on my YouTube channel Omilabs is narrated by a synthetic voice. I don't record my own voiceover for these videos. The narration comes from a script that turns each line of text into audio, and that script runs on Kokoro, a small open-weight text-to-speech model. In this post I explain how I set it up, the problems I hit, and the checks I now run so the voice sounds clean and stays consistent across more than a hundred videos. Why I Picked an Open TTS Model When you make one video, a paid voice tool is easy. When you make a full series of long episodes plus many Shorts, and you rebuild the audio every time a script line changes, a few things start to matter more: Re-runs cost nothing. I edit scripts often. With a local model I can regenerate a whole episode as many times as I want. It runs anywhere. The model is small enough to run on a normal CPU, including a free GitHub Actions runner, which is where my videos are rendered now. The output is rep...

Whisper Captions and QA Gates: How I Check AI-Made Videos

When you make videos with code instead of a video editor, you lose one thing a human editor gives you for free: someone actually watching the result. A render can finish without errors and still have a voice that drops a word, a caption that drifts half a second late, or a scene that sits on screen far too long. On my YouTube channel Omilabs, every tutorial and Short is generated by a script, so I had to build that "someone watching" into the pipeline itself.

This post explains how I use Whisper for captions and as a listening check, and how a few simple quality gates decide whether a video is allowed into the upload queue at all. Everything here runs on free, open tools.

Why automated videos need automated checks

My pipeline goes from a written script to a voice track (Kokoro, an open text-to-speech model), then to a timeline, then to a Remotion render. Each step can fail quietly:

  • The TTS model can mispronounce or skip a word, especially product names and numbers.
  • Audio can come out too quiet or clip at the peaks.
  • A scene can run longer than planned because the sentence inside it was long.
  • The render can finish with a missing asset or a blank frame.

None of these throw an error. The only way to catch them at scale is to measure the output and compare it with what I intended. I treat it like testing software: the video is the build, and the checks are the test suite.

Step 1: Whisper as captions and as an "ear"

Generating captions

I run faster-whisper, an efficient re-implementation of OpenAI's Whisper speech recognition model, on the final audio. It returns segments with start and end times, and it can also return word-level timestamps. From that I write a standard SRT subtitle file, which I upload to YouTube alongside the video.

A few practical tips from my runs:

  • Use the script to fix spellings. Whisper hears "Bolna" or "ElevenLabs" in different ways. Since I already have the exact script, I correct known terms after transcription rather than trusting the raw output.
  • Word timestamps drive on-screen text. In my Shorts, the word currently being spoken is shown near the top of the frame. That only works if the word timings are accurate, which is another reason to check them.

Using Whisper to listen back

The more useful trick is using the same transcript as a test. I compare what Whisper heard with what the script said. If the two match closely, the voice track is clear and complete. If they do not, something went wrong: a skipped sentence, a garbled name, or audio that is too muddy to understand.

The comparison does not need to be clever. I normalise both texts (lowercase, remove punctuation, expand numbers into words), then compute a similarity score between the two word sequences. My rule for Shorts is that this score must be at least 0.85. Below that, the video does not pass, and I listen to it myself to see why.

This check is honest about its limits. A high score means the words are there and understandable; it says nothing about whether the explanation is good. It is a floor, not a judge of quality.

Step 2: Loudness and peaks

Viewers notice volume before they notice anything else. A video that is much quieter than the one before it feels broken. I measure every final audio track with ffmpeg's loudnorm filter, which reports integrated loudness (in LUFS) and true peak (in dBTP).

My targets are:

  • Integrated loudness around −14 LUFS, a level commonly used for online video platforms.
  • True peak at or below −2 dBTP, so there is headroom and no clipping after the platform re-encodes the audio.

If the measurement is off, the pipeline runs a second normalisation pass and measures again. Only the measured result counts, not the intended setting.

Step 3: Pacing and length rules

Short-form video lives or dies on pace. My style rules say a new visual should appear every 2 to 4 seconds, and a Short should be between 15 and 40 seconds long. Because each scene in my specs is tied to a spoken "beat", I can check pacing directly from the timeline before rendering:

  • Total duration inside the allowed range.
  • No single beat longer than 6.5 seconds, because a long beat means one visual stays on screen too long.

This rule has caught real problems. One Short in my ElevenLabs series had a beat that ran almost 10 seconds because one sentence was too long. Instead of letting it slip through, I excluded it from the queue until the script is split into shorter beats. Another Short ran slightly over 40 seconds; I reviewed it, decided the pacing was fine, and accepted it manually. The point of a gate is not to be rigid. It is to make sure a person decides on every exception.

Step 4: Render and visual checks

After Remotion renders the video, I check the file itself with ffprobe: correct resolution (1920x1080 for long videos, 1080x1920 for Shorts), expected frame rate, an audio stream present, and a duration that matches the timeline.

For visuals, I export a contact sheet, a single image made of frames sampled across the video. Automated checks look for obvious issues like near-empty frames; the contact sheet is what I or a review step look at by eye.

Step 5: One audit file decides upload

Every Short gets an audit.json file with four true/false results:

  1. pass_audio for loudness, peaks, ASR match and beat length.
  2. pass_render for file, resolution and duration checks.
  3. pass_visual_auto for automated frame checks.
  4. pass_visual_review for the contact sheet review.

My upload script on GitHub Actions reads this file and only schedules a Short if all four are true. That separation is important. The uploader does not need to know how quality is measured; it only trusts the audit result. If I improve a check later, the uploader does not change.

What this does not catch

I want to be clear about the limits, because automated QA can create false confidence:

  • It cannot tell whether a tutorial is accurate. For that, every script is grounded in official documentation before it is written.
  • It cannot tell whether a hook is interesting. That comes from looking at real viewer data, such as how many people keep watching a Short.
  • It cannot judge taste. A video can pass every gate and still be boring.

The gates remove the embarrassing mistakes so that my own attention goes to the things only a person can judge.

How to start your own version

If you generate videos with code, you do not need my whole setup. Start small:

  1. Transcribe your final audio with faster-whisper and save an SRT file.
  2. Compare the transcript with your script and flag anything below a match threshold you choose.
  3. Measure loudness with ffmpeg and normalise to a consistent target.
  4. Write the results to one small JSON file per video, and let your upload step read only that file.

Conclusion

Automating video production is not only about rendering faster. It is about trusting what you publish without watching every second yourself. Whisper gives my pipeline an ear, ffmpeg gives it a volume meter, the timeline gives it a sense of pace, and a single audit file turns all of that into a clear yes or no. It is not perfect, but it means every video on Omilabs has been checked in the same way before it goes live.

Written by Omkar Vijay Ghate, Mumbai.

Comments

Adsterra Have a blog? Monetize it with Adsterra (referral link)