Persian Comedy Reels
Produce vertical (9:16, 1080x1920, 30fps) hand-drawn ink comedy motion graphics synced to Persian audio (rap, music, voiceover, or skit) with sharp, relatable Iranian Gen-Z, Instagram, and Persian Twitter (توییتر فارسی) humor.
When to Use
- The user wants a funny Persian vertical video (Reels, YouTube Shorts, TikTok) synced to a song, rap verse, podcast clip, or voiceover.
- The user wants minimal hand-drawn black-and-white ink animation with a strict 3-color accent palette and expressive caricature character.
- The user asks to brainstorm, rewrite, or upgrade comedy scenarios so they feel relatable to Iranian teenagers and young adults instead of literal or generic.
Core Comedy Philosophy (Why Literal Fails)
Literal visual translation of lyrics (hearing "gym" and drawing a dumbbell, hearing "noon" and drawing a clock) produces a mild smile, never a real laugh. Viral Persian Reels humor relies on three mechanics:
- Diegetic UI and Everyday Props: Embed the joke inside familiar Iranian screens and objects (an
08:47advice voice note,اسنوز × ۱۴ بار!, a calendar where every day is labeledشنبه, aگروه سفر شمالchat where the admin cancels first, a۴۷ تماس بیپاسخscreen, a۰۱:۴۵ شبpizza order, or a Google search forچطور مودبانه برم خونه؟). - The Half-Second Betrayal Smash Cut: Set up a sincere, innocent, or heroic claim in Beat A, then hard-cut on the beat to the absurd reality in Beat B (zero fade transitions).
- Deadpan Reaction and Micro-Exaggeration: Keep the hero's face calm or smug while chaos happens around them, using spring/overshoot motion and a single bouncing visual signature (like a springy hair strand).
Before writing any storyboard, read references/iranian-comedy-bank.md to pull and adapt high-retention Iranian Gen-Z, Instagram, and Persian Twitter tropes.
Workflow
Step 0: Audio Extraction, Clean Cut, and Beat Sheet (Stop for Approval)
When working from a full track or long audio file:
- Check installed audio tools (
ffmpeg,python3,faster-whisper,librosa). Install missing packages in user space (pip install --user faster-whisper librosa soundfile). - Locate the exact target segment using
faster-whisper(medium,compute_type="int8",language="fa",word_timestamps=True, passing the reference Persian lyrics asinitial_prompt). - Cut cleanly with
ffmpegre-encoding (never-c copy, which causes millisecond drift). Always applyasetpts=PTS-STARTPTSbeforeafadeso fade-out operates on 0-based timestamps. - Listen to the trimmed audio (or its start and end tails) to verify zero vocal bleed from the preceding bar or following line.
- Run
librosa.beat.beat_trackon the trimmed clip to extract BPM, beat timestamps, and a 30fps Beat Sheet mapping every scene and punchline frame. - Pause and present the trimmed audio and Beat Sheet to the user for approval before coding any animation.
Step 1: Storyboard with the Anti-Literal Filter
Draft the scene-by-scene script and pass every single scene through this 3-question test:
- Is it literal? If the visual only illustrates the noun in the lyric, replace it with a relatable Iranian situation or twist from
references/iranian-comedy-bank.md. - Does it have a punchline beat? Every 2 to 4 second scene needs one sharp visual turn timed to a specific beat frame.
- Is the on-screen text scannable in under 1 second? Never write long subtitle sentences. Use short punchline badges (1 to 3 words) or crisp diegetic UI text (chat bubbles, clocks, search bars, stamps) in bold Persian
Vazirmatn Black.
Step 2: Style Frame Checkpoint (Stop for Approval)
Before animating all scenes, render one representative 1080x1920 PNG Style Frame (for example, the strongest comedic punchline scene) so the user can approve:
- The constant Hero Character (large round white head, bold ink outline, simple hoodie with drawstrings and pocket, expressive dot eyes with separate eyebrows, simple line mouth, and one springy spiked hair strand).
- The strict color palette: paper
#F7F5F0with subtle grain, ink#141414with boiling line jitter, white#FFFFFF, and at most 3 accent colors (#E63946warning red,#F4B400comedy yellow,#2A9D8Faccent green). Avoid colored Unicode emojis because they break the 3-color palette. - Native RTL Persian typography (
Vazirmatn-Black.ttf) with zero disconnected or reversed glyphs. - Reels safe zone compliance (bottom 20%
y > 1536and right 15%x > 918free of text and key props).
Step 3: Build Deterministic Scenes and Visual QA
Follow references/ink-engine-spec.md for the HTML5 Canvas + Chromium Playwright + FFmpeg pipeline:
- Write every scene as a pure deterministic function
renderFrame(frameIndex)at 30fps. - Apply boiling ink jitter re-seeded every 2 frames (
Math.floor(frame / 2)), spring/overshoot easings (easeOutBack,easeOutElastic, zero linear easing), continuous idle micro-motion (breathing, blinking, beat-bounce), and fast comedic cuts (Whip Pan, Smash Cut, Match Cut). - Render a QA contact sheet of key punchline frames across all scenes with blue Reels safe-zone guide lines (
y = 0.80 * H,x = 0.85 * W). Visually inspect every frame and fix any text clipping, LTR/RTL punctuation flips (such as EnglishREJECT!needingdir="ltr"), prop overlap, or safe-zone intrusion before rendering the video.
Step 4: Final MP4 Render and Verification
- Pipe deterministic frames directly from Chromium CDP (
Page.captureScreenshot) intoffmpeg(-c:v libx264 -pix_fmt yuv420p -crf 18 -preset medium -r 30 -c:a aac -b:a 192k -shortest -movflags +faststart). - Verify resolution (
1080x1920), frame rate (30/1), audio stream, and exact duration withffprobebefore delivering.
Gotchas
- FFmpeg
afadesilence bug: Placing-sswithoutasetpts=PTS-STARTPTSbeforeafadecausesafade=t=outto mute the entire clip. Always reset PTS first. - Chromium URL policy blocks: Never rely on
page.goto("file://...")or localhost URLs in restricted sandboxes. Inline fonts (base64@font-face) and JS intopage.set_content(html)for instant, reliable local rendering. - English exclamation marks in RTL canvas: When drawing English punchlines like
REJECT!on an RTL canvas, explicitly setctx.direction = 'ltr', otherwise!jumps to the left (!REJECT). - Colored emoji palette leaks: Avoid Unicode emojis like 📍 or 🔍 inside canvas text; draw matching hand-drawn ink icons instead so the strict 3-color palette stays intact.
- Duration pacing: For Reels retention, either build a punchy 20-30s hook clip or a full 55-65s story arc with escalating callbacks (never stretch sparse gags into slow dead air).