AWS Builder Center
SL-Subtitle-Generator: An Event-Driven, 100% Serverless AI Subtitle Pipeline built on AWS!

SL-Subtitle-Generator: An Event-Driven, 100% Serverless AI Subtitle Pipeline built on AWS!

This article is sharing my recent project SL-Subtitle-Generator. A web application for uploading MP4 videos and generating subtitle .srt files, with optional translation into English, Chinese, and Japanese. Built as a polished proof-of-concept with attention to security, reliability, and cost efficiency.

Recently, I have been preparing for my AWS Certified Solutions Architect exam. To truly internalize cloud architectural best practices beyond theoretical study, I decided to design and execute a hands-on project from scratch: an automated AI pipeline that extracts audio from videos, transcribes, translates, and formats the output into .srt subtitle files.
Getting a side project to work is one thing, but deploying it publicly as a "Production-Ready" architecture is a completely different challenge. The hardest part wasn't calling the AI models; it was FinOps: How do I ensure system stability under high concurrency and prevent malicious requests from blowing up my AWS bill?
To solve this, I completely re-architected the backend based on Solutions Architect design principles. Here are the core decisions I made:
1️⃣ Zero-Trust & Direct Uploads (S3 Presigned URLs)
To bypass API Gateway's 10MB payload limit and Lambda execution timeouts, the frontend requests a presigned URL to upload directly to S3. I also embedded state parameters (target_language and user_email) directly into a sanitized, UUID-based S3 object path (uploads/lang/email/uuid.mp4), ensuring a completely stateless and clean data flow.
2️⃣ Asynchronous Decoupling & Orchestration (SQS + Step Functions)
S3 upload events don't trigger the processing logic directly. Instead, they act as event notifications buffered through an Amazon SQS queue. A Dispatcher Lambda consumes these messages and triggers an AWS Step Functions state machine. Since AI transcription (Amazon Transcribe) is a time-consuming async task, using Step Functions' Wait and Choice states for polling and dynamic language routing is infinitely more robust than chaining Lambdas.
3️⃣ The Ultimate FinOps Defense (DynamoDB Atomic Lock)
This is my favorite feature! To protect the compute-heavy AI APIs, I skipped generic gateway throttling and brought in Amazon DynamoDB. By leveraging its underlying conditional updates (ConditionExpression="CurrentUses < MaxUses"), I built a high-concurrency, atomic "invite code" system. The backend only issues an upload token if the database quota deduction succeeds, physically hard-capping any risk of bill shock.
🔄 How It Works (The User Journey):
  • 📤 Upload: Enter the invite code, select your target language, and upload a short video. It goes securely to S3.
  • 🧠 Processing: Behind the scenes, the Step Functions orchestrate the heavy lifting (speech-to-text & translation).
  • 📥 Delivery: Within minutes, Amazon SES automatically emails you a secure, temporary download link to your final .srt subtitle file! (Make sure to check your spam/junk folder just in case)
🎬 Now, I’d like to invite the Builder community for a Code Review and a Stress Test!
🔗 Live Demo: https://d3i0gw43qn3420.cloudfront.net/ 
🎟️ Invite Codes: builder20 (I injected a safety quota of 20 uses in DynamoDB. Once exhausted, the system automatically triggers a physical circuit breaker!)
📦 Architecture Diagram & Source Code: https://github.com/Shieliang/SL-Subtitle-Generator 
Fellow cloud engineers and builders, feel free to test the end-to-end workflow (make sure to use a video under 15 seconds, or my frontend compute-protection heuristic will block it 😆).
I’d love to hear your feedback, thoughts, or critiques on my Serverless architecture, async orchestration, and FinOps practices! 👇
Looking forward to connecting and hearing your thoughts! 😊
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article