Distributed Transcoding

Posted on 2012-02-29 Greg

A while back, we had a customer that wanted to transcode video files into several different formats as quickly as possible. In this particular case, he had access to as much computing power as one could imagine. Even with his large array of high-end servers, the customer was expecting more speed. Initially, our support staff found they weren't taking full advantage of our encoders' multi-threading capabilities. Therefore our first suggestion was to make use of all the available CPU cores. While this significantly improved their transcoding time, it still didn't achieve their goals.

Although we maximized the processing power on a single server, there were plenty of other servers in their farm just waiting to be used. Using multiple servers to each convert a single file would be acceptable for large batches of small files, but it would provide no benefit for large videos. Since LEADTOOLS has the ability to split and merge files, our next idea for improvement was to split the file into multiple pieces, transcode each piece on a different server, then merge the pieces back together. Splitting and merging (or demultiplexing and remultiplexing) are much faster operations than transcoding, so they would have minimal impact on the overall conversion time. We threw together a quick POC, and in a matter of hours we were using an entire farm of machines to transcode a single file. We were able to cut down the conversion time of a 1.22 GB video from ~23 minutes on a single server to ~9 minutes on the farm of servers. That was a speed increase of 61%!

The performance was great, but there was one problem. In some cases, there were slight glitches between each section that was merged together. The audio and video would jump or hiccup if the timestamps didn't line up perfectly, so we needed a way to intelligently choose and synchronize the split points. Our multimedia engineering team went to work and returned with two new DirectShow filters that discovered the perfect split/merge points, resulting in a smooth playback indistinguishable from the video transcoded on a single server.

These filters have not yet been released but I have played with them quite a bit. Not only are the results amazing, but there is still potential to make this an even more efficient process. If you read my last blog about our Cloud SDK, you can probably see where I am going with this. By integrating this new functionality with our Cloud SDK, you can create powerful applications that identify which servers in your farm are available, and use these machines to process a single task as fast as possible.

Thanks,
Otis Goodwin
LEADTOOLS Blog

LEADTOOLS Powered by Apryse,the Market Leading PDF SDK,All Rights Reserved