Skip to main content

Encoding

This article discusses the encoding phase of an encoding job. You can find an overview of the entire encoding process in the Job Processing article.

Supported Input

The Encoding Service supports a variety of video, audio, and subtitles formats. The table below lists the formats known to be supported. There are likely many more formats which are also processed well. Let Axinom know if you have any issues with a specific format.

CategoryWhat's supported
Video codecsAVCHD, DNxHD, DVCPRO, DVCPROHD, H.264/AVC, H.265/HEVC, MPEG-1 Video, MPEG-2 Video, MPEG-4 Video, ProRes, Theora, VP6, VP8, VP9
Audio codecsAAC, AC3, AIFF, FLAC, MP2, MP3, Ogg Vorbis, WAV, WMA
SubtitlesWebVTT, TTML, SubRip (=SRT), PAC, itt
Containers3GP, AVI, DIVX, FLV, GXF, M4V, MKV, MOV, MP4, MPEG-2 PS, MPEG-2 TS, MPG, MTS, MXF, QuickTime, RM, SWF, VOB, Webm, WMV

Video

You can modify the encoding settings in the Content Processing section of the encoding job request.

It is also possible to skip encoding using the packaging-only mode if the video is already provided in the desired format.

Codecs

VideoFormat specifies the codec. Supported values are:

  • H264 - H.264 (AVC = Advanced Video Coding) (default, used if omitted)
  • H265 - H.265 (HEVC = High Efficiency Video Coding). It is supported by Safari, but please note that whole streams or some representations (1080p or better) might not be available with H.265 on some older Macs (for example, MacBook Pros made in 2014).
  • DoNotEncode - don’t encode the video at all, see packaging-only mode.

Supported Aspect Ratios

We support all aspect ratios:

  • When we create the default bitrate ladder, the video rungs are generated automatically with the source video's aspect ratio.
  • When you specify your own video representations (VideoRepresentations in ContentProcessing), and if you define only one side of a representation, the other side is calculated automatically based on the source video's aspect ratio.
    • If you define both sides, we will generate it like that, but it might distort the aspect ratio so it's recommended to leave it on automatic.

You can also force the aspect ratio to be one of the most common ones by setting "ForceAspectRatioToStandard": true in the job request. This forces the aspect ratio to be one of the following (closest-to): 16:9, 4:3, 1.896:1, 3:2, 2.11:1, 2.35:1, 2.66:1, but might slightly distort the video.

Audio

Whereas creating the video representations is quite straightforward - we find the source video track that has the best bitrate and encode it to the necessary dimensions and bitrates -, creating the audio representations has a few more things to it. Mainly, we have multiple source audio tracks, some of which might be embedded in the video and some of which might be in separate audio files. Perhaps the audio files have even been provided by different studios. This all makes it possible that the source audio tracks can have slightly different audio levels, bitrates or audio channel counts.

The main thing to keep in mind is that we do not upmix audio channels. This means that if you want to have a 5.1 representation of a language, the source files must include a 5.1 audio track for it. Read more about this below.

Codecs

The audio codec is chosen automatically and will be:

  1. AAC for mono and stereo sound.
  2. AC3 for 5.1 sound.

Audio Representations

Let’s look at an example AudioRepresentations array:

{
"ContentProcessing" : {
...
"AudioRepresentations": [
{
"BitrateInKbps": 128,
"Sound": "Mono",
"AudioFormat": "AAC",
"Create": "OnMatchingSound"
},
{
"BitrateInKbps": 256,
"Sound": "Stereo",
"AudioFormat": "AAC",
"Create": "Always"
},
{
"BitrateInKbps": 384,
"Sound": "5.1",
"AudioFormat": "AC3",
"Create": "Always"
}
]
...
}
}

Let’s look at what this particular configuration does (you can of course use your own configuration):

  1. Mono sound has "Create": "OnMatchingSound" which means that mono representations will be created only from mono audio tracks in the source files. All source audio tracks that have more (or fewer) than 1 audio channel will be ignored for these representations. Since mono source audio is not that common, mono representations are usually not created.
  2. Stereo sound has "Create": "Always" which means that stereo representations will be created from source audio tracks that have at least stereo audio. All source audio tracks that have fewer than 2 channels will be ignored for these representations. If there are both stereo and 5.1 tracks provided, we automatically pick the track with the closest-matching audio channel count for a given representation so that there is as little downmixing done as possible.
  3. 5.1 sound also has "Create": "Always" which means that 5.1 representations will similarly be created from source audio tracks that have at least 5.1 audio (e.g. also 7.1). All source audio tracks that have fewer than 6 channels will be ignored for these representations.
  4. You can specify the audio codec by setting AudioFormat to either AAC or AC3 in any of the audio representations. Setting AudioFormat is optional and if it’s omitted AAC is used by default.