

# General information about color space
<a name="about-color-metadata"></a>

Following is some general information about color space.

**Topics**
+ [Definition](color-space-definitions.md)
+ [Supported color space standards](color-space-standards.md)
+ [Passing through the color space](color-space-options-passthrough.md)
+ [Converting the color space](color-space-options-convert.md)
+ [Input and output requirements](color-space-input-output-requirements.md)

# Definition
<a name="color-space-definitions"></a>

There are four components to color space:
+ The specific *color space* that applies to the video content. The color space specifies a range of pixel colors that can apply to the content.
+ The *color space metadata*, which identifies the color space being used. If this metadata is present, the content is said to be *marked* for a color space. 
+ The *brightness function* that applies to the color space. The brightness function controls the brightness of each pixel. The brightness is also known as gamma tables, electro-optical transfer function (EOTF), and transfer function. 
+ The *brightness metadata*, which identifies the brightness function being used.
+ The *display metadata * that applies to the color space. Not all standards have this metadata.

The video might use a specific *color space* and a specific *brightness function*. The video might also carry *color space metadata *that describes aspects of the color.

# Supported color space standards
<a name="color-space-standards"></a>

Each color space standard follows a specific standard for the color space, and specific standards for the three sets of color data. 

To read this table, find a color space in the first column, then read across to identify the standards for the color space and the three sets of color data.


|  MediaLive term for the color space   |  Complies with this color space standard   |  Complies with this brightness function standard   |  Complies with this standard for display metadata   | 
| --- | --- | --- | --- | 
|  Rec. 601 or Rec. 601   |  Rec. 601   |  BT.1886   |  Not applicable. This color space doesn't include display metadata.  | 
|  Rec. 709 or Rec. 709   |  Rec. 709   |  BT.1886   |  Not applicable. This color space doesn't include display metadata.  | 
|  HDR10   |  Rec. 2020  |  SMPTE ST 2084 (PQ)   |  SMPTE ST 2086   | 
|  HLG or HLG 2020   |  Rec. 2020  |  HLG rec. 2020   | Not applicable. This color space doesn't include display metadata. | 
|  Dolby Vision 8.1  |  Rec. 2020  |  SMPTE ST 2084 (PQ)  |  Proprietary Dolby Vision 8.1 metadata (RPU), on a per-frame basis, and SMPTE ST 2086 on a per-stream basis.  | 

# Passing through the color space
<a name="color-space-options-passthrough"></a>

You can set up to *pass through* the color space from the source to a MediaLive output. You can set up to include or remove the color space metadata. For passthrough to produce the desired quality in the video output, the color space metadata must be accurate. 

Here are the possible combinations for passthrough:
+ Pass through the color space, pass through the color space metadata without correcting it (because you know that it is accurate).
+ Pass through the color space, pass through the color space metadata after correcting it.
+ Pass through the color space, remove the color space metadata without correcting it. You might want to remove the color space metadata because the downstream system can't handle it properly. 

  When MediaLive removes the metadata, the source still has a color space but it doesn't have information that identifies the color space. Removing the metadata doesn't necessarily degrade the color. Removing it might only mean that the downstream player can't implement enhancements to make the color even richer.

**Default behavior**

The default behavior is to pass through the color space and pass through the uncorrected color space metadata.

# Converting the color space
<a name="color-space-options-convert"></a>

You can set up to *convert* the color space itself—to change the pixels in the video. MediaLive can perform specific color space conversions. 

MediaLive can convert only color spaces that it supports. See [Supported color space standards](color-space-standards.md). 

Here are the possible combinations for conversion:
+ Convert the color space, and include color space metadata. MediaLive will convert the color space metadata to accurately describe the new color space.
+ Convert the color space, but omit the color space metadata. You might want to remove the color space metadata because the downstream system can't handle it properly.

  When MediaLive removes the metadata, the source still has a color space but it doesn't have information that identifies the color space. Removing the metadata doesn't necessarily degrade the color. Removing it might only mean that the downstream player can't implement enhancements to make the color even richer.

**Warning**  
If the content provider can't tell you what color space applies to the input, you shouldn't try to convert the color space. Doing so might degrade the video quality. You should pass through the color space. You should also remove the color space metadata, so that the downstream system doesn't read information that might be inaccurate.

MediaLive converts from one color space to another based on the metadata in the source content. MediaLive doesn't examine the video to try to determine whether it actually matches the color space identified in the metadata. 

## Supported types of conversion
<a name="color-space-supported-conversions"></a>

The following table identifies the color spaces in the source that can be converted to a specific color space in a MediaLive output.


|  Any of these color spaces in the source  |  Can be converted to this color space in the output  | 
| --- | --- | 
|  Rec. 709, HLG, HDR10   |  Rec. 601  | 
|  Rec. 601, HLG, HDR10  |  Rec. 709  | 
| Rec. 601, Rec. 709, HLG | HDR10 | 
| Rec. 601, Rec. 709, HDR10 |  HLG  | 
|  HDR10 If MediaLive encounters a portion of non-HDR10 content, it passes through the color space and color space metadata for that portion,  | Dolby Vision 8.1 | 

# Input and output requirements
<a name="color-space-input-output-requirements"></a>

**Topics**
+ [Supported inputs](#color-space-supported-inputs)
+ [Supported output types](#color-space-supported-outputs)
+ [Supported output codecs](#color-space-supported-output-codecs)

## Supported inputs
<a name="color-space-supported-inputs"></a>

MediaLive can work with the supported color space in all [supported types of input](inputs-supported-formats.md) with the following notes:
+ Handling Elemental Link inputs: MediaLive can't read the color space metadata in a source from an AWS Elemental Link device. The workaround when you set up the input is to specify the color space that applies, as described in [Scenario B – Metadata can be corrected with force](color-space-scenario-correct.md).
+ Converting to Dolby Vision 8.1: 
  + The video source must be HD or 4K resolution. In other words, the source must be 1080p or better.
  + The video source must be HDR10. If MediaLive encounters a portion of non-HDR10 content, it passes through the color space and color space metadata for that portion,
  + The video source can't be a file. This means that the source can't be a VOD asset in an MP4 file or a VOD asset in a transport stream.

  These constraints are stipulated by Dolby Vision 8.1, and relate to the minimal video quality required to produce Dolby Vision 8.1 outputs that meet the Dolby Vision 8.1 standard.

## Supported output types
<a name="color-space-supported-outputs"></a>

All color space types except Dolby Vision 8.1 can be set up in all MediaLive output group types.

Dolby Vision 8.1 can be set up only in the following output group types:
+ Archive
+ CMAF Ingest
+ HLS
+ UDP

## Supported output codecs
<a name="color-space-supported-output-codecs"></a>

The following table specifies the supported codecs for the MediaLive output color spaces.


|  Output color space   | AV1 | AVC (H.264) | HEVC (H.265) | 
| --- | --- | --- | --- | 
|  Rec. 601  | Yes | Yes | Yes | 
|  Rec. 709  | Yes | Yes | Yes | 
|  HDR10   | Yes |  | Yes | 
|  HLG  | Yes |  | Yes | 
|  Dolby Vision 8.1  |  |  | Yes | 

**Supported video profile for HDR10 or Dolby Vision 8.1 outputs**

For HDR10 or Dolby Vision 8.1 outputs, the video profile must include the term *10BIT*.