Back to blogYouTube Video

Published July 5, 2026

Auto caption your short videos (for free!)

Can't play the video or having issues? Here's the direct link.

AI Summary

This video demonstrates how to automatically add captions to short-form videos for free using a local AI model and FFmpeg. The method is designed to be accessible even for users with older hardware and those without a dedicated GPU, providing a cost-effective alternative to paid AI captioning tools.

Key Takeaways

  • Captions are essential for the performance of short-form video content.
  • Manual captioning is inefficient; AI tools are faster but often require subscriptions.
  • A free workflow exists by combining local AI models with FFmpeg for automated subtitle embedding.

Description

Book a call: https://calendly.com/itshassanaziz/discuss-a-project ==== ==== ==== Short-form videos perform best when they have captions (subtitles) embedded into them, but manually adding those subtitles is a horrible waste of time. You can use AI tools, but most of them are paid. Lemme teach you a way to do it for free. We're gonna use a local AI model and some ffmpeg magic to add captions to our shorts for free. And you can runen if you have an old machine without a dedicated GPU. Let's begin. ==== ==== ==== LINKS Website: https://www.hassandev.me Portfolio: https://www.hassandev.me/work YouTube: https://www.youtube.com/@itshassanaziz?sub_confirmation=1 My Book: https://www.hassandev.me/designing-websites X / Twitter: https://x.com/nothassanaziz

Transcript

Auto-generated transcript
So if you've been following my channel recently, you'll notice I started posting shorts a lot now. And one of the things that a good short requires is proper captions, right? And if you're someone with an attention span of a goldfish and you do scroll a lot of shorts, you'll notice that most of them have captions like these, right? And so since I'm posting a lot of shorts, I need to have this as well. The only problem is there's no free tool for me to do this. There's a couple of AI video editors online and they all charge me money, right? and I'm not paying for a subscription when I can build the same thing myself. There's also CapCut, which is a really awesome video editor. Don't get me wrong, but it's paid. And again, since I can build it myself, why do I need to pay someone else to do it for me? And so that's exactly what I did. I just built it myself. And so right here I have the entire process of how I did this. I am going to give you guys the code as well. I'll put it in some GitHub repository and link it in the description or something. But you don't really need the code for this. You can literally just vibe code this yourself once you understand the process and what kind of prompt to give to your AI. And so let me walk you through exactly what happens when I want to add captions. So we've got a raw video, right? This is the raw file that you've recorded on your phone or whatever, right? The first thing you need to do is you need to generate the subtitles for this, right? And so for this, what I'm using is an AI model called Faster Whisper, right? And it has plenty of different variants over here that we're gonna go through But yeah the first thing you need to do is generate subtitles Once you done that you need to burn those subtitles into the video at the proper timestamps and for that you need to use FFM peg right and during this step you can also adjust the styling the placement right the where exactly you're going to place the font or the text in the video the font family the font size etc right all of those things you can add borders and backgrounds and text shadows and whatever you want to do right and once that's done you literally just save the final video file and you're pretty much done right super simple process and you can wipe code this very easily in a single one shot prompt right and before you do any of that you need to decide which variant of the faster whisper model you guys are going to use now i've had good results with the small model and the medium model and luckily for me these are also models that i can actually run on my old machine i've tried the large v3 model as well and it has really good it has really good quality in the transcription but it just takes way too long to run and mostly i haven't found a lot of difference between the medium and the large v3 models probably because most of my videos are just normal english right so there's not really a lot of margin for error right and if you guys are just doing regular english videos just like me you can get away with using just a medium model but if you wanna have the absolute best performance there is or if you want to support other languages not just English you should probably go with the large v3 model keep in mind it's going to use a lot more RAM as well so you better have something good over there in your machine right and yeah that about it let me also just show you the code over here as well just real quick so yeah this right here is the entire script file that i use to add captions to my shorts and i'll be honest i haven't read this code at all right this is 400 lines of code that i have not reviewed at all i just explained what i needed to this agent over here and i let it generate whatever it came up with right and for something that isn't gonna hit production that's just a little tool that I'm using myself locally on my machine, I'm completely fine with not reviewing the code. And if I show you what arguments this takes, this is the entire thing, right? Mainly, you just need to pass in a video file, right? The raw file that you've got so that it can generate a transcript and then burn that transcript into the video. But you can specify the model size you want to use as well. I mostly just go with medium because it's just good enough for my needs. You can specify the max words per caption. This is really useful for short form videos because most of them you'll see have like three or five words per caption right not a lot of words output video if you want to specify a different output uppercase if you want to convert all captions to uppercase right voice activity detection this is a little something built into the faster whisper ai models that just helps you to ignore silences right so if in your raw recording your I don't know thinking about what to say and you're just sitting there not saying anything this is going to detect that right and it's going to detect and ignore that silence right and of course you can go over here and adjust the font size the bottom margin I have a little preset options as well that just applies a set of predefined options right So something like let me zoom in as well Something like a preset for shorts where I only allow a maximum five words a 12 font size, 50 margin, right? And all uppercase captions. Again, these are just little features that I added into this script for my own, you know, convenience. All you need to do is this little process over here. You have the raw video you generate subtitles using faster whisper you burn it into the video using FFmpeg and you save the final Video file. How do you create this you go over to whatever agent or LLM you're using for coding and you explain this entire process When you get to this step you tell the agent which model you want to use and when you get to this step over here With FFmpeg you explain in detail to the agent What kind of font you want to use what the font size should be the styling the background the? shadows everything you explain all of that and the agent will write the appropriate FFmpeg commands to achieve that because let's be honest none of us know FFmpeg commands there's a reason why tools like handbrake and others exist and then finally just save the final video file and you're done and then you can easily automatically generate shorts like these with all these captions over here super useful so yeah just a little helpful automation I built for myself if you enjoyed this like comment subscribe I don't know all those things and check out the actual github for this project as well I just open sourced it last night and there's so many cool features and automations that I built in there for my own work that I think you can get inspired by too so do check that out as well

Share this article

All great things started with a conversation

If you've got a cool project or opportunity and you want me to be a part of it, set up a free meeting with me here, and let's talk. 😊