Skip to content

Auto generates the videos from Models then process them and Post on Social Media

Notifications You must be signed in to change notification settings

manideep1428/Viral_Reel_poster

Repository files navigation

YT-VEO3 Content Generation Pipeline

An automated pipeline to generate stunning video content for YouTube and Instagram using AI-generated scripts, images, and video transitions.

🚀 How It Works

The pipeline orchestrates a multi-step process to create high-quality, engaging content:

  1. AI Script Generation: Generates a thematic script (JSON) including image prompts, video transition prompts, and social media metadata (titles, descriptions, tags).
  2. Parallel Image Generation: Uses AI models to generate 4 high-resolution images based on the script's prompts.
  3. Dynamic Video Transitions: Generates 3 video segments that smoothly transition between the generated images (1→2, 2→3, 3→4).
  4. Video Composition: Merges the segments into a single final video using moviepy.
  5. Automated Social Posting: Simultaneously uploads the final video to YouTube and Instagram Reels.
  6. Cleanup: Automatically removes intermediate files to save space.

📸 Workflow Visualization

1. Generated Images

The system generates a series of images that tell a story or show a transformation:

Image 1 (Before) Image 4 (After)
Image 1 Image 4

2. Video Transitions

The pipeline generates smooth animations between the images:

Transition 1 (1 → 2) Transition 2 (2 → 3) Transition 3 (3 → 4)

3. Final Output

A combined, high-quality video ready for social media:

Final Location: output/final_video_20260201_174256.mp4


🛠️ Local Setup & Usage

Prerequisites

  • Python 3.10+
  • Google Cloud Project (for YouTube API)
  • Instagram Business Account (for Instagram Graph API)
  • Supabase account (if using for storage/logs)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd yt-veo3
  2. Create a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure Environment Variables: Copy the example env file and add your credentials:

    cp .env.example .env

    Then edit .env with your actual values:

    GOOGLE_API_KEY=your_google_api_key
    INSTAGRAM_TOKEN=your_instagram_graph_token
    INSTAGRAM_USER_ID=your_instagram_user_id
    SUPABASE_URL=your_supabase_url
    SUPABASE_KEY=your_supabase_key
  5. YouTube API Credentials: For a quick start, you can copy the example file:

    cp client_secrets..example.json client_secrets.json

    Then fill in your client_id and client_secret from the Google Cloud Console.

    To set up from scratch:

    1. Go to the Google Cloud Console.
    2. Create a new project.
    3. Enable API: Search for "YouTube Data API v3" and click Enable.
    4. OAuth Consent Screen:
      • Select External.
      • Fill in the required app information.
      • Scopes: Add https://www.googleapis.com/auth/youtube.upload.
      • Test Users: Add your own Google email address (This is required while the app is in "Testing" mode).
    5. Credentials:
      • Click Create Credentials > OAuth client ID.
      • Select Application Type: Desktop app.
      • Download the JSON file and rename it to client_secrets.json.
    6. Place client_secrets.json in the root of this project.
  6. Generate token.pkl: The first time you run main.py or yt.py, a browser window will open asking you to log in to your Google account.

    • Select the account you added as a Test User.
    • Grant the requested permissions.
    • Once successful, the script will automatically create a token.pkl file. This file stores your authentication so you won't need to log in again.

Caution

Security Note: Never commit client_secrets.json, token.pkl, or .env to a public repository. They contain sensitive API keys and access tokens. These files are already included in .gitignore.

Running the Pipeline

To start the full generation and upload process, simply run:

python main.py

The script will log progress to the console and to pipeline.log.


📽️ Output Examples

Transitions

The pipeline creates smooth transitions between images. You can find the individual segments in the generated_videos/ directory.

Final Video

The final combined video is saved in the output/ directory.

  • Location: output/final_video_YYYYMMDD_HHMMSS.mp4
  • Resolution: 1080x1920 (Standard Reel/Short format)

📂 Project Structure

  • main.py: The main orchestration script.
  • models/: Contains the AI logic for scripts, images, and video generation.
  • yt.py: YouTube API integration for uploads.
  • instagram.py: Instagram Graph API integration for Reels.
  • generated_images/: Temporary storage for generated image assets.
  • generated_videos/: Temporary storage for generated video segments.
  • output/: Final combined videos.

📝 License

[Specify License Here]

About

Auto generates the videos from Models then process them and Post on Social Media

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages