Video Settings

This topic contains details for encoding settings related to general settings for video outputs.

video_bit_depth

video_bit_depth:Number

API Versions: V2

Parent: outputs

Default: 10

Valid Values: 8, 10, or 12

Compatible Job Types: vod, live

Example: 5

Description:

The number of bits per color channel.

Normally you would not set this and instead would specify the video_codec_profile which would provide the bit depth.

{
  "input": "s3://zencodertesting/test.mov",
  "outputs": [
    {
      "video_bit_depth": 10
    }
  ]
}

video_reference_frames

video_reference_frames:String

API Versions: V2

Parent: outputs

Default: 3

Valid Values: 0-16, auto

Compatible Job Types: vod, live

Example: 5

Description:

Number of reference frames to use.

More reference frames result in slightly higher compression quality, but increased decoding complexity. In practice, going above 5 rarely has much benefit.

Determined partly by speed as well as video_codec_profile. Set to "auto" to allow our speed setting to naturally choose this number.

We default to 3 as a good compromise of compression and decoding complexity.

Use 1 for video created for legacy iPod or first-generation iPhone video, or for other technically-limited decoders.

{
  "input": "s3://zencodertesting/test.mov",
  "outputs": [
    {
      "video_reference_frames": 5
    }
  ]
}

video_codec_profile

video_codec_profile:String

API Versions: V2

Parent: outputs

Default: H.264: baseline, HEVC: main, VP9: 0

Valid Values: codec-dependent

Compatible Job Types: VOD

Example: high

Description:

Sets the encoding profile used by the video codec.

  • H.264 profiles: baseline, main, high, high10, high422, high444.
  • HEVC profiles: main, main10, main12, main422-10, main422-12, main444-8, main444-10, main444-12.
  • VP9 profiles: 0, 1, 2, 3.
  • AV1 profiles: main, high and professional. Default: main.

In general, lower levels are supported by a wider range of devices and may be simpler to decode. Higher levels offer more features such as additional bit depths and chroma subsampling choices. In some cases, higher levels also support increased compression efficiency.

{
  "input": "s3://zencodertesting/test.mov",
  "outputs": [
    {
      "video_codec_profile": "high"
    }
  ]
}

video_codec_level

video_codec_level:String

API Versions: V2

Parent: outputs

Default: Automatically calculated using a level chart based on the output video. See H.264 levels, HEVC levels.

Valid Values: A valid level: H.264 levels, HEVC levels.

Compatible Job Types: VOD

Example: 4.1

Description:

Constrains bitrate, macroblocks (H.264) or bitrate, coding tree units (HEVC)

Primarily used for device compatibility. For example, the iPhone supports H.264 Level 3, which means that a video’s decoder_bitrate_cap can’t exceed 10,000kbps. Typically, you should only change this setting if you’re targeting a specific device that requires it.

{
  "input": "s3://zencodertesting/test.mov",
  "outputs": [
    {
      "video_codec_level": "4.1"
    }
  ]
}

video_bframes

video_bframes:Integer

API Versions: V2

Parent: outputs

Default: 0

Valid Values: 0-16

Compatible Job Types: VOD

Example: 2

Description:

Maximum number of consecutive B-frames.

Using B-frames can increase quality at the same bitrate, but is more demanding on CPUs. This may be problematic on old computers or devices, but generally plays smoothly on modern hardware.

H.264 supports by b-frames with Main or High profile, not Baseline. The default is 0 for widest compatibility.

For HEVC, b-frames can be used on any level. The default is 3.

We recommend a value of 3 for compression/quality improvements. Values higher than 5 or 6 rarely provide much benefit, and greatly increase encoding time.

{
  "input": "s3://zencodertesting/test.mov",
  "outputs": [
    {
      "video_bframes": 2
    }
  ]
}

See Also: video_codec_profile

color_metadata

color_metadata:String

API Versions: V2

Parent: outputs

Default: preserve

Valid Values: preserve or discard

Compatible Job Types: VOD

Example: discard

Description:

This option is currently supported on H.264, HEVC and VP9 outputs. If the input video has matrix coefficients, transfer characteristics, and color primaries metadata, Zencoder will preserve those settings by default.

To ensure that this metadata is not embedded in outputs, set color_metadata to discard.

{
  "input": "s3://zencodertesting/test.mov",
  "outputs": [
    {
      "color_metadata": "discard"
    }
  ]
}