How We Built a Serverless Video Transcoding Pipeline for a Media Startup — A Vietnam Offshore + AI Orchestration Case Study
If you’ve ever tried to build a scalable video processing pipeline from scratch, you know it’s a recipe for disaster.
The storage costs alone can kill a startup. Then you add compute, bandwidth, and the dreaded “we need to support every codec under the sun.” Most teams either over-provision clusters or burn cash on cloud transcoding services.
React 20 vs Vue 4 vs Angular 20: Which Framework Should You Use in 2026?
Three major frontend framework releases in early 2026 have reshaped the landscape. React 20 with its compiler, Vue… ...
This media startup came to us with a brutal problem: they had 50,000 users uploading short-form videos, and their old batch-processing system took 45 minutes per clip. Users were leaving. Churn was hitting 12% monthly.
They needed a system that could handle 10,000 uploads per day, support 4K resolution, and keep per-video cost under $0.10.
Why Vietnam Outsourcing Is Winning: A CTO’s Honest Guide to Offshore Development in 2025
TL;DR: Vietnam outsourcing is no longer just a cost play. It’s a strategic move for startups and enterprises… ...
Here’s how we pulled it off with a team of 6 Vietnamese engineers based in Ho Chi Minh City and the ECOA AI Platform ACP.
The Architecture: Serverless, Event-Driven, AI-Orchestrated
We designed a fully serverless pipeline using AWS Lambda, S3, and Step Functions — but with a twist.
Instead of hard-coding workflow stages, we used ECOA AI Platform ACP to dynamically orchestrate transcoding jobs. The platform decided which codec profile to apply based on the input file’s metadata, user device preferences, and current cloud cost.
Why? Because static DAGs waste money. Transcoding a 720p video with a 4K preset? That’s throwing cash into the fire. The AI orchestrator chooses the optimal workflow per upload.
Here’s the simplified flow:
- Upload trigger — S3 event invokes a Lambda function that extracts metadata (resolution, codec, bitrate).
- Orchestrator decision — ECOA ACP evaluates the metadata and selects a transcoding plan.
- FFmpeg Lambda — A containerized Lambda (max 10GB RAM) runs FFmpeg with the chosen parameters.
- AI content moderation — A second agent runs a lightweight ML model to flag inappropriate content.
- Result storage — Transcoded files are stored in S3, metadata in DynamoDB.
- Callback — A webhook notifies the startup’s frontend that the video is ready.
The orchestrator also handles retries, dead-letter queues, and scaling. We never touched scaling — Lambda auto-scales, but the platform prevents runaway costs by capping concurrent executions per account.
The Numbers That Matter
| Metric | Before | After | Improvement |
|---|---|---|---|
| Average processing time (720p) | 45 min | 2.5 min | 94% faster |
| Average processing time (4K) | 120 min | 6.8 min | 94% faster |
| Cost per video | $0.15 | $0.06 | 60% reduction |
| Monthly uptime | 99.2% | 99.95% | +0.75% |
| Team size | 12 (full-stack) | 6 (Vietnam team + AI) | 50% smaller |
We didn’t just cut costs. We eliminated the bottleneck completely. The startup’s churn dropped to 3% within two months.
Why Use AI Orchestration for Transcoding?
Honestly, you could build a basic pipeline with Lambda + Step Functions in a week. But that’s the trap — it works fine for 100 videos a day. At 10,000, the edge cases multiply.
What happens when a user uploads a corrupted file? Or when AWS hits a concurrency limit? Or when a new codec (like AV1) becomes popular? Static workflows break. Our AI-driven orchestrator adapts.
Here’s a snippet from the orchestrator config:
yaml
# ECOA ACP dynamic pipeline definition
pipeline:
- agent: metadata_extractor
trigger: s3:ObjectCreated:*
output: metadata_event
- agent: transcoder_selector
input: metadata_event
rules:
- if: "{metadata.resolution} == '4K' && {metadata.codec} == 'h264'"
then: use_hevc_preset
- if: "{metadata.bitrate} > 15000"
then: use_2pass_encoding
- default: use_standard_preset
output: transcoding_plan
- agent: ffmpeg_runner
input: transcoding_plan
timeout_seconds: 600
max_retries: 2
- agent: content_moderator
input: transcribed_clip
model: llama-3.2-vision-11b (quantized)
threshold: 0.85
That’s it. The platform handles the rest — scaling, fault tolerance, and logging.
Real-World Lessons from the Trenches
Cold starts hurt. Lambda containers with FFmpeg take 5-10 seconds to warm up. We mitigated this by provisioning concurrency for the ffmpeg_runner agent — cost an extra $20/month but saved 30% on user-facing latency.
AI moderation isn’t free. Running a vision LLM on every frame is expensive. We sampled keyframes at 2-second intervals and only moderated videos flagged by a cheap heuristic (e.g., sudden brightness changes). This cut ML costs by 70%.
The Vietnamese team’s edge. Our lead engineer in Can Tho had built a similar pipeline for a local streaming platform. He spotted the deadlock issue in our initial design within two days — we’d planned synchronous Lambda invocations for the moderation step. He pointed out that could cause timeouts under load. We switched to async SQS, and it never broke.
You can’t get that kind of practical intuition from a random contractor. You need engineers who’ve *been there*.
What Could Have Gone Wrong
Let’s be honest — we almost shipped a disaster.
The first version used a monolithic Step Function with 12 states. It worked in testing. In production, every 100th video caused a state transition timeout. The orchestrator retried, but it doubled processing time.
We fixed it by breaking the pipeline into two independent flows: one for transcoding, one for moderation. The orchestrator merges results at the end.
*Would a traditional offshore team have caught that before deployment?* Probably not. Our Vietnam team ran chaos testing — deliberately injecting corrupted files and simulating Lambda throttling — during the second sprint. They found the timeout pattern before we went live.
The Bottom Line
This startup shipped their new platform in 6 weeks, not 6 months. They’re now processing 15,000 videos daily and the system hasn’t had a single outage in 4 months. The total cost? $1,000/month for the Vietnamese development team (two seniors, four mids) plus $2,800/month for AWS resources. That’s less than one mid-level US engineer’s salary.
You don’t need a massive in-house team. You need the right architecture, the right AI orchestration, and a team that knows how to wire them together.
That’s what we do at ECOAAI.
—
Frequently Asked Questions
Q: How did the AI orchestrator handle sudden traffic spikes?
A: The ECOA ACP platform uses a dynamic concurrency limiter tied to Lambda reserved concurrency. If the queue grows beyond 1,000 pending videos, it automatically slows down ingestion and prioritizes shorter clips (< 30 seconds) to maintain < 5 second response time for users.
Q: Could we use AWS Elemental MediaConvert instead of custom FFmpeg?
A: Yes, but at 10,000 videos/day, MediaConvert would cost roughly $0.12/video — double our solution. For a startup burning runway, $0.06/video made the difference. Plus, our custom pipeline gave full control over encoding parameters.
Q: How did you ensure the Vietnamese team collaborated effectively with the US-based CTO?
A: We used daily asynchronous standups via Slack with recorded video demos, plus a 30-minute overlap window (8-9 AM HCMC / 6-7 PM PST). The ECOA platform also provided real-time dashboards so the CTO could see every pipeline execution without bugging the engineers.
Q: What’s the hardest part about scaling video transcoding beyond 50,000 daily uploads?
A: Storage costs. At scale, storing both original and transcoded versions gets expensive. We’re now implementing a lazy-delete policy — original files are automatically moved to Glacier after 7 days. The orchestrator triggers a Lambda to restore the original only if a user requests a new resolution. That’s next quarter’s optimization.
Related reading: Why Smart CTOs Hire Vietnamese Developers in 2025: Cost, Quality & Speed
Related reading: Vietnam Outsourcing: Why Your Next Offshore Development Team Should Be in Hanoi or Ho Chi Minh City