Skip to content
DeepikaReddygariPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Smart Clip (AI-Powered Video Transcript + Summary + Clips Generator)

This project implements a serverless pipeline on AWS to automatically process uploaded videos, generating transcripts, summaries, and short highlight clips (Key moments).

Architecture

The pipeline uses a combination of AWS services orchestrated by Step Functions:

  1. Frontend: An S3 static website (index.html) allows users to upload videos.
  2. Upload: API Gateway triggers the UploadHandler Lambda to store the video in an S3 input bucket.
  3. Preprocessing: An S3 trigger on the input bucket invokes the Preprocessor Lambda, which validates the file and starts the Step Functions execution.
  4. Step Functions Pipeline:
    • TranscriptionTrigger Lambda starts an AWS Transcribe job.
    • CheckTranscriptionStatus Lambda polls the Transcribe job status.
    • SummaryTrigger Lambda fetches the transcript, calls Amazon Bedrock (e.g., Claude) to generate a summary and identify clip timestamps, and saves the result to S3.
    • ClipTrigger Lambda takes the timestamps and submits individual jobs to AWS Elemental MediaConvert to generate MP4 clips, saving them to S3.
    • ResultHandler Lambda waits for all MediaConvert jobs, fetches the transcript and summary, compiles the final results (including clip URLs), and saves a JSON result file to S3.
  5. Results Display: The frontend polls S3 for the transcript, summary, and final result files, displaying them incrementally as they become available.

[User] --> [S3 Frontend] --> [API Gateway] --> [UploadHandler Lambda] --> [S3 Input Bucket]|v[Preprocessor Lambda] --> [Step Functions]|v[TranscriptionTrigger] --> [Transcribe] --> [S3 Transcripts]| (Poll Status)v[SummaryTrigger] --> [Bedrock] --> [S3 Summaries]|v[ClipTrigger] --> [MediaConvert] --> [S3 Clips] (Multiple Jobs)| (Wait All)v[ResultHandler] --> [S3 Results] --> [Frontend Polling S3 Buckets]

Code Artifacts

  • Lambda Functions (Python): Located in files like upload_handler.py, preprocessor.py, transcription_trigger.py, check_transcription_status.py, summary_trigger.py, clip_trigger.py, result_handler.py. Each requires necessary IAM permissions and environment variables (bucket names, ARNs, model IDs).
  • Frontend: index.html (includes HTML, Tailwind CSS via CDN, JavaScript for upload and polling).
  • State Machine: state_machine.json (Amazon States Language definition).

Deployment (High-Level)

  1. Create S3 Buckets: Create buckets for frontend hosting, input videos, transcripts, summaries, clips, and results. Configure public access, CORS, and bucket policies as needed.
  2. Configure IAM Roles: Create execution roles for each Lambda function and Step Functions, granting necessary permissions (S3, Transcribe, Bedrock, MediaConvert, Step Functions, CloudWatch Logs, IAM PassRole for MediaConvert).
  3. Deploy Lambda Functions: Package dependencies (if any) and upload the code for each Python function. Set required environment variables.
  4. Deploy State Machine: Create the Step Functions state machine using the state_machine.json definition, linking it to the correct Lambda function ARNs and IAM role. Update the Preprocessor Lambda with the State Machine ARN.
  5. Configure API Gateway: Create a REST API with an /upload resource (POST method) integrating with the UploadHandler Lambda (using proxy integration is recommended). Enable CORS.
  6. Configure S3 Triggers: Set up an S3 event notification on the input bucket to trigger the Preprocessor Lambda on object creation.
  7. Upload Frontend: Upload the index.html file to the frontend S3 bucket and enable static website hosting. Update URLs in index.html to point to your API Gateway endpoint and S3 bucket URLs.
  8. Bedrock Model Access: Ensure you have requested and received access to the desired Bedrock model (e.g., Claude) in your AWS region.
  9. MediaConvert Endpoint: Ensure the MediaConvert endpoint URL used in the Lambdas matches your region (or use environment variables).

Usage

  1. Access the S3 static website URL.
  2. Select a video file and click "Upload and Process Video".
  3. The frontend will show status updates.
  4. Transcript, Summary, and Clips will appear incrementally as they are processed.
  5. A final JSON result file can be downloaded.

TODO / Improvements

  • Implement a more robust preprocessing pipeline with error handling and notifications.
  • Replace S3 polling with WebSockets or SSE for better efficiency.
  • Secure S3 buckets (remove public access) and use signed URLs via an API endpoint.
  • Package Lambda dependencies properly.
  • Use Infrastructure as Code (e.g., SAM, CloudFormation, CDK, Terraform) for deployment.
  • Add input validation (file size, duration limits).
  • Optimize Bedrock prompts and parsing.
  • Allow user configuration (language, summary length, clip count).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages