Skip to content

MahmoudSheemy127/VideoTranscoderSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🎬 Cloud-Native Video Transcoder

A robust, asynchronous video transcoding pipeline built on AWS, leveraging Java Quarkus, FFmpeg, and a Multi-Tier Architecture. This system converts media files (e.g., .mp4 to .gif) with high availability, automated scaling, and secure private networking.


1. Introduction

This repository contains the full source code and infrastructure definitions for a production-grade video transcoding engine. Unlike simple converters, this system is designed for scale:

  • Decoupled Processing: Uses SQS to buffer tasks, ensuring no video is ever lost even during traffic spikes.
  • Auto-Scaling: Compute power grows and shrinks dynamically based on the number of messages in the queue.
  • Secure Networking: All processing happens in private subnets. Communication with AWS services is handled via VPC Gateway and Interface Endpoints.

Repository Contents

  • IAC.yml: CloudFormation yml template for VPC, ASG, Load Balancer, and Data tiers.
  • /transcoder: Java Quarkus application code responsible for SQS polling, S3 upload & download, DynamoDB state management, and FFmpeg execution.
  • bake_ami.sh: Bash script for automated AMI baking and environment preparation.

2. Architecture Overview

Architecture Diagram

The system follows a Multi-Tiered Immutable Architecture:

  1. Ingress Tier: An Application Load Balancer (ALB) handles client requests for Presigned URLs and job status checks.
  2. Logic Tier: Worker nodes (EC2) inside an Auto Scaling Group (ASG) poll SQS for tasks, process videos locally using FFmpeg, and update task states.
  3. Data Tier: S3 buckets store raw ("Pre-process") and converted ("Post-process") media. DynamoDB tracks the lifecycle and metadata of every job.
  4. Integration Layer: All communication to SQS, S3, DynamoDB, and CloudWatch Logs stays within the AWS backbone using VPC Gateway and Interface Endpoints, enhancing security and reducing latency.

3. Demo

Demo


4. Project Setup

Follow these steps to deploy the transcoder system into your AWS environment.

Step 1: Bake the AMI

Automate the environment setup using the provided baking script:

1- Launch a base Amazon Linux 2023 instance.

2- Build the java application as shown in here. Upload your quarkus-run.jar and bake_ami.sh script to the instance through SSH.

3- Run the script:

chmod +x ./bake_ami.sh
sudo ./bake_ami.sh

4- Once completed, stop the instance and create an AMI from it (Actions > Image and templates > Create image).

Step 2: Link & Launch Infrastructure

1- Retrieve your new AMI ID.

2- Update the BakedAmiId parameter in the CloudFormation IAC.yml template.

3- Deploy the template from your own AWS environment. The ASG will automatically launch nodes using your baked AMI.

About

cloud-native backend solution hosted on AWS, designed to perform asynchronous media conversion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors