PHP Microservices — Video Processing With RabbitMQ

Devin Dixon
Helium MVC
5 min readJan 2, 2019

--

This entry is part of a series of creating microservices with various PHP implementations. In the previous tuorial we discussed building a simple mail microservice with sockets.This part will focus on video processing as a microservice.

Media processing is time-consuming and expensive on your hardware. Media includes video, audio, and images. If done on a monolithic architecture, especially on web servers, processing these files can be crippling to your end users experience.

For example, a single video file can take up to 15%-20% of your CPU. A few video files being processes simultaneously and users may no longer be able to load your website. Therefore, we are going to show you the basics of creating a microservice to perform video processing.

RabbitMQ + ProdigyView + FFMPEG

In this tutorial, we are going to cover RabbitMQ, a messaging and queueing service. php-amqplib is a PHP Library that uses AMQP 0–9–1 protocol for connecting with RabbitMQ. A queueing service is important for video processing because:

  1. A server has limited capacity on how many videos it can process at a time
  2. Large videos can take hours to process, and other videos must wait their turn until enough resources are available on the server

--

--