Skip to content

Hans02-Neo/clipper-rust

Repository files navigation

Auto Clipper with AI Analysis 🎬✨

Rust License: MIT GitHub issues GitHub stars

🚀 Intelligent video clipper powered by Gemini AI - Automatically analyze YouTube videos and create viral-worthy clips with AI-suggested timestamps.

✨ Features

  • 🤖 AI-Powered Analysis: Gemini AI automatically identifies viral-worthy moments
  • 📺 YouTube Integration: Direct download and processing from YouTube URLs
  • High Performance: Built with Rust for maximum speed and efficiency
  • 🎯 Smart Clipping: Generates 3-5 optimized clips (10-30 seconds each)
  • 📝 Flexible Configuration: Support both AI mode and manual JSON configuration
  • 🔒 Secure: Environment-based API key management
  • 🎨 User-Friendly: Beautiful progress indicators and emoji feedback

🚀 Quick Start

Prerequisites

# Ubuntu/Debian
sudo apt install rustc cargo ffmpeg yt-dlp curl

# macOS
brew install rust ffmpeg yt-dlp curl

# Windows (using Chocolatey)
choco install rust ffmpeg yt-dlp curl

Installation

  1. Clone the repository
git clone https://github.com/Hans02-Neo/clipper-rust.git
cd clipper-rust
  1. Set up environment
cp .env.example .env
# Edit .env and add your Gemini API key
  1. Build the project
cargo build --release

Usage

🤖 AI Mode (Recommended)

./target/release/auto-clipper "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

📝 Manual Mode

./target/release/auto-clipper config.json

📖 Documentation

🎬 Demo

# Download and analyze a YouTube video
$ ./target/release/auto-clipper "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

🔍 Analyzing YouTube video...
📥 Downloading video...
⏱️  Video duration: 213.0s
🤖 Getting AI analysis...
📝 AI suggested clips:
{
  "input_video": "video.mp4",
  "clips": [
    {
      "start": "00:00:07",
      "end": "00:00:22",
      "output": "viral_clip_1.mp4"
    },
    // ... more clips
  ]
}
🎬 Processing 4 clips from video.mp4
✓ Created: viral_clip_1.mp4
✓ Created: viral_clip_2.mp4
✓ Created: viral_clip_3.mp4
✓ Created: viral_clip_4.mp4
🎉 Done!

🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   YouTube URL   │───▶│   yt-dlp        │───▶│   Video File    │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                                        │
┌─────────────────┐    ┌─────────────────┐             │
│   Gemini AI     │◀───│   AI Analysis   │◀────────────┘
└─────────────────┘    └─────────────────┘
         │                       │
         ▼                       ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  JSON Config    │───▶│   FFmpeg        │───▶│   Viral Clips   │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone and setup
git clone https://github.com/Hans02-Neo/clipper-rust.git
cd clipper-rust

# Install dependencies
cargo install --path .

# Run tests
cargo test

# Format code
cargo fmt

# Lint
cargo clippy

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📊 Stats

GitHub repo size GitHub code size in bytes Lines of code


Made with ❤️ by the community
Report Bug · Request Feature · Discussions

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages