Rendering using FFMPEG

What is FFmpeg?

According to the FFmpeg homepage:

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.

Installation

Because of licensing concerns, FFmpeg must be installed separately on the machine where the Accurate Video job runner deployed.

For Ubuntu Linux FFmpeg can be installed by issuing the command below on the command line:

$ sudo apt install ffmpeg

And for the Accurate Video job runner docker image, ffmpeg can be installed like this:

docker exec -it ap-runner bash -c 'apt update && apt-get install -y software-properties-common && apt update && apt-get install -y ffmpeg'

Each system has it's own method to install FFmpeg and more information about your system can be found in the FFmpeg download page

It is important that the FFmpeg executable is in the PATH environment variable so that it can be found by the jobs system.

Profiles

Profiles are json files that describe how the final product of the render/transcode should look like on a technical level. They include parameters such as video codec used, number of audio channels and so on.

The following is an example of a profile file:

{
"width":"1280",
"height":"720",
"format":"mp4",
"videoCodec":"libx264",
"audioCodec":"aac",
"videoBitrate":"5M",
"audioBitrate":"192k",
}

A small set of profiles files are included with the runner, additional profile files may be included by configuration the runner configuration variable av.runner.ffmpeg_profile_location.

Example:

av.runner.ffmpeg_profile_location = "/path/to/my/profiles"

For the frontend applications to be able to refer to which profile to use when, for example doing an export with the Promo creator, they should send the name of the profile to the backend. The following screenshot shows the dialog to do an export from the Promo creator.

select_profile.png

When the user clicks on the EXPORT button an api request is made to:

POST /render
{
templateId: "mp4_h264_720_aac_5Mbps",
...
}

Notice the templateId: "mp4_h264_720_aac_5Mbps" parameter. That is the name of the profile file that exists on the backend and that profile should be used during the transcode. When the backend interprets this, it will check for the file mp4_h264_720_aac_5Mbps.json in the directory specified by av.runner.ffmpeg_profile_location on the runner.

Currently the profiles used must be added to the frontend settings file.

Using FFMPEG as the renderer

To use FFMPEG as the renderer for a render job, there are two ways:

  • Set FFMPEG as the default renderer by setting the configuration variable: av.runner.template.render=render/ffmpeg on the runner
  • Set the metadata field transcoder to ffmpeg on the render job
{
templateId: "mp4_h264_720_aac_5Mbps",
metadata: [
{
key: "transcoder",
value: "ffmpeg"
}
],
...
}
Connect S3 Storage Application settings