

# Viewing input thumbnails
Thumbnails for inputsThumbnails

The guide now includes information about the new thumbnails feature that lets you view a preview of the current input for the channel.

MediaLive can generate thumbnails for the video from inputs in your channels. The thumbnail provides a visual verification that the content contains video. You can view the thumbnails for each channel on the MediaLive console. You can also use one of the AWS APIs to work with thumbnails programmatically.

**How thumbnails are generated**

When you have enabled thumbnails in a channel and the channel is running, MediaLive generates a JPEG thumbnail every 2 seconds. The thumbnail exists for only 2 seconds, until it gets replaced by the next thumbnail. Each input has its own thumbnail, which means that MediaLive generates one thumbnail for a single-pipeline channel, and two thumbnails for a standard channel.

As soon as the thumbnail is generated, MediaLive displays it on the console, in the channel details page. It also makes the thumbnail available as binary data. You can use an AWS API to work with the binary data programmatically.



**Encryption of the thumbnail**

MediaLive always encrypts each thumbnail as it is created. 



**Topics**
+ [

# Enabling thumbnails in a channel
](thumbnails-enable.md)
+ [

# Viewing thumbnails on the console
](thumbnails-view.md)
+ [

# Retrieving thumbnails programmatically
](thumbnails-work-cli.md)
+ [

# Limit on thumbnails in MediaLive
](thumbnail-limits.md)



# Enabling thumbnails in a channel
Enabling thumbnails

You must enable the thumbnails feature in each MediaLivechannel. 

You can enable or disable thumbnails only when the channel is idle (not running).

**Topics**
+ [

## Providing IAM access
](#thumbnails-enable-iam)
+ [

## Enabling thumbnails on the console
](#thumbnails-enable-console)
+ [

## Enabling thumbnails programmatically
](#thumbnails-enable-progammatically)

## Providing IAM access
IAM access for thumbnails

The guide has been updated to describe the IAM access you need to set up when enabling the thumbnails feature.

For the thumbnails feature to work, MediaLive needs access to Amazon S3:
+ If your organization uses the MediaLiveAccessRole trusted entity, go to the **Channel and input details** page of the channel configuration, and look in the **General info** section. If the **Update role** button appears in this section, select the button. If the button doesn't appear, then the trusted entity already has the access that it needs
+ If your organization uses custom trusted entity roles, then an IAM administrator must update the appropriate trusted entity roles. For information about the operations to add, read [Access requirements for the trusted entity](trusted-entity-requirements.md). Search for **thumbnails** on that page. For information about how to update the role, see [Create the trusted entity - complex option](setup-trusted-entity-complex.md).

## Enabling thumbnails on the console


**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). 

1. Open the MediaLive console at [https://console.aws.amazon.com/medialive/](https://console.aws.amazon.com/medialive/).

1. On the **Create channel** page or **Edit channel** page, choose **General settings**, then open the **Thumbnail configuration** section. 

1. Select **Enable thumbnail configuration**. In **State**, choose **AUTO** or **DISABLED**.

## Enabling thumbnails programmatically


To enable the thumbnails feature, include the `ThumbnailConfiguration` group of parameters in the JSON for the channel. Set the `State` parameter to `AUTO` (to enable) or `DISABLED`. 

The following example shows the relative location of the parameters in the JSON for the channel.

```
{
  "ChannelClass": "SINGLE_PIPELINE",
  .
  .
  . 
  "EncoderSettings": {
    .
    .
    .
    "TimecodeConfig": {
      "Source": "EMBEDDED"
    },
    "ThumbnailConfiguration": {
      "State": "DISABLED"
     },
    .
    .
    .
```

# Viewing thumbnails on the console
Viewing thumbnails

When thumbnails is enabled, MediaLive generates thumbnails for the currently active input in a channel that is running. For a standard channel, MediaLive generates two thumbnails. For a single-pipeline channel, MediaLive generates one thumbnail.

1. Open the MediaLive console at [https://console.aws.amazon.com/medialive/](https://console.aws.amazon.com/medialive/).

1. Choose **Channels** from the navigation bar. On the list of channels, select the channel by its name. The Details page appears.

   The **Status** section includes a thumbnail frame. If the channel has two inputs, the screen includes a tab for each input.

When the channel is running and the Details page is displayed, the thumbnail automatically updates every 2 seconds, for the pipeline in the active tab. MediaLive doesn't generate any thumbnails if this page isn't displayed.

If the channel isn't running, the frame is black.

If the channel stops running, the thumbnail preview stops updating. After a few seconds, the current thumbnail is replaced by a message.

# Retrieving thumbnails programmatically
Retrieving thumbnails

When the thumbnails feature is enabled, MediaLive generates thumbnails for the currently active input in a channel that is running. For a standard channel, MediaLive generates two thumbnails. For a single-pipeline channel, MediaLive generates one thumbnail.

You can use the AWS CLI to work with thumbnails programmatically. The following information assumes that you are familiar with the basics of using the AWS CLI. For information about the basics, see the [AWS CLI Command Reference](https://docs.aws.amazon.com/cli/latest/reference/). 

Use the `DescribeThumbnails` command. This command is represented differently in different interfaces:
+ In the AWS CLI, the command is `describe-thumbnails`.
+ In the API, the command is represented by an `HTTP GET` on `describe-thumbnails/kmsKeyId`.
+ In the AWS SDKs, the command is represented by constructs that are suitable to that SDK language. 

**To retrieve thumbnails using the AWS CLI**

1. Make sure that you have [enabled thumbnails in the channel](thumbnails-enable.md), and make sure that the channel is running.

1. Enter this command:

   **aws medialive describe-thumbnails --channel-id *value* --pipeline-id *value* --thumbnail-type *value* **

   Where:

   `channel-id` is required.

   `pipeline-id` is 0 or 1. If you want thumbnails for both pipelines, enter the command twice.

   `thumbnail-type` is always `CURRENT_ACTIVE`. This option is required, even though it has only one value.

1. The response appears on the screen. For example:

   ```
   {
       "ThumbnailDetails": [
           {
               "PipelineId": "0",
               "Thumbnails": [
                   {
                       "Body"base64 string of the JPEG image",
                       "ContentType": "image/jpeg",
                       "ThumbnailType": "CURRENT_ACTIVE",
                       "TimeStamp": "2023-07-15T21:01:11"
                   }
               ]
           }
       ]
   }
   ```

   If thumbnails are disabled, the response looks like this:

   ```
   {
       "ThumbnailDetails": []
   }
   ```

# Limit on thumbnails in MediaLive


There is a limit to the number of MediaLivethumbnails that you can view or retrieve. The limit is:

`A number of API transactions per second, per account, in one Region`

The transaction limit is shared by all thumbnails — those that you display on the console, and those that you retrieve using an AWS API. For the current limit, see the MediaLive page in the [Service Quotas](https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/medialive/quotas) console.

On the console, a thumbnail is generated for a channel only when the channel details page is displayed, and only in the active tab (meaning only for one pipeline in the channel). For the relevant pipelines, MediaLive makes a call to the API approximately every 2 seconds. 