Video Platform

loom.dreamhoster.com

Video recording and sharing platform with async background job processing and custom payment gateway integration for reliable media processing.

HexaTech SolutionDec 2023 – Apr 2024

+45%

Improvement

Transaction Success

20%

Reduction

API Latency

99.8%

Production

Uptime

The Challenge

The platform needed to handle large video uploads and process them asynchronously without blocking user-facing operations. A custom payment gateway was required for subscription and usage-based billing with significantly improved transaction success rates. API latency needed optimization for fast video metadata retrieval and smooth playback initiation.

Architecture & Solution

Built a video processing pipeline using Laravel with database-driven background job queues for async encoding and transcoding. Implemented a custom payment gateway integration handling subscription billing, usage tracking, and automatic retry logic. Optimized database queries through strategic indexing to reduce video metadata retrieval latency by 20%.

Key Features

Video Encoding Pipeline

Background job queue for transcoding videos into multiple formats and resolutions for adaptive streaming across devices.

Payment Gateway

Custom gateway handling subscription billing, per-usage tracking, automatic retries, and comprehensive revenue reporting.

Async Processing

Database-driven queue system reliably processing video jobs without blocking user operations.

Media Storage

Videos stored and served directly from cPanel shared hosting storage, with compression to keep delivery efficient.

Technical Deep Dive

VideoProcessingJob.phpphp
<?php

namespace App\Jobs;

use App\Models\Video;
use App\Services\FFmpegService;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Storage;

class ProcessVideoJob implements ShouldQueue
{
    use Queueable, SerializesModels;

    public int $tries = 3;
    public int $timeout = 600; // 10 min max

    public function handle(FFmpegService $ffmpeg): void
    {
        // Transcode to multiple resolutions
        $outputs = $ffmpeg->transcode($this->video->raw_path, [
            '1080p' => ['bitrate' => '5000k'],
            '720p'  => ['bitrate' => '2500k'],
            '480p'  => ['bitrate' => '1000k'],
        ]);

        // Move finished renditions into local public storage
        foreach ($outputs as $quality => $path) {
            Storage::disk('public')->put(
                "videos/{$this->video->id}/{$quality}.mp4",
                file_get_contents($path)
            );
        }

        $this->video->markAsReady();
    }
}

Results & Impact

Successfully deployed video platform with robust async processing infrastructure. Transaction success rates improved by 45% through custom payment gateway optimization and retry logic. API performance improved by 20%, enabling faster video metadata retrieval and seamless streaming initiation. Platform maintains 99.8% uptime across all services.

Measurable Outcomes

Database-driven queue system processing video encoding jobs asynchronously without blocking user-facing operations

Custom payment gateway achieving 45% improvement in transaction success rates

20% API latency reduction through query optimization and database indexing

Async video encoding pipeline supporting multiple output formats and resolutions

Video files stored and served directly from the hosting server, tuned for shared-hosting constraints

Technology Stack

Laravel Framework
PHP 8.x
MySQL
Database Queues
cPanel Shared Hosting
FFmpeg
Custom Payment API

Project Info

Employer

HexaTech Solution

Timeline

Dec 2023 – Apr 2024

Category

Video Platform

Tech Stack

Laravel FrameworkPHP 8.xMySQLDatabase QueuescPanel Shared HostingFFmpegCustom Payment API

Working on something similar?

Let's discuss your project requirements and how I can help architect a solution.

Get In TouchAll Projects
MA

Muhammad Arslan

Loading precision…

System initializing4%
Engineering the future