Skip to content

itsshresth/brainrot

Repository files navigation

Brainrot Reel Generator

This project is a modular Python application that generates viral "brainrot" style video reels using AI-powered script generation, text-to-speech, and automated video editing.

Features

  • AI script generation using Alchemyst API
  • Character voice generation using ElevenLabs API or local TTS fallback
  • Automatic video creation with background and character overlays
  • Modular codebase for easy extension and maintenance
  • Error handling and fallback logic for reliability

##Sample Video

brainrot_reel_20250630_171003.mp4

##ARCHITECTURE

flowchart TD
    subgraph Assets
        A1[assets/backgrounds]
        A2[assets/characters]
        A3[assets/output]
    end

    subgraph Temp
        T1[temp/]
        T2[temp_audio/]
    end

    subgraph Config
        C1[.env]
        C2[config.py]
    end

    subgraph Core
        M[main.py]
        SG[script_generator.py]
        VG[voice_generator.py]
        VC[video_creator.py]
        U[utils.py]
        S[subtitles.py]
    end

    subgraph Tests
        TST1[test.py]
        TST2[testac]
    end

    %% Flow
    M --> SG
    M --> VG
    M --> VC
    M --> U
    M --> C2
    M --> C1

    SG -->|Uses| C1
    SG -->|Uses| C2
    SG -->|Writes/Reads| T2

    VG -->|Reads| SG
    VG -->|Uses| C1
    VG -->|Uses| C2
    VG -->|Reads/Writes| T2

    VC -->|Reads| VG
    VC -->|Reads| A1
    VC -->|Reads| A2
    VC -->|Writes| A3
    VC -->|Uses| C2

    U -->|Utility| M

    S --> VC

    TST1 --> M
    TST2 --> M

    %% Asset/Temp relations
    VC -->|Temp Files| T1
    VC -->|Temp Audio| T2

    %% Show outputs
    A3 -->|Final Videos| OUT[User]
Loading

Folder Structure

AI/
├── assets/
│   ├── backgrounds/
│   ├── characters/
│   └── output/
├── temp/
├── temp_audio/
├── .env
├── config.py
├── main.py
├── requirements.txt
├── script_generator.py
├── subtitles.py
├── test.py
├── testac
├── utils.py
├── video_creator.py
└── voice_generator.py

Setup Instructions

  1. Clone the repository

    git clone https://github.com/itsshresth/brainrot.git
    cd brainrot
    
  2. Install Python dependencies

    pip install -r requirements.txt
    
  3. Install FFmpeg

    • Windows: choco install ffmpeg
    • macOS: brew install ffmpeg
    • Linux: sudo apt install ffmpeg
  4. Create a .env file in the project root with your API keys:

    ALCHEMYST_API_KEY=your_alchemyst_key_here
    ELEVENLABS_API_KEY=your_elevenlabs_key_here
    
  5. (Optional) Add background videos and character images

    • Place vertical MP4 backgrounds in assets/backgrounds/
    • Place PNG character images in assets/characters/

Usage

Run the main application:

python main.py

Follow the prompts:

  • Choose a character
  • Enter your topic and context
  • Wait for the video to be generated in assets/output/

License

MIT License

Support

For issues or feature requests, open an issue on GitHub.

About

Generate brainrot ai videos about any topic you want (uses alchemyst ai)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages