Skip to content

dr34ming/shorts-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI-Powered YouTube Shorts Generator

Next-gen viral content creation using AI reasoning, Manim animations, Remotion effects, and automated YouTube uploads.

🌟 Key Features

🧠 AI Scene Generation (NEW!)

  • Extended Thinking: Claude Opus 4.5 with 10k token reasoning budget
  • Semantic Understanding: AI analyzes content and generates custom visual metaphors
  • Artistic Composition: Spatial layout, color psychology, camera movement
  • Both Formats: 16:9 horizontal + 9:16 vertical
  • Audio Sync: Perfect timing with voiceover segments
  • Template Evolution: A/B testing framework for winning patterns

🎬 Viral Title Animations

  • 9 Preset Styles: ChromaticSmash, GlitchAssemble, TripleHit, ElasticSlam, WhipPan, NuclearDrop, PixelExplode, VaporTrail, ZoomPulse
  • Remotion + Three.js: 3D graphics with programmatic control
  • Edge-to-Edge Text: Maximum impact with minimal margins
  • Viral Effects: Chromatic aberration, screen shake, glitch, flash frames

πŸš€ Production Automation

  • One-Command Upload: OAuth 2.0 YouTube integration
  • Batch Processing: Generate multiple variants for A/B testing
  • Brain Rot B-Roll: Auto-download viral background footage
  • Format Flexibility: Vertical (9:16) or horizontal (16:9)

Prerequisites

1. Node.js & npm

# Check if installed
node --version
npm --version

# Install if needed (macOS)
brew install node

2. Python 3.8+

# Check version
python3 --version

# Install if needed (macOS)
brew install python3

3. FFmpeg

# Check if installed
ffmpeg -version

# Install if needed (macOS)
brew install ffmpeg

4. Remotion Dependencies

cd remotion-shorts
npm install

5. YouTube API Setup (for uploads)

IMPORTANT: Keep credentials secure! Never commit secrets to git.

Option A: Use Existing Credentials (via infi)

If you have access to the infi secrets manager:

# Credentials are automatically available via infi command
infi

Option B: Create New Google Cloud Credentials

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable YouTube Data API v3:
    • Navigate to "APIs & Services" β†’ "Library"
    • Search "YouTube Data API v3"
    • Click "Enable"
  4. Create OAuth 2.0 credentials:
    • Go to "APIs & Services" β†’ "Credentials"
    • Click "Create Credentials" β†’ "OAuth 2.0 Client ID"
    • Application type: Desktop app
    • Name it (e.g., "YouTube Shorts Uploader")
    • Download the JSON file
  5. Save as client_secrets.json in project root
    # Move downloaded file to project
    mv ~/Downloads/client_secret_*.json /Volumes/Stick/shorts-project/client_secrets.json

Security Note: client_secrets.json is in .gitignore and will NOT be committed.

6. Python Virtual Environment & Dependencies

# Create virtual environment
cd /Volumes/Stick/shorts-project
python3 -m venv youtube_env

# Activate it
source youtube_env/bin/activate

# Install YouTube API packages
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client

Project Structure

shorts-project/
β”œβ”€β”€ manim-animations/              # πŸ†• AI-powered Manim scenes
β”‚   β”œβ”€β”€ ai_scene_generator.py     # Core AI reasoning engine
β”‚   β”œβ”€β”€ batch_generate.py         # A/B test variant generator
β”‚   β”œβ”€β”€ transcript_builder.py     # Create transcript JSON
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   β”œβ”€β”€ successful/           # Winning templates
β”‚   β”‚   β”œβ”€β”€ variants/             # A/B test candidates
β”‚   β”‚   └── archive/              # Historical versions
β”‚   β”œβ”€β”€ WORKFLOW.md               # Usage guide
β”‚   β”œβ”€β”€ TRANSCRIPT_FORMAT.md      # Input spec
β”‚   └── TEMPLATES_NOTES.md        # Evolution strategy
β”‚
β”œβ”€β”€ remotion-shorts/              # Remotion viral effects
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ TitleViralTest.tsx   # 9 viral animations
β”‚   β”‚   β”œβ”€β”€ YouTubeShort.tsx     # YouTube Shorts compositions
β”‚   β”‚   β”œβ”€β”€ DualThreeScene.tsx   # Full-length videos with 3D
β”‚   β”‚   └── Root.tsx             # All compositions
β”‚   └── public/                  # Audio files, b-roll
β”‚
β”œβ”€β”€ output/                      # Rendered videos
β”‚   β”œβ”€β”€ viral_tests/            # Individual animation tests
β”‚   └── youtube_shorts/         # Final YouTube Shorts
β”‚
β”œβ”€β”€ youtube_uploader.py          # YouTube upload automation
β”œβ”€β”€ broll_downloader.py          # Brain rot footage scraper
β”œβ”€β”€ client_secrets.json          # OAuth credentials (DO NOT COMMIT)
β”œβ”€β”€ youtube_token.pickle         # OAuth token (DO NOT COMMIT)
└── README.md                    # This file

