Live streaming on AWS looks like black magic from the outside. You open OBS, click “Start Streaming,” and thousands of people watch from different devices and under different network conditions.
Then we had to build one. We designed the architecture of a gaming and tournament streaming platform, and we started with almost no knowledge of how media works. The product did not succeed commercially, but we learned a lot from it.
The biggest lesson was surprisingly simple: streaming is not black magic. It is yet another distributed system, with video flowing through it instead of JSON. This article shows how our live streaming architecture evolved from a managed AWS service to a homemade streaming core.

Why Managed Live Streaming on AWS Became Too Expensive
At first, building a streaming core from scratch seemed like overkill. AWS already offered Interactive Video Service (IVS), a Twitch-grade streaming core with a pay-as-you-go model. So we let IVS handle the streaming while the team built everything else.
For a proof of concept, it was amazing. However, cost became the problem. Even during the pilot, the economics were uncomfortable. Once we projected those costs to our target scale, this architecture looked difficult to justify.

That is when a slightly insane idea appeared: what if we built the streaming core ourselves?
The First Homemade Version Ran Entirely on ECS
The first custom version was a proof of concept, with no autoscaling and no sophisticated scheduler. Still, we made one decision early and never regretted it: everything ran on ECS. Ingest, transcoding and edge were all containers. NGINX RTMP handled ingestion, G4dn GPU nodes handled transcoding, and edge servers served the HLS files that the transcoders wrote to shared network storage (EFS).
It worked, and that mattered: we could take a stream from OBS to a browser using infrastructure we controlled. In addition, because everything already ran on ECS, every later change was mostly a matter of node types, task definitions and scaling policies. We never had to rebuild the platform.
RTMP and HLS: How a Live Stream Reaches Viewers
Broadcasters connected using RTMPS. RTMP is still extremely convenient for ingest because virtually every streaming tool understands it, including OBS and hardware encoders. Browsers, however, do not really want RTMP. For viewers, we used HLS.
| RTMP | HLS | |
| Job | Ingest: broadcaster to platform | Delivery: platform to viewer |
| Shape | A continuous connection per stream | Plain HTTP files: playlists and short segments |
| Scales like | Stateful connections you have to place | Cacheable web content |
Apple built HLS because the iPhone needed live video and refused to run Flash. Their answer was simple: break the video into small files and deliver them over plain HTTP. As a result, once your video becomes HTTP objects, you can use object storage, HTTP caching, CDNs and standard monitoring. That is where streaming starts becoming much easier to understand.
Securing Live Streaming on AWS at the Ingest Node
The ingest layer was NGINX with the RTMP module, running as an ECS task behind a Network Load Balancer. It did not transcode anything. Its whole job was to answer one question for every incoming connection: is this stream allowed in, and who does it belong to?
A separate Node.js microservice, the streaming backend, provided the answer. We kept it apart from the main backend because streaming had enough logic to deserve its own boundary. MongoDB stored the channel information, and Redis tracked who is live right now.
When OBS starts publishing, NGINX calls the on_publish hook before it accepts a single frame. The backend looks the stream key up. If the key is invalid, it rejects the stream instantly. If the key is valid, it redirects the stream to an internal authenticated application under its public name, which masks the stream key from viewers.

This design has three advantages:
- The stream key never leaves the ingest node, so everything downstream only sees the public channel name.
- There is no way around authentication, and the design fails closed: any error in the hook rejects the stream.
- Live state cleans itself up. Redis stores live channels with a short expiry, and NGINX sends a heartbeat to renew it. If a node crashes, the channel quietly drops off the live list.
One rule mattered most: Node.js never carried the video. It only controlled it. Putting your application backend in the video path would create a very expensive bottleneck.
Transcoding With FFmpeg, GPUs and VT1 Instances
FFmpeg and the adaptive bitrate ladder
On the transcoding nodes, NGINX lifecycle hooks started one FFmpeg process per stream, and that process lived exactly as long as the stream. In effect, NGINX worked as an event-driven runtime around FFmpeg, so we needed no proprietary streaming engine. For every incoming stream, FFmpeg generated an adaptive bitrate ladder. A 1080p source produced 1080p, 720p, 480p, 360p and 160p renditions. If the input was only 720p, we started at 720p, because there was no point inventing fake 1080p pixels. If a viewer’s network deteriorated, the player dropped to a lower rendition without killing the stream.
Why transcoding became the expensive part
At this point, the architecture taught us another lesson: viewer scale and broadcaster scale are not the same problem. If one broadcaster has 100,000 viewers, the CDN has a problem. If 10,000 broadcasters start streaming at once, the transcoding infrastructure has a problem.
Transcoding in softwareTranscoding in software on CPUs would have required a big fleet of large instances for very few streams. So we started with GPUs: G4dn nodes have NVIDIA T4 cards, and FFmpeg runs the entire pipeline on them.
Then we found VT1 instances, which were very new to AWS at the time. AWS built them specifically for video transcoding, using Xilinx Alveo U30 media accelerator cards. For our workload, they were dramatically more interesting economically than GPU instances. For example, a vt1.3xlarge could handle roughly eight simultaneous 1080p60 transcodes with our configuration. Moving to VT1 was not a migration, because everything already ran on ECS. We only added a new node type and task definition.

