YouTube Shorts Automation: Daily AI Videos From a Raspberry Pi
📅 March 14, 2026 · ⏱️ 10 min read · ♻️ Updated
Running multiple YouTube channels sounds fun until you try to publish every single day. We built a fully automated Shorts factory that generates, narrates, adds sound effects and music, assembles, and uploads ~42-second vertical videos across five themed channels — all running 24/7 on a Raspberry Pi 5.
🧰 What you need to build this
Every requirement below is stated somewhere later in this article. This section only gathers them into one place, up front, so you can decide whether you can start before you read the pipeline.
- Raspberry Pi 5 Model B — one board, with Debian 13, running 24/7. There is no second machine here: the entire stack runs on it.
- Chromium — the browser the automation drives. It gets a CDP health check before each run, and restarts automatically if unresponsive.
- Node.js — the third piece of that on-Pi stack, beside Chromium and ffmpeg. The orchestration, the retries and the scheduling daemon all run on the board.
- ffmpeg 4.4.2 — the assembly step. 4.4.2 is the only release tested, so the published spec is the one this version produced.
- Cloud AI APIs — access to the services that do the heavy computation, because the Pi does not: video generation, TTS, image rendering, music, SFX are all offloaded to them.
- Flux 2.0 Pro — the image model behind the 9:16 frames, one per clip, used as image-to-video seeds.
- An AI video generator — reached through browser automation rather than an API, which is why only one clip run happens at a time.
- YouTube Studio — the channels you upload into. The upload flow here is browser automation with channel switching, not the official YouTube Data API.
What this article does not give you: the pipeline’s own source, which is not published — the ffmpeg section below says the same thing about its own code — and any vendor pricing, because no cost for any of these APIs is published on this page.
🎯 The Problem
Consistency is everything on YouTube, but manually producing even one Short per day involves scripting, asset creation, voice recording, editing, rendering, and uploading. Multiply that by five channels and it becomes a full-time job. We wanted daily output with zero daily effort.
📺 The Channels
The system manages seven themed channels, with five currently active and two reserved for future activation:
- 🌙 InterdimensionalNightmare — Creepy stories, cosmic horror, and sleep paralysis tales
- 💪 InterdimensionalMotivation — Stoic philosophy, Marcus Aurelius quotes, discipline content
- ⚡ InterdimensionalMythology — Greek, Norse, Egyptian, and Hindu myths retold
- 🐾 InterdimensionalPaws — Heartwarming animal rescues and pet stories
- 🌿 InterdimensionalFlora — Medicinal herbs, pollinators, and botany facts
Each channel has its own distinct profile: unique voice style, visual aesthetic, color grading, pacing, title patterns, and music mood — so every Short feels native to its niche.
🔧 End-to-End Pipeline
Every Short goes through the same automated steps from idea to published video. Here’s the full flow:
1. Topic Selection
An AI model generates a channel-specific topic, drawing from curated catalogs and injecting seasonal context. Topic history files prevent repeats — no channel ever publishes the same story twice.
2. Script & Story Generation
A single AI call produces a complete narrative package: title, description, hashtags, per-clip narration lines (12–16 words each), matching visual prompts, voice settings, and a music style recommendation.
3. Scene Frame Generation
High-quality 9:16 images are generated via Flux 2.0 Pro — one per clip — to serve as image-to-video seeds. Two frames render in parallel with a 4-attempt retry and progressive prompt simplification on failure. Any seed image can become a clip with ffmpeg.
4. Video Clip Generation
Browser automation submits each visual prompt to an AI video generator, configured for 720p, 9:16, 6-second clips. Each clip downloads sequentially with polling, timeouts, and cooldown delays between requests.
5. Voice Analysis & Matching
AI vision analyzes frames to determine the dominant character gender and corrects voice selection if there’s a mismatch — preventing a male voice from narrating a female character’s story.
6. Sound Effects
AI-generated sound effects are synchronized to each video clip. A smart mode analyzes 5 frames per clip and generates contextual SFX prompts. Layered mode produces foreground, midground, and background audio layers.
7. Text-to-Speech Narration
Per-line narration is synthesized with configurable voice speed, pitch, and emotion. Each line retries up to 3 times with exponential backoff.
8. Short Assembly
ffmpeg merges everything: clips are trimmed to match TTS duration, audio is mixed (voice at 180%, SFX at 40%, music at 20%), sidechain compression ducks music under voice, and the output is hard-capped at 59 seconds. Final spec: 1080×1920, H.264 CRF 18, AAC 192kbps. What CRF 18 costs in bytes against CRF 23, 28 and 33, and how to aim for a file size instead, is measured here. Where a trim lands depends on how it is cut: a copy cut starts at the keyframe before, a re-encoded one on the exact frame. Merging the clips is a choice too: the concat demuxer copies clips that match, and clips of different sizes or frame rates need the concat filter. Narration can replace a clip’s sound while the picture is copied untouched.
That paragraph is the spec. The block below is not the pipeline’s own invocation — that source isn’t published. It is a separate, runnable example that produces the same spec from the nine values above and nothing else, synthesising its own inputs so it runs in an empty directory on a stock ffmpeg 4.4:
# Stand-in inputs — swap in your own clip, narration, SFX and music.
ffmpeg -y -f lavfi -i "testsrc2=size=1080x1920:rate=30" -t 12 -c:v libx264 clip.mp4
ffmpeg -y -f lavfi -i "sine=frequency=220:sample_rate=48000" -t 6 voice.wav
ffmpeg -y -f lavfi -i "anoisesrc=sample_rate=48000:color=pink" -t 6 sfx.wav
ffmpeg -y -f lavfi -i "sine=frequency=440:sample_rate=48000" -t 30 music.wav
# Narration length is what the clip gets trimmed to.
DUR=$(ffprobe -v error -show_entries format=duration -of csv=p=0 voice.wav)
ffmpeg -y -i clip.mp4 -i voice.wav -i sfx.wav -i music.wav -filter_complex "
[0:v]trim=end=${DUR},setpts=PTS-STARTPTS,scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,setsar=1[v];
[1:a]atrim=end=${DUR},asetpts=PTS-STARTPTS,aformat=sample_fmts=fltp:sample_rates=48000:channel_layouts=stereo,volume=1.8,apad=whole_dur=${DUR}[voice];
[2:a]atrim=end=${DUR},asetpts=PTS-STARTPTS,aformat=sample_fmts=fltp:sample_rates=48000:channel_layouts=stereo,volume=0.4[sfx];
[3:a]atrim=end=${DUR},asetpts=PTS-STARTPTS,aformat=sample_fmts=fltp:sample_rates=48000:channel_layouts=stereo,volume=0.2[music];
[voice]asplit=2[voice_mix][key];
[music][key]sidechaincompress[ducked];
[voice_mix][sfx][ducked]amix=inputs=3:duration=first:normalize=0[a]
" -map "[v]" -map "[a]" -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a aac -b:a 192k -t 59 short.mp4
The scale/crop pair on the video line is a centre crop, which drops the sides of a widescreen clip. Other ways to go vertical, with a frame from each.
On ffmpeg 4.4.2, the only release tested, ffprobe short.mp4 reports 1080×1920, h264, and aac
at 193 kbps: raw bit_rate near 193026. Duration equals the narration; -t 59 only bites on a
longer one.
Which parts are mine and not the author’s: setsar, aformat, -pix_fmt yuv420p and normalize=0
are plumbing the paragraph never mentions. sidechaincompress runs at its defaults, because no
threshold or ratio is published. What those defaults do to the music, measured, and what to set instead. The gains are plain volume multipliers (1.8 / 0.4 / 0.2); how the
real pipeline applies them is not something this page knows. Gains set the balance, not the final loudness: normalizing the finished mix with ffmpeg loudnorm, one pass or two, measured.
For a single clip rather than a pipeline, the Shorts ffmpeg command builder writes this kind of command for your clip’s size, fit mode, music and subtitles. What its subtitle style measures on a 1080×1920 frame, and the soft track that skips the re-encode: adding subtitles with ffmpeg.
9. Metadata Generation
YouTube metadata — title, description, tags, hashtags, and category — is generated and saved alongside the video, optimized for the 500-character limit.
10. Upload
Browser automation handles the YouTube Studio upload flow: channel switching, overlay dismissal (with a self-learning cache), title/description entry, privacy settings, and publish confirmation. Results are logged to an audit trail.
If you are weighing the official YouTube Data API instead, how to upload YouTube Shorts automatically walks through that route and its daily upload quota.
⏰ Scheduling & Orchestration
A custom control-center daemon manages the daily schedule. Each channel has a fixed time slot staggered every 4 hours (Eastern Time):
- 🌃 01:00 ET — InterdimensionalNightmare — horror
- 🌅 05:00 ET — InterdimensionalMotivation — motivation
- ☀️ 09:00 ET — InterdimensionalMythology — mythology
- 🌤️ 13:00 ET — InterdimensionalPaws — animals
- 🌇 17:00 ET — InterdimensionalFlora — plants
All channels share a single video generation queue — only one runs at a time since the AI video generator can only handle one browser session. A completedSlots map prevents duplicate runs within the same time window. Scheduler state persists across daemon restarts.
🛡️ Reliability & Safety
Automations fail unless you design for failure. These safeguards made the biggest difference:
- 🔄 Smart Retries — Exponential backoff on TTS, SFX, and image generation. Up to 60 retries for browser connections.
- 🔒 Lockfile System — PID-based stale lock detection prevents concurrent instances from colliding.
- ⏩ Resume Support — The
--resumeflag detects existing clips and skips already-generated content. - 🧹 Browser Health Checks — CDP health check before each run; Chromium restarts automatically if unresponsive.
- 📁 Lifecycle Management — Videos move through ready → uploaded → failed directories. 3 failed uploads move to a failure queue.
- 🚫 Deduplication — Topic history prevents repeated stories. Schedule slot tracking prevents duplicate daily runs.
🖥️ The Hardware
The entire stack — Chromium, ffmpeg, Node.js, and all AI API calls — runs on a single Raspberry Pi 5 Model B with Debian 13. No cloud servers, no powerful desktop machines — just a single-board computer running 24/7.
Heavy computation (video generation, TTS, image rendering, music, SFX) is offloaded to cloud AI APIs. The Pi handles orchestration, browser automation, ffmpeg assembly, and uploads — tasks that are I/O-bound rather than compute-bound.
📊 Real-World Results
Production data from February 25 to March 14, 2026:
- 📤 72 Videos Uploaded — Across 5 channels over ~18 days of unattended operation
- ✅ 83.7% Upload Success Rate — 14 failures, most recovered on retry — only persistent failures moved to the failure queue
- 📅 5 Shorts Per Day Scheduled — One slot per active channel at the five ET times above; the 72 uploads over ~18 days are an actual published rate of 4.0/day
- 🤖 One Human Task Left — Topic selection through upload runs without a human in the loop; re-authenticating long-running sessions is still manual, and is on the roadmap below
📚 Lessons Learned
- Single-machine automation works, but resource contention is real — staggering schedules is essential.
- Browser automation is powerful but fragile — YouTube Studio UI changes can break the upload flow at any time.
- Observability is not optional — structured logs and state tracking save you repeatedly.
- “Unattended” only works when retry paths are built in from day one. Every API call, every browser action, every file operation needs a failure plan.
🔮 What’s Next
- External alerting — Telegram/Discord notifications for failures and agent crashes
- YouTube Data API migration — Replace browser automation with the official API for upload stability
- Distributed generation — Offload video generation to more powerful hardware; keep the Pi as scheduler
- Automated session refresh — Eliminate manual re-authentication for long-running sessions
- Analytics feedback loop — Track per-video YouTube performance to improve content generation
🎯 Final Thought
This project started as “can I automate one channel?” and became a multi-channel production system running on a Raspberry Pi. It’s not perfect — the 84% upload rate needs work and browser automation will always be fragile — but it consistently turns AI-generated ideas into published YouTube Shorts every single day. That consistency compounds.
- 🌙 InterdimensionalNightmare
- 💪 InterdimensionalMotivation
- ⚡ InterdimensionalMythology
- 🐾 InterdimensionalPaws
- 🌿 InterdimensionalFlora
— DankDev
Tags: YouTube Automation · Raspberry Pi · AI Video · Node.js · ffmpeg · Automation · YouTube Shorts · Text-to-Speech
Follow new posts by RSS: paste dankdev.com/feed.xml into any feed reader. It is a plain XML file — no signup, no email address, no account. Posts land there the same day they go up, and there is nothing to unsubscribe from later.