Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tutorial Video Generator

AI-powered tutorial video generator - Automatically create professional tutorial videos from documentation and code.

✨ Features

  • πŸ€– Fully Automated - AI reads docs, plans tutorial, records operations, generates narration
  • 🎬 Professional Quality - 1080p videos with synchronized voiceover, highlights, and transitions
  • πŸ†“ Completely Free - Uses local models (CSGLite) + free TTS (Edge TTS) - NO API keys required
  • 🌍 Multilingual - Chinese and English narration support
  • 🎯 Multiple Scenarios - Quickstart, Feature Tour, Developer Integration guides
  • πŸ”’ Privacy-First - All processing can happen locally

πŸš€ Quick Start (Fully Local - No API Keys)

Prerequisites

  1. CSGLite - Running locally

    csghub-lite serve
  2. Basic Dependencies

    # Already included in Claude Code:
    # - FFmpeg βœ“
    # - Playwright βœ“

Installation

# Clone the repository
git clone https://github.com/frankfika/tutorial-video-gen.git
cd tutorial-video-gen

# Run setup (installs Edge TTS in virtual environment)
./install.sh

Generate Your First Video

# Activate the environment
source venv/bin/activate

# Generate a quickstart tutorial
/tutorial-video-gen quickstart --repo ~/your-project --lang zh

That's it! Your video will be ready in ~6-10 minutes.

πŸ“Ή What Gets Generated

Each video includes:

  • βœ… Professional title card
  • βœ… Step-by-step demonstrations (6-8 steps)
  • βœ… Natural narration (Chinese/English)
  • βœ… Visual highlights on clicks
  • βœ… Smooth transitions
  • βœ… Resource links and outro
  • βœ… 1920x1080 Full HD, ~40-50MB

Example Output Structure

0:00 - 0:05   Title: "Project Name - Quick Start"
0:05 - 0:20   Installation steps
0:20 - 0:50   First run demonstration
0:50 - 1:10   Basic interaction
1:10 - 1:35   UI overview
1:35 - 2:10   Common workflows
2:10 - 2:20   Next steps & resources

🎯 Supported Scenarios

1. Quickstart Tutorial (2-3 minutes)

Perfect for new users - installation, configuration, first example

/tutorial-video-gen quickstart --repo ~/my-app

2. Feature Tour (5-8 minutes)

Comprehensive overview of all main features

/tutorial-video-gen feature-tour --url http://localhost:3000

3. Developer Integration (5-10 minutes)

API documentation and code examples for developers

/tutorial-video-gen developer --repo ~/my-sdk --focus "REST API"

βš™οΈ Configuration Modes

Mode 1: Fully Local (Recommended)

NO API keys needed!

# .env configuration
MODE=local
CSGLITE_URL=http://localhost:11435
CSGLITE_MODEL=Qwen/Qwen2.5-7B-Instruct
TTS_PROVIDER=edge-tts

Pros:

  • βœ… Completely free
  • βœ… Full privacy (no data leaves your machine)
  • βœ… Unlimited usage
  • βœ… No API quotas

Requirements:

  • CSGLite running locally with 7B+ model
  • Edge TTS installed (pip install edge-tts)

Mode 2: Hybrid

Mix local and cloud for best balance

# Option A: Local LLM + Cloud TTS
MODE=hybrid
CSGLITE_URL=http://localhost:11435
OPENAI_API_KEY=sk-...
TTS_PROVIDER=openai

# Option B: Cloud LLM + Local TTS
DEEPSEEK_API_KEY=sk-...
TTS_PROVIDER=edge-tts

Mode 3: Cloud

Highest quality, requires API keys

MODE=cloud
OPENAI_API_KEY=sk-...
TTS_PROVIDER=openai

Cost: ~$0.15-$0.35 per video

See CONFIG_GUIDE.md for detailed configuration options.

πŸ›  How It Works

5-Phase Workflow

1. Analyze (30s-1min)
   β”œβ”€ AI reads README and code
   β”œβ”€ Extracts features and workflows
   └─ Understands project structure

2. Plan (1-2min)
   β”œβ”€ Generates detailed tutorial script
   β”œβ”€ Plans 6-8 demonstration steps
   └─ Writes narration for each step

