| name | ai-branded-manim-sarvam-reels |
| description | Use when creating AI-topic short reels with branded Manim/LaTeX diagrams, on-screen text, and Sarvam AI voiceover. Builds a complete 9:16 video pipeline from topic to script, brand theme, synchronized voice, rendered MP4, subtitles, and verification. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| platforms | ["windows","linux","macos"] |
| metadata | {"hermes":{"tags":["ai-explainers","reels","manim","latex","diagrams","sarvam","voiceover","brand-colors","shorts"],"related_skills":[]}} |
AI Branded Manim + Sarvam Reels
Overview
Use this skill to create production-ready AI-topic explainer reels using Manim, LaTeX-rendered math/text, animated diagrams, branded color palettes, and Sarvam AI voiceover.
The output is a complete vertical short-form video:
- 9:16 MP4, preferably 1080×1920.
- AI topic explained through clean diagrams and short text.
- Brand-inspired visual theme such as Google, Oracle, Accenture, Microsoft, NVIDIA, OpenAI, or a custom palette.
- Sarvam AI voiceover generated from environment variable credentials, never hardcoded.
- Subtitles and animation timing synchronized to measured audio durations.
- ffprobe/ffmpeg verification before delivery.
When to Use
Use when the user asks for:
- AI topic reels, YouTube Shorts, Instagram Reels, TikTok explainers, or LinkedIn vertical videos.
- Manim videos with diagrams, LaTeX text, formulas, neural networks, transformers, embeddings, RAG, agents, LLMs, diffusion, etc.
- Sarvam AI TTS voiceover with synchronized animation.
- Brand-color reels like Google theme, Oracle theme, Accenture theme, Microsoft theme, or another company-inspired visual system.
- Repeatable pipelines or batch generation for multiple AI topics.
- Long study notes where the right output is a multi-reel concept batch rather than one overloaded reel.
Do not use for:
- Long horizontal lectures.
- Static posters only.
- Videos without actual voiceover when voiceover was requested.
- Any workflow that hardcodes API keys or secrets.
Non-Negotiable Requirements
- Never store or print Sarvam API keys in source files, generated skill files, logs, captions, or final output.
- Use actual generated voice audio for final videos, not placeholder music or silent reels.
- Build timing from measured audio durations, not guessed durations.
- Verify final MP4 has a video stream, an audio stream, correct vertical dimensions, and audible volume.
- Keep diagrams readable on mobile: big labels, minimal clutter, high contrast.
- Keep each reel focused on one AI concept only.
Completion criterion: final deliverable includes a playable MP4 plus source artifacts and verification output.
Brand Theme System
Use brand-inspired colors without pretending the reel is officially endorsed by the brand.
Google-Inspired Theme
- Background:
#0B0F19 or #FFFFFF depending on dark/light mode.
- Blue:
#4285F4.
- Red:
#EA4335.
- Yellow:
#FBBC05.
- Green:
#34A853.
- Text on dark:
#F8FAFC.
- Best for: search, multimodal AI, Gemini-style explainers, friendly education.
Oracle-Inspired Theme
- Background:
#0D0D0D or #1A1110.
- Red:
#C74634.
- Deep red:
#8A1F11.
- Sand:
#F4EEE2.
- Charcoal:
#312D2A.
- Best for: enterprise AI, databases, cloud, business automation.
Accenture-Inspired Theme
- Background:
#050505.
- Purple:
#A100FF.
- White:
#FFFFFF.
- Gray:
#A7A7A7.
- Electric accent:
#00E5FF when extra contrast is needed.
- Best for: consulting, transformation, enterprise AI strategy.
Microsoft-Inspired Theme
- Background:
#0B1220.
- Blue:
#0078D4.
- Green:
#7FBA00.
- Yellow:
#FFB900.
- Red:
#F25022.
- Best for: Copilot, productivity, enterprise workflow.
NVIDIA-Inspired Theme
- Background:
#050805.
- Green:
#76B900.
- Black:
#000000.
- Soft white:
#F4F4F4.
- Best for: GPUs, training, inference, acceleration.
OpenAI-Inspired Theme
- Background:
#0F172A or #FFFFFF.
- Green:
#10A37F.
- Slate:
#334155.
- Off-white:
#F8FAFC.
- Best for: LLMs, agents, chatbots, reasoning.
Completion criterion: brief.md states the selected theme and the exact hex palette used.
Project Folder Structure
For multi-reel batches from long notes, see references/batch_ai_agent_component_reels.md for the proven config-driven pattern: split by concept, use one subfolder per reel, generate Sarvam line audio, pad silent renders to voice duration, and verify each final MP4.
For English-only variants, see references/english_only_agent_reels_workflow.md: rewrite all narration/on-screen text to English, use Sarvam target_language_code="en-IN" with a compatible speaker such as priya, verify AAC voice is present, and inspect frames for English-only text.
For final delivery packaging, see references/publish_ready_youtube_packaging.md: create publish_ready_youtube/ with one folder per reel containing the final MP4, youtube_title.txt, youtube_description.txt, tags, checklist, and a verified publish index.
Create one folder per reel:
ai_reel_<slug>/
brief.md
script.md
storyboard.md
timing.json
subtitles.srt
manim_reel.py
audio/
line_01.wav
line_02.wav
voice_full.wav
renders/
silent_reel.mp4
final/
reel.mp4
checks/
ffprobe.json
volume.txt
frame_05s.png
frame_15s.png
Completion criterion: every final video has reproducible source files and checks.
Pipeline
1. Intake
Capture:
- AI topic.
- Audience: beginners, students, founders, developers, executives, creators.
- Duration: default 30–45 seconds.
- Brand theme: Google, Oracle, Accenture, Microsoft, NVIDIA, OpenAI, or custom.
- Language: English, Gujarati, Hindi, Hinglish, or another supported style.
- Voice tone: energetic, premium, calm teacher, founder, narrator, etc.
- CTA: follow, save, comment, share, or none.
Write brief.md.
Completion criterion: brief has topic, audience, duration, theme, language, voice direction, CTA.
2. Script for Retention
Use a short high-retention structure:
- Hook: 0–2 seconds.
- Problem/context: 2–6 seconds.
- Visual explanation: 3–5 beats.
- Payoff: one memorable summary.
- CTA: last 2–3 seconds.
Rules:
- One spoken line per animation beat.
- Keep each line short, usually 5–14 words.
- Avoid dense paragraphs.
- Prefer simple analogies: librarian, factory, map, pipeline, brain, search engine.
- If using Gujarati/Hindi, write naturally first; do not literal-translate stiff English.
Write script.md with numbered voice lines.
Completion criterion: every line has a matching visual idea.
3. Storyboard the Diagrams
Choose diagram patterns based on topic:
- LLM basics: input tokens → transformer blocks → probabilities → answer.
- Transformers: tokens → embeddings → attention heads → feed-forward → output.
- RAG: user query → embed → vector database → retrieve chunks → LLM answer.
- AI agents: goal → planner → tools → memory → action loop → result.
- Diffusion: noise → denoise steps → image.
- Fine-tuning: base model → examples → updated behavior.
- Embeddings: words/documents → vectors → semantic distance.
- Multimodal AI: text/image/audio/video streams → shared model → output.
For every scene, define:
- Spoken line.
- Main visual object.
- Text on screen.
- Animation action.
- Brand colors used.
Write storyboard.md.
Completion criterion: storyboard has one scene per voice line or grouped beat.
4. Sarvam Voice Generation
Use SARVAM_API_KEY from the environment. Never place the key inside code.
Check credential presence:
python - << 'PY'
import os
assert os.getenv('SARVAM_API_KEY'), 'SARVAM_API_KEY is missing'
print('SARVAM_API_KEY is set')
PY
Recommended Python pattern:
import os, base64
from pathlib import Path
from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key=os.environ['SARVAM_API_KEY'])
resp = client.text_to_speech.convert(
text=line_text,
target_language_code='gu-IN',
speaker='shubh',
model='bulbul:v3',
output_audio_codec='wav',
speech_sample_rate=24000,
pace=0.90,
temperature=0.55,
)
Path(out_path).write_bytes(base64.b64decode(resp.audios[0]))
Generate one file per line:
audio/line_01.wav
audio/line_02.wav
...
Then measure duration:
ffprobe -v error -show_entries format=duration -of default=nw=1:nk=1 audio/line_01.wav
Build timing.json from real durations, including optional gaps of 0.20–0.40 seconds.
Completion criterion: all voice files exist, durations are measured, and timing.json is based on real audio.
5. Subtitle Generation
Create subtitles.srt from timing.json.
Rules:
- One subtitle per voice line unless a line is too long.
- Keep subtitles center-lower but above app UI zones.
- Use high-contrast text with outline or shadow.
- Never show subtitles earlier than the voice.
Completion criterion: subtitle count matches script/timing and intervals are valid.
6. Manim Reel Code
Use vertical configuration:
from manim import *
config.frame_width = 9
config.frame_height = 16
config.pixel_width = 1080
config.pixel_height = 1920
config.frame_rate = 30
Use LaTeX/Manim text appropriately:
- Use
MathTex for formulas and symbolic diagrams.
- Use
Tex for short LaTeX-styled text.
- Use
Text for normal language subtitles and brand labels.
- For Gujarati or Indic scripts, use a font with proper glyph coverage such as Noto Sans Gujarati, Shruti, Noto Sans Devanagari, or a verified system font.
Mobile layout rules:
- Safe x range: -4.0 to 4.0.
- Safe y range: -6.6 to 6.6.
- Hook text should be large and central.
- Diagram labels should be short.
- Do not show more than 3 key text blocks at once.
- Use brand colors as accents, not as noisy rainbow decoration.
Animation timing rules:
- Voice leads; animation follows by about 0.10–0.25 seconds.
- Reveal visual elements on key words.
- Keep one visual payoff every 2–3 seconds.
- Clear old objects before the next concept becomes crowded.
Completion criterion: silent Manim render is vertical, readable, and matches the timing plan.
7. Render
Render the Manim scene:
manim -qh --format mp4 manim_reel.py AIReel
Copy the rendered output to:
renders/silent_reel.mp4
Completion criterion: renders/silent_reel.mp4 exists and is 1080×1920 or the requested vertical resolution.
8. Voice Mux and Subtitle Burn
Concatenate line audio with small gaps and normalize:
ffmpeg -y -f concat -safe 0 -i audio/concat.txt \
-af loudnorm=I=-16:TP=-1.5:LRA=11 \
audio/voice_full.wav
Mux voice:
ffmpeg -y \
-i renders/silent_reel.mp4 \
-i audio/voice_full.wav \
-c:v copy -c:a aac -b:a 192k -shortest \
final/reel_no_subs.mp4
Burn subtitles:
ffmpeg -y \
-i final/reel_no_subs.mp4 \
-vf "subtitles=subtitles.srt:force_style='FontSize=18,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,BorderStyle=1,Outline=2,Alignment=2,MarginV=150'" \
-c:a copy \
final/reel.mp4
On Windows/Git-Bash, run ffmpeg subtitle commands from inside the project directory and use forward slashes in paths.
Completion criterion: final/reel.mp4 has video, voice audio, and burned subtitles.
9. Verification
Run:
ffprobe -v error -print_format json -show_streams -show_format final/reel.mp4 > checks/ffprobe.json
ffmpeg -i final/reel.mp4 -af volumedetect -f null - 2> checks/volume.txt
ffmpeg -y -ss 00:00:05 -i final/reel.mp4 -frames:v 1 checks/frame_05s.png
ffmpeg -y -ss 00:00:15 -i final/reel.mp4 -frames:v 1 checks/frame_15s.png
Check:
- Width is 1080.
- Height is 1920.
- Audio stream exists.
- Audio is not clipped.
- Text is readable in extracted frames.
- No glyph boxes/tofu.
- Duration is within the requested range.
- Voice and visual beats align.
Completion criterion: verification files exist and final response reports the actual verified MP4 path.
Script Templates
English AI Explainer Template
1. Hook: "This is how AI actually understands your words."
2. Context: "It does not read words like humans do."
3. Beat 1: "First, your sentence becomes tiny tokens."
4. Beat 2: "Each token turns into a number vector."
5. Beat 3: "Attention finds which tokens matter together."
6. Payoff: "That pattern becomes the answer you see."
7. CTA: "Save this if you want AI explained visually."
Gujarati AI Explainer Template
1. Hook: "AI તમારા શબ્દો ખરેખર કેવી રીતે સમજે છે?"
2. Context: "તે માણસની જેમ વાંચતું નથી."
3. Beat 1: "પહેલા વાક્ય નાના ટોકનમાં તૂટે છે."
4. Beat 2: "દરેક ટોકન નંબર વેક્ટર બને છે."
5. Beat 3: "Attention મહત્વના સંબંધો શોધે છે."
6. Payoff: "આ પેટર્નથી જવાબ તૈયાર થાય છે."
7. CTA: "આવી AI સમજ માટે રીલ સેવ કરો."
Diagram Quality Rules
- Use arrows for flow, glow highlights for attention, grids for vectors, and stacked blocks for model layers.
- Avoid tiny code snippets unless the audience is developers.
- Use exact labels:
Tokens, Embeddings, Attention, Context, Answer.
- For executive audiences, replace math with business-flow diagrams.
- For students/developers, include one clean formula or symbolic representation only if it helps.
Common Pitfalls
- Creating a silent Manim video and calling it complete. Fix: generate Sarvam audio and mux it.
- Guessing timings. Fix: measure every line with ffprobe and build timing from those values.
- Overloading diagrams. Fix: one idea per scene, maximum 3 major objects on screen.
- Using brand colors too literally on every object. Fix: dark/light base plus brand accents.
- Letting subtitles cover diagrams. Fix: reserve bottom subtitle zone and keep diagrams central/top.
- Rendering Indic text without checking fonts. Fix: extract frames and verify glyphs.
- Hardcoding secrets. Fix: environment variables only.
- Delivering without checking audio loudness. Fix: run
volumedetect and confirm audible voice.
- Using
LaggedStartMap(GrowFromEdge, ..., edge=LEFT) with grouped objects can fail in Manim v0.20 with multiple values for argument 'edge'. Fix: use LaggedStart(*[FadeIn(obj, shift=RIGHT*0.2) for obj in group], lag_ratio=...) or explicit GrowFromEdge animations.
- Letting video end slightly before generated voice. Fix: compare silent render duration against
audio/voice_full.wav; if needed, pad the silent video with tpad=stop_mode=clone:stop_duration=... before muxing.
- Repeated long-note “create reels” requests should not restart from scratch conceptually or produce one generic reel. Fix: create a class-level batch (usually 3–5 reels), save
reels_index.json and captions_all.md, and verify every MP4 independently.
- Large Manim batch logs can flood the context. Fix: redirect per-reel voice/render/mux output into
logs/*.log, print only durations/status, and inspect logs only on failure.
- When the user corrects language, e.g. “English only” or “add English voice,” do not just translate captions. Regenerate the script lines, Manim text, subtitles, and Sarvam TTS in the requested language, then verify extracted frames contain no leftover prior-language text.
- Sarvam
bulbul:v3 speaker compatibility varies by model. If English TTS fails with an incompatible speaker such as anushka, use a speaker listed by the API for that model; priya worked with target_language_code="en-IN" for English reels.
- In fast batch recovery, if Manim finishes rendering but a copy step expects the wrong quality folder, first look for the completed
media/videos/manim_reel/1920p30/AIReel.mp4 and copy it to renders/silent_reel.mp4 instead of re-rendering. If a Windows text/SVG cache unlink error appears, retry that reel with --disable_caching.
- When the user says they want to publish easily, do not leave final MP4s buried inside per-reel build folders. Add a separate
publish_ready_youtube/ package with copied MP4s plus title/description/tag/checklist text files, and verify every publish folder before reporting completion.
Verification Checklist