ZEZO
Let's Talk
Engineering

Transcoding Vertical Videos With Inhouse Developed Transcoder

Pukhraj Dhamu
Pukhraj Dhamu
Software Engineer
2 min read
Share
Transcoding Vertical Videos With Inhouse Developed Transcoder

Pukhraj Dhamu Last Update · Oct 20, 2025

Background

Short content in vertical (9:16 aspect ratio) format is gaining popularity steadily over time. One can find huge number of people enjoying these content on various social media platforms. These videos are typically of short duration (less than 2 minutes), thus user can get a sense of completion over very short time. These videos being of aspect ratio 9:16 (Vertical) fits very well with natural aspect ratio of phone devices. As the screen size grows, importance of good quality for reels content is becoming more important.

🧭 Introduction

In today’s mobile-first world, vertical videos (9:16) dominate short-form and live-streaming platforms. We set out to build our own in-house video transcoder to efficiently process, compress, and stream vertical videos without relying on expensive third-party services.

Our goal was simple:

“Create a self-hosted, scalable, and efficient transcoding pipeline optimized for vertical content.”


🧠 Why Build Our Own Transcoder?

  • Cost Control: Avoid high usage fees from cloud video APIs.
  • Customization: Fine-tuned quality control for vertical video formats.
  • Integration: Seamlessly fit into our internal upload → process → playback system.
  • Ownership: Full control over encoding logic and metadata management.

⚙️ Core Features

  • Automatic orientation detection (portrait/vertical).
  • FFmpeg-based transcoding into multiple bitrates:
    • 1080x1920 (Full HD)
    • 720x1280 (HD)
    • 540x960 (Medium)
    • 360x640 (Low)
  • HLS (HTTP Live Streaming) output with .m3u8 manifests.
  • Audio normalization (AAC codec).
  • S3-compatible storage upload (DigitalOcean, Cloudflare R2, etc.).
  • Queue-based job handling for scalable background processing.

Step-by-Step Workflow

  1. Upload Service
    • User uploads a video via the API.
    • The system detects orientation and saves metadata in MongoDB.
  2. Job Queue (e.g., BullMQ / RabbitMQ)
    • The uploaded video’s ID is added to the transcoding queue.
    • Background worker picks up jobs asynchronously.
  3. Transcoder Worker
    • Downloads the source file.
    • Uses FFmpeg to transcode into multiple resolutions and bitrates.
    • Generates HLS manifests (.m3u8) and segments.
  4. Storage Layer
    • Uploads output chunks and manifests to S3-compatible storage.
    • Updates video metadata with stream URLs.
  5. Playback API
    • Provides secure URLs for HLS playback.
    • Integrates easily with React or React Native players.