Usage

🧠 AI Scene Generation (Recommended for Quote Videos)

Quick Start

cd manim-animations

# 1. Create a transcript
cat > my_quotes.json << 'EOF'
{
  "total_duration": 9.0,
  "format": "horizontal",
  "resolution": "1920x1080",
  "theme": "auto",
  "segments": [
    {"start": 0.0, "end": 3.0, "text": "Dream big"},
    {"start": 3.0, "end": 6.0, "text": "Work hard"},
    {"start": 6.0, "end": 9.0, "text": "Stay humble"}
  ]
}
EOF

# 2. Generate AI scene (requires ANTHROPIC_API_KEY)
export ANTHROPIC_API_KEY='your-key-here'
python ai_scene_generator.py my_quotes.json my_scene.py

# 3. Render with Manim
source manim_env/bin/activate
manim -pql my_scene.py AIGeneratedScene

# 4. Upload to YouTube
cd ..
python youtube_uploader.py \
  manim-animations/media/videos/my_scene/480p15/AIGeneratedScene.mp4 \
  "Motivational Quotes" \
  "AI-generated animation #shorts"

What Makes It Special

  • AI Reasoning: 10,000 token thinking budget analyzes your content
  • Visual Metaphors: Automatically chosen based on theme (growth β†’ rising graphs, contrast β†’ diverging paths)
  • Artistic Composition: Rule of thirds, color psychology, dynamic camera movement
  • Format Aware: Adapts spatial layout for 16:9 vs 9:16
  • Audio Sync: Perfect timing when audio files provided

Generate A/B Test Variants

# Generate 5 different versions to test
python batch_generate.py my_quotes.json 5

# Renders 5 unique AI-generated interpretations
# Pick the best performer after testing!

See manim-animations/WORKFLOW.md for full documentation.

🎬 Remotion Viral Animations

Render Single Viral Animation

cd remotion-shorts
npx remotion render Viral-01-ChromaticSmash output.mp4

Render YouTube Short

npx remotion render YT-Short-02-WatchThis output/watch_this.mp4

Render All 9 Viral Tests

for i in {1..9}; do
  npx remotion render Viral-0${i}-* output/viral_0${i}.mp4
done

Uploading to YouTube

First Time Setup

# Activate Python virtual environment
cd /Volumes/Stick/shorts-project
source youtube_env/bin/activate

# First upload will open browser for authorization
python youtube_uploader.py \
  output/youtube_shorts/02_watch_this.mp4 \
  "Watch This Transition πŸ‘€" \
  "Smooth viral edit effects #shorts #transition"

A browser will open asking you to authorize the app. After approval:

  • Token is saved to youtube_token.pickle
  • Future uploads are automatic (no browser needed)

Upload with Options

# Public upload with tags
python youtube_uploader.py \
  video.mp4 \
  "Title" \
  "Description" \
  --tags "shorts,viral,transition,effects"

# Private upload
python youtube_uploader.py video.mp4 "Title" "Desc" --private

# Unlisted upload
python youtube_uploader.py video.mp4 "Title" "Desc" --unlisted

Batch Upload Multiple Videos

# Upload all YouTube Shorts
for video in output/youtube_shorts/*.mp4; do
  python youtube_uploader.py "$video" \
    "Viral Transition Effects" \
    "Eye-catching animations #shorts" \
    --tags "shorts,viral,effects"
done

Available Compositions

Viral Title Tests (2 seconds each)

  • Viral-01-ChromaticSmash - RGB split + screen shake
  • Viral-02-GlitchAssemble - Digital slices assembling
  • Viral-03-TripleHit - Three quick impacts
  • Viral-04-ElasticSlam - Elastic bounce with chromatic trail
  • Viral-05-WhipPan - Fast horizontal whip
  • Viral-06-NuclearDrop - Massive gravity drop
  • Viral-07-PixelExplode - Pixelated dissolution
  • Viral-08-VaporTrail - Motion blur with color trails
  • Viral-09-ZoomPulse - Rhythmic zoom with glow

YouTube Shorts (Ready to Upload)

  • YT-Short-01-BestTransition - 10.5s, 6 animations with numbered labels
  • YT-Short-02-WatchThis - 6s, 3 smooth effects
  • YT-Short-03-Smoothest - 7.5s, 4 premium effects

Full Videos (30-60 seconds)

  • 01-Bitcoin through 10-History - Educational shorts with voiceover
  • LLM-Attention, LLM-Temperature, LLM-Context - AI explainers

Customization

Create Custom YouTube Short

Edit remotion-shorts/src/Root.tsx:

<Composition
  id="YT-Short-Custom"
  component={YouTubeShort}
  fps={30}
  durationInFrames={270}  // 9 seconds
  width={1080}
  height={1920}
  defaultProps={{
    hookText: "Your hook text here πŸ”₯",
    animations: [
      { term: "WORD1", variantNum: 1 },  // ChromaticSmash
      { term: "WORD2", variantNum: 5 },  // WhipPan
      { term: "WORD3", variantNum: 8 },  // VaporTrail
    ],
  }}
/>

Adjust Animation Timing

Viral animations are defined in src/TitleViralTest.tsx. Each case in the switch statement controls:

  • titleScale - Size transformations
  • titleOpacity - Fade in/out
  • titleTranslateX/Y - Movement
  • chromaticAberration - RGB separation
  • screenShakeX/Y - Impact shake
  • flashOpacity - White flashes

Troubleshooting

YouTube Upload Errors

"Client secrets not found"

  • Make sure client_secrets.json exists in project root
  • Verify it's valid JSON (not HTML error page)

"Access denied" or "Invalid grant"

  • Delete youtube_token.pickle
  • Run uploader again to re-authorize

"Quota exceeded"

  • YouTube API has daily upload quota limits
  • Default: 10,000 units/day (1 upload = ~1,600 units)
  • Request quota increase in Google Cloud Console if needed

Remotion Rendering Issues

"Out of memory"

  • Reduce concurrency: npx remotion render --concurrency=2
  • Close other applications

"Module not found"

cd remotion-shorts
rm -rf node_modules package-lock.json
npm install

Security Checklist

  • βœ… client_secrets.json in .gitignore
  • βœ… youtube_token.pickle in .gitignore
  • βœ… Never paste credentials in chat/code
  • βœ… Use environment variables or infi for secrets
  • βœ… Revoke OAuth tokens if compromised (Google Cloud Console)

GitHub Setup (Private Repository Only)

⚠️ IMPORTANT: This repository must be PRIVATE if pushed to GitHub

Contains OAuth credentials and potentially sensitive video content.

Create Private GitHub Repository

# Initialize git if not already done
cd /Volumes/Stick/shorts-project
git init

# Add all files (secrets are in .gitignore)
git add .
git commit -m "Initial commit: Viral YouTube Shorts generator"

# Create private repo on GitHub, then:
git remote add origin git@github.com:YOUR_USERNAME/shorts-project.git
git branch -M main
git push -u origin main

Verify Repository is Private

  1. Go to https://github.com/YOUR_USERNAME/shorts-project/settings
  2. Scroll to "Danger Zone"
  3. Confirm visibility is Private
  4. If public, click "Change visibility" β†’ "Make private"

Never make this repository public!

Credits

Created with Claude Code (Sonnet 4.5) using:

License

MIT - Feel free to use for your own viral content!

About

AI-powered YouTube Shorts generation: Manim scenes with extended thinking + Remotion viral effects + auto-upload

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors