Wednesday, August 13, 2014

Distributed encoding using Gearman,PHP,HandBrakeCLI tests


The Gearman Client on Storage Server
The Gearman Worker on MacMini

We wrote a simple script that will download the master video from storage server and encode locally, after that push them all back to storage.

We have 4 unused Mac Mini i5 with 4 CPU Cores each.

Gearman Job Server will be on Storage Server and will listening to Job query and Job load.

Our plan is :

1) User upload raw video file to /incoming folder
2) InCron detects and invoke PHP script
3) PHP script send the job to Gearman Job Server
4) Gearman Job Server caling out the workers ( 4 mac minis )
5) Worker download the master file and encode to 3 different bitrates
6) Each Worker have SupervisorD daemon on each machine and set max to 1 worker per machine
7) when completed, Storage server will receive on /encoded folder and trigger Amazon S3 command to sync with our AWS S3 folder
8) Our Wowza Server in EC2 will packetized to VOD into multi format ( HLS,HDS,MPEG-DASH)
9) Serve the video using Amazon Cloudfront

At the end, we can increase the encoding capabilities by adding more Mac Minis.

to tests :
- Gearman Round Robin
- Mac OSX long running PHP scripts ( no Upstart / SupervisorD )

1 comment:

  1. Great Post, Actually PHP is a beautiful source for developing a database driven web application, I love this post, thanks for spending your time for discussing about this topic.
    Regards,
    PHP Training in Chennai|PHP Course in Chennai

    ReplyDelete