Skip to main content

Command Palette

Search for a command to run...

I built an AI automated video generation agent using AWS. Here is how?

Updated
3 min read
B
Senior Software Engineer | Backend, Cloud, Data, Machine Learning

Project Overview – Wisdom Wealth Automated Video Generation System

This project is a fully automated, AI-powered video generation and publishing pipeline built on AWS. It generates finance-domain videos using generative AI, produces multimedia content, and automatically uploads them to YouTube.


Codebase Structure

The system consists of four independent repositories hosted on GitHub:

  1. wisdom_wealth

  2. youtube_video_upload_lambda

  3. wisdom_wealth_cleaner

  4. ec2_start_stop_lambda

Each repository is deployed independently through CI/CD.


CI/CD Pipeline

All repositories are integrated with AWS CodePipeline, which handles automated build and deployment.

Deployment targets:

  • wisdom_wealth → Deployed to Amazon EC2

  • youtube_video_upload_lambda → Deployed to AWS Lambda

  • wisdom_wealth_cleaner → Deployed to AWS Lambda

  • ec2_start_stop_lambda → Deployed to AWS Lambda

This separation ensures modularity, scalability, and independent lifecycle management.


Scheduled Automation Layer

A scheduled rule in Amazon EventBridge periodically triggers the ec2_start_stop_lambda.

This Lambda function:

  • Starts the EC2 instance (if stopped)

  • Initiates the video generation workflow inside the wisdom_wealth application

This ensures compute resources are only active when needed, optimizing cost.


AI-Powered Video Generation Workflow

Once triggered, the wisdom_wealth The application executes the following pipeline:

Script Generation

A finance-domain script is generated using a large language model from Amazon Bedrock.


Script Processing

The generated script is:

  • Split into individual sentences

  • Each sentence is processed independently


Multimedia Generation

For each sentence:

  • Image generation via Amazon Bedrock image models

  • Audio narration generated using Amazon Polly

This creates synchronized visual and audio assets for every sentence.


Video Stitching

All generated:

  • Images

  • Audio clips

are stitched together using a video editing engine running on EC2 to produce a final video file.


Storage and Metadata Management

After video generation:

  • The final video is uploaded to Amazon S3

  • Metadata (title, description, tags, status) is stored in Amazon DynamoDB

This metadata acts as the control layer for publishing and tracking upload status.


YouTube Publishing Pipeline

The youtube_video_upload_lambda runs periodically and:

  1. Reads pending records from DynamoDB

  2. Uploads the corresponding video from S3 to YouTube

  3. Updates the upload status in DynamoDB

Videos are published on the channel:
https://www.youtube.com/@trillionaireequation2074


Failure Handling & Cleanup

If a YouTube upload fails:

  • The wisdom_wealth_cleaner Lambda runs periodically

  • It detects failed or stale records

  • Performs cleanup and status correction in DynamoDB

This ensures system consistency and prevents stuck records.


Architectural Characteristics

  • Fully automated

  • Event-driven

  • Serverless + EC2 hybrid architecture

  • AI-powered content generation

  • Cost-optimized through scheduled compute

  • Modular repository structure

  • Production-grade CI/CD