
How to Turn Any Long Video Into Viral Shorts for Free With AI (ViralShorts)
Paying $20–30 a month for an AI clipping tool? In this tutorial I’ll show you how to set up ViralShorts, a free, open-source app I built that finds the best moments in any long video and turns them into vertical clips. Each clip comes with word-by-word captions, a hook, cover photos, and ready-to-paste titles and hashtags.
It runs on your own Windows PC, works for podcasts, lectures, gaming, cooking and more, and the only thing you need is a free Gemini API key. Setup takes about 15 minutes, and most of that is downloading.
Get the code: github.com/umair-alam/ViralShorts
What is ViralShorts?
ViralShorts is a local AI clipping app. You paste a YouTube or Facebook link (or pick a video file), and it gives you back vertical 9:16 clips ready for YouTube Shorts, TikTok, Instagram Reels and Facebook.
Here’s how the AI decides what to clip:
- Whisper transcribes the whole video word by word on your PC.
- The app measures signals: loudness spikes (laughter, shouting), live-chat spikes on streams, and YouTube’s “Most replayed” graph when a video has one.
- Gemini reads the transcript and signals like an editor and picks the moments that stand on their own.
- Each clip is cut on whole words, captioned, given a hook and an AI voice intro, and rendered with ffmpeg.
For every moment you get two cuts: a short one (20–55 seconds) for YouTube Shorts and a longer one (65–180 seconds) for TikTok and Facebook, where videos over a minute can earn.
What you need
- Windows 10 or 11
- About 5 GB of free disk space
- A free Gemini API key from Google AI Studio (we’ll get it in Step 4)
- Optional: an NVIDIA graphics card. It makes transcription and rendering much faster. Without one, the app still works on your CPU, just slower.
Step 1: Install Python, ffmpeg and Git
Open Start → Terminal (or PowerShell) and run these three commands one at a time:
winget install Python.Python.3.13
winget install Gyan.FFmpeg
winget install Git.GitIf you install Python from python.org instead, tick “Add python.exe to PATH” in the installer.
Important: close the terminal and open a new one afterwards, so Windows picks up the new programs.
Step 2: Download ViralShorts
In the new terminal, go to the folder where you want the app and clone the repo:
cd D:\
git clone https://github.com/umair-alam/ViralShorts.git
cd ViralShortsNo Git? Open the GitHub page, click Code → Download ZIP, and unzip it anywhere.
Step 3: Run the installer
Open the ViralShorts folder and double-click setup.bat. It:
- checks that ffmpeg is installed and installs Deno (YouTube downloads need it),
- creates a private Python environment in a
.venvfolder, - installs everything the app needs, including GPU support for transcription.
The first run downloads around 2 GB, so give it a few minutes. When you see “Setup done”, press any key to close the window.
Step 4: Open the app and add your free Gemini key
- Double-click
ui.bat. A black window opens (keep it open while you use the app), and the app opens in your browser athttp://127.0.0.1:8765. - The first time, the Settings panel opens by itself. Later you can find it under ⚙ Settings at the top right.
- Go to aistudio.google.com/apikey, sign in with your Google account and click Create API key. Copy the key.
- Paste it into Settings and click Save key.
The app checks the key with Google before saving it, so a green “Saved and working” means you’re ready. The key is stored only on your PC and is never uploaded. Never share it or show it on screen.
Step 5: Make your first clips
- Open the Make clips tab.
- Paste a YouTube link (or a video file path like
D:\Videos\my-podcast.mp4). You can paste several, one per line. - Click Start and watch the live log at the bottom of the page.
The app downloads the video, transcribes it, lets the AI pick the moments, and renders the clips. A 20-minute video takes roughly 5–10 minutes on a GPU, and the first run also downloads the Whisper speech model (about 1.5 GB).
When the job finishes, open the Library tab. For each clip you can:
- play the Short and the TikTok/Facebook cut,
- copy the title, captions and hashtags for each platform,
- open the full upload kit and the posting plan,
- click Original source to jump to the exact moment in the original video.
The files themselves are in the output folder inside ViralShorts.
Step 6: Pick the right niche and layout
Before you click Start, check the Options panel on the right. The Niche tells the AI what a great moment looks like for your kind of video. Auto-detect works it out for you, but picking one yourself gives the best results.
| Your video | Niche | Layout | AI voice |
|---|---|---|---|
| Podcast or interview | Podcast | Crop | Off |
| Lecture or tutorial | Education | Crop or Blur | On |
| Gaming stream | Gaming | Dual | On |
| Cooking, fitness, tech | That niche, or Auto-detect | Dual | On |
| Already 1–3 minutes long | Any | Mode: Whole video | Your choice |
A few things worth knowing:
- Crop fills the screen around the speaker. If nothing moves on screen (slides, screen recordings), the app keeps the full frame automatically so text is never cut off.
- Dual shows a title band, the full frame, and a big close-up of the action. It’s great for gaming.
- Whole video mode doesn’t cut anything. It turns a short video into one vertical post with captions and a hook.
- Under Cuts, you can render only Shorts or only the longer TikTok/Facebook versions.
Step 7: Find videos that are going viral
The Find viral tab searches YouTube and ranks videos by views per hour, so you can see what’s taking off right now.
- Type any topic, for example podcast clips, premier league goals or cooking hacks.
- Choose the upload window (today, this week, this month) and the video length.
- Tick Creative Commons only to see videos you’re allowed to reuse.
- Use Watch original to check a video, then tick the ones you want and click Process.
Each result shows its licence. Creative Commons videos get the required credit added to your captions automatically.
Step 8: Post your clips
Each clip folder has everything you need to post:
youtube_short.mp4: for YouTube Shorts and Instagram Reelstiktok_facebook_long.mp4: for TikTok and Facebook (over 60 seconds)cover.jpgandcover_alt.jpg: two cover photos to choose fromupload_kit.txt: titles, captions and hashtags for every platform
The POSTING_PLAN.md and SCHEDULE.ics files in the video’s folder tell you which clip to post when. Open the .ics file to add the posting slots to your calendar.
Tips for better clips
- Only clip videos you own or have permission to use. Reposting other creators’ videos without permission gets you copyright claims and “unoriginal content” strikes, not money. Your own videos, clients who hire you, Creative Commons videos and official clipping programs are all safe choices.
- Turn the AI voice off for podcasts. An announcer over a conversation usually feels out of place.
- Not happy with the picks? Tick Re-pick moments in Options and run the video again.
- Running low on disk space? Delete folders inside
work. They’re only a cache of downloads and transcripts. - Don’t have a Gemini key yet? Untick Use Gemini. The app then cuts around loudness and chat spikes instead, which works but picks less cleverly.
Troubleshooting
| Problem | Fix |
|---|---|
| “ffmpeg not found” | Run winget install Gyan.FFmpeg, then open a new terminal and run setup.bat again |
| “Google rejected this key” | Copy the key again from AI Studio and paste it in ⚙ Settings |
| “Sign in to confirm you’re not a bot” | Set download.cookies_from_browser: firefox in config.yaml and log in to YouTube in Firefox |
| YouTube download fails | Update the downloader with the command below |
| Transcription is very slow | No NVIDIA GPU was found, so it’s running on the CPU. Try shorter videos first. |
To update the YouTube downloader, run this inside the ViralShorts folder:
.venv\Scripts\python.exe -m pip install -U "yt-dlp[default]"The full setup guide is on GitHub: SETUP.md.
FAQ
Is ViralShorts really free?
Yes. The app is open source under the MIT licence, and the Gemini API has a free tier that’s enough for personal use. Everything else runs on your own PC.
Do I need a powerful PC?
No, but an NVIDIA graphics card makes it much faster. On a CPU, transcription and rendering take noticeably longer.
Does it work on Mac or Linux?
The launchers (setup.bat, ui.bat) are Windows-only for now. The Python code is cross-platform, so a Mac or Linux version is possible.
Which videos can I use?
Any YouTube or Facebook link, or a video file on your PC. Whether you’re allowed to post the clips depends on the video’s rights, so stick to your own content, Creative Commons videos, or creators who gave you permission.
Which platforms are the clips for?
YouTube Shorts, TikTok, Instagram Reels and Facebook. Every clip comes with platform-specific titles, captions and hashtags.