Blog  Engineering  

Amobee Towards Automation: Transcoding Video

by Amobee, April 04, 2017

At Amobee, automation is part of our culture. We will try to automate anything and everything possible to increase efficiency. In this blog post, we are going to talk about an engineering automation project we did to scale digital video advertising called the “Turn Video Transcoder.”

The Turn Video Transcoder has been powering the video campaigns on Amobee platform since 2015. It’s able to solve problems with Amobee-served video ad content better than any third-party transcoding service available on the market.

What’s the challenge?

Digital video advertising spend exploded exponentially in recent years. Ad spending on original digital video programming increased 114% since 2014. Programmatic Video buying is seeing broad adoption and steady growth – accounting for 41% of all digital video dollars spent, representing 58% growth from over the last 2 years.

The increase in demand for video ads plus the variety of video formats, sizes, quality etc., needed for each publisher presents a great challenge for ad tech. For example, Google Adx requires all video ads to be flv, mp4 and webm formats as well as meet size constraints of 10MB per minute and a maximum frame rate of 30fps. Fulfilling these requirements can be a hassle for advertisers.

What is video transcoding and why do we need it?

Video transcoding is the process of converting video from one encoding to another, specifically  to support a target player that doesn’t support the original encoding. The Amobee platform is integrated through the exchanges with thousands of publishers and serves around 80,000 video ad opportunities per second, which means we have to support whichever kind of player a publisher has. Advertisers provide content in a specific format or encoding that won’t be supported by all publishers. So, Amobee converts the original video into all available encoding needed by the publishers.

In the early days of video ad serving, many ad tech companies converted videos manually using a standalone desktop or web client: a manual process that increased the turnaround time to run the campaign. We wanted to automate this process from a 24 hour turnaround time to almost real-time conversion.

The solution

We built the Turn Transcoder, a homegrown video transcoding service, and integrated it with our campaign setup workflow to transcode video from one encoding to different encoding in almost real time.

The Turn Video Transcoder comprises the following components:

  1. Video requirement verification
  2. Video decoder/encoder
  3. Transcode job management

When users upload raw input video files, we first verify if they fit publishers’ requirements. The transcoder will identify the unfulfilled requirements such as missing video format/mimetype, incorrect dimension/resolution and oversized video file. From there, a customized transcoding job is created for each ad to fulfill requirements with the minimum amount of transcoding processing. This step doesn’t just improve efficiency and save money; it also preserves the highest output video quality. Most modern video encoding technologies are not lossless, so every time we decode and encode a video, video quality decreases.

After the transcoding job is created, it will be pushed into a job queue until a transcoding work thread is available to pick up the job. Once the transcoding work thread takes it over, it will call the video decoder to decode the input video and encode into different output videos of various formats and sizes. The most difficult part of the process is specifying how to encode the output video. The general requirement is to encode the video in the highest quality possible while staying under the file size limit. The video encoder library we used for encoding provides the feature to set maximum file size, but it didn’t work the way we wanted it to. It either output unwatchable low-quality video under the size limit or cut the video short depending on if you specified the bit rate or not. (Bit rate determines video quality and the file size.) To solve this issue, we needed our own formula to pre-calculate the parameters we hand over to the video encoder so we get high quality output video that fulfills all requirements.

According to the “Kush gauge” for optimal bit rate, bit rate (bps) = resolution x frame rate x motion factor x 0.07. Resolution is the width times height in pixels. Frame rate is how many frames in a second. The frame rate for most online video, TV and movies is 24. Motion factor is a constant value from 1 to 4 based on the motion/movement in the video. Applying a low motion factor can result in video having motion blur. When implementing our transcoder, the resolution is already determined by publisher requirements. The frame rate is set to 24 to ensure smooth video content. Since we cannot automatically detect how much motion is in the video, we use a 1.51 as our default value. We came up with this value after decoding hundreds of videos of different types and resolutions. We use this value to calculate that suggested bit rate = resolution x 24 x 1.51 x 0.07. And we also calculated that maximum bit rate = file size limit / video duration (sec). The lower of these two values will be used as the bit rate for encoding output videos.

After the transcoder encoded the output videos, it will inspect the resolution, frame rate, mimetype, size, bit rate, duration to see if they fulfill the requirements or not. Once this part is done, the Amobee platform and user will be notified that this ad is ready for delivery.

Below is a screenshot of our video preview tool, where users can preview all the different formats of transcoded video before trafficking it.

Conclusion

The Turn Video Transcoder is able to handle more input video formats than third-party solutions such as AWS Elastic Transcoder and Zencoder. It can handle rare codec such as Prores and hidden content padding in video.

The Turn Video Transcoder is five times faster than the AWS Elastic Transcoder, even if we exclude the time needed to upload/download video files to/from AWS S3 storage. In most cases, a 60-second video ad will be analyzed, decoded and encoded into six video files of various mimetypes and resolutions within 120 seconds.

These two significant benefits make Turn Video Transcoder a superior option for the Amobee platform.

 

About Amobee

Founded in 2005, Amobee is an advertising platform that understands how people consume content. Our goal is to optimize outcomes for advertisers and media companies, while providing a better consumer experience. Through our platform, we help customers further their audience development, optimize their cross channel performance across all TV, connected TV, and digital media, and drive new customer growth through detailed analytics and reporting. Amobee is a wholly owned subsidiary of Tremor International, a collection of brands built to unite creativity, data and technology across the open internet.

If you’re curious to learn more, watch the on-demand demo or take a deep dive into our Research & Insights section where you can find recent webinars on-demand, media plan insights & activation templates, and more data-driven content. If you’re ready to take the next step into a sustainable, consumer-first advertising future, contact us today.

Read Next

All Blog Posts
Perspectives

Video – 3 Trends That Are Defining 2016

Turn EMEA leader Richard Robinson shares his thoughts on the major trends in the digital advertising industry today: creative and programmatic finally coming together, marketing tech integrating with…

March 21, 2016

Platform

Amobee expands video solutions with Twitter pre-roll video

Amobee is among an elite group of partners with access to pre-roll on Twitter, now supporting VAST tags. The improvements to the former Amplify program combine the benefits of Twitter’s targeting with…

June 4, 2016

Perspectives

Making Video More Effective for Marketers

Watch Turn research scientists Sergey Faleev and Jianqiang Shen and director of product management Ethan Lubka explain how Turn algorithms work to balance marketers’ objectives, including viewability and engagement rates and campaign performance goals.

June 27, 2016