3. Record (2-3min)
   β”œβ”€ Playwright executes browser operations
   β”œβ”€ asciinema records terminal commands
   └─ Adds visual highlights

4. Narrate (1-2min)
   β”œβ”€ AI polishes narration text
   └─ TTS converts to speech

5. Compose (1-2min)
   β”œβ”€ FFmpeg combines all clips
   β”œβ”€ Overlays audio and effects
   └─ Exports final MP4

Total: ~6-10 minutes

πŸ“š Documentation

πŸ§ͺ Testing

# Test all dependencies
python3 test.py

# Test local LLM connection
python3 utils/llm_provider.py

# Test TTS providers
python3 utils/local_tts.py

πŸ“– Examples

Generate CSGLite Tutorial

/tutorial-video-gen quickstart \
  --repo ~/csglite \
  --lang zh \
  --output csglite-quickstart.mp4

Generate Web App Tour

/tutorial-video-gen feature-tour \
  --url http://localhost:3000 \
  --duration 6 \
  --lang en

Generate API Integration Guide

/tutorial-video-gen developer \
  --repo ~/my-sdk \
  --api-docs ~/my-sdk/docs/api \
  --focus "Authentication"

🎨 Customization

Change Narration Style

Edit templates/narration-styles.json:

  • casual - Friendly, conversational
  • formal - Professional, structured
  • technical - Expert-level terminology
  • beginner - Encouraging, slow-paced

Change Video Quality

# Higher quality (larger file)
VIDEO_QUALITY=18 /tutorial-video-gen quickstart

# Lower quality (smaller file)
VIDEO_QUALITY=28 /tutorial-video-gen quickstart

Change Voice

# For Chinese
TTS_VOICE_ZH=zh-CN-YunxiNeural  # Male
TTS_VOICE_ZH=zh-CN-XiaoxiaoNeural  # Female (default)

# For English
TTS_VOICE_EN=en-US-GuyNeural  # Male
TTS_VOICE_EN=en-US-JennyNeural  # Female (default)

πŸ”§ Troubleshooting

"CSGLite not running"

csghub-lite serve

"Edge TTS not found"

source venv/bin/activate
pip install edge-tts

"FFmpeg not found"

# macOS
brew install ffmpeg

# Linux
sudo apt install ffmpeg

"Playwright browser not installed"

python3 -m playwright install chromium

πŸ’‘ Pro Tips

  1. Use 7B+ models for best results with local LLM
  2. Edge TTS is free and nearly matches Azure Speech quality
  3. Batch generate tutorials without API limits using local mode
  4. Start with quickstart scenario to verify setup
  5. Keep README updated for better AI analysis

🌟 Why This Project?

  • πŸ“Ή Save Time - Generate tutorials automatically instead of manual recording
  • πŸ”„ Stay Updated - Regenerate tutorials when code changes
  • 🌍 Reach More Users - Easy to create multilingual versions
  • πŸ’° Zero Cost - Completely free when using local mode
  • πŸ”’ Privacy - Your code never leaves your machine (local mode)

πŸ“Š Provider Comparison

Provider Cost Quality Privacy Installation
CSGLite + Edge TTS Free Very Good βœ… Local Easy
DeepSeek + Edge TTS $0.14/video Very Good ⚠️ Cloud LLM Easy
OpenAI (both) $0.35/video Best ⚠️ Cloud Easy

🀝 Contributing

Contributions welcome! Areas for improvement:

  • Add more tutorial scenarios
  • Improve code highlighting
  • Add subtitle generation
  • Support more languages
  • Custom branding options
  • YouTube auto-upload
  • Interactive video player

πŸ“„ License

MIT License - see LICENSE

πŸ™ Acknowledgments

Built with:

  • Claude Code - AI orchestration and workflow
  • Playwright - Browser automation
  • FFmpeg - Video processing
  • Edge TTS - Free text-to-speech
  • CSGLite - Local LLM inference

πŸ”— Links


Made with ❀️ for the open source community

Generate your first tutorial video in under 10 minutes - completely free!

About

AI-powered tutorial video generator - Automatically create professional tutorial videos from documentation and code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages