

# Handling color space metadata in the inputs
<a name="color-space-input-handling"></a>

You must assess the color space of the MediaLive inputs and determine if the color space metadata needs to be cleaned up. You must perform this assessment in order to decide about the correct handling for the outputs.

**Topics**
+ [Assess the color space metadata in the sources](color-space-input-procedure.md)
+ [Options for correcting metadata](color-space-cleanup-scenarios.md)
+ [Set up inputs to correct metadata](color-space-input-setup.md)

# Assess the color space metadata in the sources
<a name="color-space-input-procedure"></a>

Before you can set up the outputs, you must determine if you need to modify the color space metadata in the inputs. To make this decision, you must assess the quality of the metadata in the inputs. 

**Important**  
The handling on the input side of the event is about changing the color space metadata, not changing the color space itself. The handling is about changing the metadata to correctly identify the color space in the input, in preparation for the planned handling in the outputs.  
The conversion of the video to a different color space occurs in [Configuring color space handling in each output](color-space-output-handling.md).

**To assess the inputs**

1. You should have already obtained information about the accuracy of the color space metadata in all the inputs. 

1. Make a note of the presence and accuracy of the metadata for all the color spaces in all the inputs.

   The color space metadata is accurate if the following applies:
   + It is present in the input and it accurately identifies the color space, which means that the color space is accurately marked.

   The color space metadata might be present, but it might be inaccurate in one or more ways:
   + Incorrect: The metadata doesn't match the color space.
   + Unknown: The metadata marks the color space as *unknown*.
   + Not supported: The metadata specifies a color space that MediaLive [doesn't support](color-space-standards.md). MediaLive doesn't read this metadata.
   + Missing: All or part of the video might not have color space metadata. 

1. This step applies only for the following situation:
   + The input is for a MediaLive device such as AWS Elemental Link.
   + The input color space is HDR10. 
   + You plan to pass through the color space to the output.

   Obtain the values for the Max CLL and Max FALL for the content. 

   MediaLive can't read the metadata from an AWS Elemental Link device. But you will be able to enter the color space and the display metadata (Max CLL and Max FALL) manually, in the channel configuration.

   You don't need these values if you plan to convert this input from HDR10 to another color space.

# Options for correcting metadata
<a name="color-space-cleanup-scenarios"></a>

In step 1, you assessed the status of the color space metadata in the MediaLive inputs. You must now decide if you can clean up any inaccurate metadata. 

MediaLive can clean up the color space metadata for any color space except Dolby Vision 8.1 or an unsupported color space.

**Note**  
If you want to convert the color space in your channel, the metadata for all the inputs must be either accurate or cleaned up. If there is even one input that you can't clean up, you won't be able to convert the color space in the outputs. You will have to set up to pass through the color space.  
If you want to pass through the color space and include its metadata, the metadata for all the inputs must be either accurate or cleaned up. The downstream system reads this metadata, so it must be accurate. If there is even one input that you can't clean up, you can pass through the color space, but you should omit the color space in the output.

**Topics**
+ [Scenario A – Metadata is accurate](color-space-scenario-pass.md)
+ [Scenario B – Metadata can be corrected with force](color-space-scenario-correct.md)
+ [Scenario C – Correct the metadata with fallback](color-space-scenario-correct-one.md)
+ [Scenario D – Metadata can't be corrected](color-space-scenario-correct-multiple.md)

# Scenario A – Metadata is accurate
<a name="color-space-scenario-pass"></a>

During assessment of the MediaLive input, you might have determined the following:
+ The content is in one color space, the color space is supported, and the color space metadata is accurate.
+ Or different portions of the content are in different color spaces, and the color space metadata is accurate for each portion.

You have these options for handling the metadata in the output:

**Include the metadata**

Follow the procedure in [Set up inputs to correct metadata](color-space-input-setup.md), and set the key fields as follows:
+ **Color space **field – Set to **FOLLOW** 
+ **Color space usage **field – MediaLive ignores this field.

During processing, MediaLive will read the metadata, in order to identify the color space. 

**Remove the metadata**

You might have already decided to remove the color space metadata even though it is accurate. For example, the color space might change frequently within the input, or between one input and another. You know that there is a system downstream of MediaLive that can't handle changes in the metadata. 

You can still convert or pass through the color space. It is safe to convert the color space because the metadata is reliable. 

Follow the procedure in [Set up inputs to correct metadata](color-space-input-setup.md), and set the key fields as follows:
+ **Color space **field – Set to **FOLLOW** 
+ **Color space usage **field – MediaLive ignores this field.

During processing, MediaLive will read the metadata, in order to identify the color space. 

# Scenario B – Metadata can be corrected with force
<a name="color-space-scenario-correct"></a>

During assessment of the MediaLive input, you might have determined the following:
+ The content is in one color space, and that is a supported color space.
+ The color space metadata is inaccurate. It could be any combination of inaccurate, missing, unknown, or unsupported (inaccurately marked as a color space that MediaLive doesn't support). 

Note that this is the scenario that always applies if the input is from an AWS Elemental Link device.

You have this option for handling the metadata in the output:

**Correct the metadata**

You can correct the metadata. Follow the procedure in [Set up inputs to correct metadata](color-space-input-setup.md), and set the key fields as follows:
+ **Color space **field – Set to the color space that has unacceptable metadata. 
+ **Color space usage **field – Set to **FORCE**

During processing, MediaLive will create metadata of the specified color space for all missing, unmarked, and unknown metadata. It will also change all existing metadata to the specified color space. (It will *force* the metadata.)

After ingest, all the content in the input will be consistently marked as one color space.

# Scenario C – Correct the metadata with fallback
<a name="color-space-scenario-correct-one"></a>

During assessment of the MediaLive input, you might have determined the following:
+ Different portions of the content are in different color spaces. All those color spaces are supported.
+ The metadata for one color space is either inaccurate everywhere, or is sometimes accurate and sometimes inaccurate. 
+ The metadata for content for all the other color spaces is accurate. 

For example, the input has Rec. 601 content that has portions that are inaccurately marked. It also has portions that are missing, unknown, or unsupported. The input also has HDR10 content and HLG content that is accurately marked.

You have this option for handling the metadata in the output:

**Correct the metadata**

Follow the procedure in [Set up inputs to correct metadata](color-space-input-setup.md), and set the key fields as follows:
+ **Color space **field – Set to the color space that has inconsistent metadata (Rec. 601 in the above example).
+ **Color space usage **field – Set to **FALLBACK**

During ingest, MediaLive will create metadata of the specific color space for all missing, unmarked, and unknown video content. It won't change any supported color space metadata. (It will *fall back *to the existing metadata.) Therefore, it won't change the accurately marked Rec. 601 or the accurately marked HDR10 or HLG content. 

After ingest, all the content in the input will be consistently marked, even though the content is in several color spaces.

# Scenario D – Metadata can't be corrected
<a name="color-space-scenario-correct-multiple"></a>

During assessment of the MediaLive input, you might have determined the following:
+ Different portions of the content are in different color spaces. All those color spaces are supported.
+ The metadata is inaccurate for more than one color space. (Compare this to scenario C, where the metadata is inaccurate only for one color space.)

Or you might have determined the following:
+ The content provider can't provide accurate information about the color space or its metadata.

You have this option for handling the metadata in the output:

**Remove the metadata**

There is no way to clean up this content because MediaLive can correct the metadata for only one color space. In this scenario, the metadata is inaccurate in different types of color space.

You can't force the color space metadata. For example, you can't force it to Rec. 601, because sometimes will correctly identify the accompanying color space, but sometimes it won't. Inaccurate metadata will result in an inaccurate conversion (if you convert the color space in the output), or in an inferior viewing experience (if you pass through the color space in the output).

Follow the procedure in [Set up inputs to correct metadata](color-space-input-setup.md), and set the key fields as follows:
+ **Color space **field – Set to **FOLLOW** 
+ **Color space usage **field – MediaLive ignores this field.

During processing, MediaLive won't read the metadata. 

You won't be able to convert the color space in any outputs, even for other inputs that have correct color space metadata.

# Set up inputs to correct metadata
<a name="color-space-input-setup"></a>

In the previous step, you identified how to correct color space metadata in each MediaLive input. This section describes how to set up each input for the required correction.

**Note**  
This section assumes that you are familiar with creating or editing a channel, as described in [Creating a channel from scratch](creating-channel-scratch.md). 

**To set up each input attached to the channel**

1. On the **Create Channel** page, in the **Input attachments** section, for **Video selector**, choose **Video selector**. 

1. Set the appropriate values for **Color space** and **Color space usage**. See the table after this procedure.

1. This step applies only if you chose **HDR10** and the attached input is for a MediaLive device such as AWS Elemental Link, and you plan to convert the content to another color space. You must specify the values for the Max CLL and Max FALL for the content. You should have obtained this information from the content provider.

   In the **Max CLL** field and the **Max FALL** field, enter the values.

In the following table, each row shows a valid combination of the two fields and the result of that combination. 


|  **Color space** field  |  **Color space usage** field  | Result | 
| --- | --- | --- | 
|  **FOLLOW**   |  This field is ignored.  | Passthrough. MediaLive doesn't change the color space metadata.  | 
|  **REC\$1601** or  **REC\$1709** or **HDR10** or **HLG** or **Dolby Vision 8.1**  |  **Force**   | Cleanup. MediaLive marks all the content as using the specified color space.  | 
|  **REC\$1601** or **REC\$1709** or **HDR10** or **HLG** or  **Dolby Vision 8.1**  |  **Fallback**   |  Cleanup. MediaLive marks the content as using the specified color space only for portions of the content that are unmarked or marked as unknown or marked with an unsupported color space.   | 