This changed how we thought about scaling. Instead of saying “We need N transcoding servers,” we could think in capacity units.
Scaling Live Streaming on AWS Down to Zero
The G4dn version had a fixed node count. With VT1, scaling got real, because we wanted the platform to stay cheap while idle. The ingest layer had to stay up to receive the initial RTMP connection. The transcoding capacity, however, did not need to exist when nobody was live.
We did not build a custom scheduler. We used standard AWS building blocks, with CloudWatch in the middle:
- We published the number of live streams as a custom CloudWatch metric.
- CloudWatch alarms watched it, with thresholds at 0, 8, 16 streams and so on.
- An alarm triggered a scaling policy on the ECS transcode service.
- The ECS capacity provider saw tasks it could not place and grew the Auto Scaling group of VT1 instances.
- The new node joined the cluster, and the transcode task landed on it.

Scale-in ran the same loop backwards: zero live streams, a cooldown, and the VT1 nodes went away.
The cold start is a trade-off, not a bug
Scaling from zero has an obvious cost. When the first broadcaster goes live, one VT1 node has to boot, which takes a few minutes. At our scale, that was a deliberate choice: we had few concurrent broadcasters and long idle periods. Besides, the broadcaster stayed connected, and the relay kept retrying until capacity appeared. A cold start meant a delay, not a failure.
Once traffic justifies it, the fixes are cheap. Tournaments follow a calendar, so scheduled scaling can pre-warm a node. An EC2 Auto Scaling warm pool keeps instances ready, so you pay for the disk, not the instance. A capacity provider target below 100% keeps one slot spare, and one node running during peak hours still leaves room to scale to zero overnight.
Moving From EFS to S3 and CloudFront
Why the shared filesystem broke down
EFS made perfect sense during the proof of concept. However, live HLS is an unpleasant workload for a network filesystem. The transcoder constantly creates segments, rewrites playlists and deletes old segments, while readers and writers work at the same time and latency matters. We hit the usual problems: latency, I/O behavior and scaling concerns.
Eventually, we had the obvious realization: why build our own primitive CDN when AWS already has S3 and CloudFront? The transcoder only needed to produce media. S3 became the durable object layer, and CloudFront handled distribution. The edge servers simply stopped existing.

Ten thousand viewers on one stream became a CDN problem, not an origin-server problem. That is a much nicer problem to have.
Why S3 is not a filesystem
At first, we mounted S3 with s3fs, so FFmpeg could write into a folder as if it used a normal filesystem. That simplicity was deceptive. We had much less control over when objects became visible, and with live HLS you must not publish a playlist that references a segment before the segment exists in S3.
So we moved to something more explicit. FFmpeg produced segments on local ephemeral storage, and an asynchronous process uploaded completed segments with direct S3 PutObject operations. As a result, we gained proper retry handling and explicit control over publication order. Finally, we cached segments normally, since they never change, and gave playlists a very short caching window of roughly half a segment, because they change constantly.
The Final Architecture for Live Streaming on AWS
By the later stages, the system had a control plane on top, CloudWatch driving the VT1 fleet and a media path from OBS to viewers.

The table below shows how each concern changed along the way.
| IVS (first version) | Homemade proof of concept | Final architecture | |
| Ingest | Managed by AWS | NGINX RTMP task on ECS | NGINX RTMP on ECS, auth via on_publish, restreaming |
| Transcoding | Managed by AWS | FFmpeg on G4dn GPU nodes | FFmpeg on VT1 nodes, Xilinx acceleration |
| Scaling | Managed by AWS | Fixed node count | CloudWatch alarms, scale to zero |
| Storage | Managed by AWS | EFS shared filesystem | Local ephemeral disk, then S3 |
| Distribution | Managed by AWS | Edge server tasks on ECS | CloudFront in front of S3 |
Live Streaming on AWS Is Mostly Familiar Infrastructure
Our biggest misconception was assuming the field was much harder than it is. Media engineering has hard problems, from codecs to low-latency streaming, but the basic architecture is not one of them. A live streaming platform does seven things: it receives a stream, authenticates it, transforms it, splits it into distributable media objects, stores them somewhere scalable, distributes them close to users and tracks the state around all of it. Only a thin slice of the system was actually about video. Everything else was infrastructure we already knew.
Our pipeline eventually became: RTMP in. Validate it. Transcode it. Package it. Put it in S3. Let CloudFront do what CloudFront is good at. And suddenly the black magic was just architecture.
Key Takeaways From Building Live Streaming on AWS
- Put everything on one orchestrator early. On ECS, every later change was a node type or a task definition, not a rewrite.
- Keep the control plane out of the media plane. The backend decides who gets in, but it never carries the video.
- Treat the stream key like a password, and let CloudWatch scale transcoding on the number of live streams.
- Accept the cold start while you are small, then pre-warm or keep headroom as you grow.
- Do not pretend S3 is a filesystem, and cache segments and playlists differently.
Talk to Our Cloud Team About Your Streaming Workload
If you are designing a streaming or media workload on AWS, contact our Cloud and Infrastructure team to discuss your architecture.








