

# Clipping video using AWS Elemental Inference
<a name="elemental-inference-event-clip"></a>

**Note**  
The information in this section assumes that you are familiar with the general steps for creating a channel, as described in [Creating a channel from scratch](creating-channel-scratch.md). 

In an AWS Elemental MediaLive channel, you can enable the event clipping feature in order to generate metadata that identifies interesting events in the stream. You can then use an application of your choice to use the metadata to make a clip.

MediaLive uses AWS Elemental Inference for this feature. 
+ When a channel with event clipping is also running (active), MediaLive delivers the source stream to Elemental Inference. 
+ Elemental Inference uses foundational models to continually analyze the content to detect events of interest. For each event, Elemental Inference generates metadata that identifies the start and finish of the event. Elemental Inference sends the metadata for each event to EventBridge. 

Note that MediaLive delivers the source stream to Elemental Inference, and then its involvement in event clipping stops.

You can subscribe to EventBridge for these events, then use a third-party application to create a video clip. 

**Important**  
Currently, MediaLive supports event clipping with video for soccer games and basketball games. 

**Topics**
+ [

# Get Ready
](event-clip-getready.md)
+ [

# Setting up event clipping
](event-clip-procedure-console.md)
+ [

# Viewing the event clipping setup
](event-clip-view-console.md)
+ [

## Viewing the setup on the Elemental Inference console
](#event-clip-inference-view)
+ [

# Modifying the event clipping configuration
](event-clip-modify.md)
+ [

# Disabling event clipping
](event-clip-disable.md)
+ [

# Monitoring event clipping activity
](event-clip-monitor.md)

# Get Ready
<a name="event-clip-getready"></a>

## Pricing
<a name="event-clip-pricing"></a>

There is a charge for running a channel that has the event clipping feature enabled. The charge is applied to each pipeline, which means that it applies once in single-pipeline channels and twice in standard channels. The charge isn't applied to each output in the channel, it is applied only to the pipelines.

To stop this charge, you must [disable the feature](event-clip-disable.md). For information about the current rates for using this feature, see [https://aws.amazon.com/elemental-inference/pricing/](https://aws.amazon.com/elemental-inference/pricing/).

## Source requirements
<a name="event-clip-source-requirements"></a>
+ Input type: All supported types. The *input* must be live input, not a file input.
+ Input codec: All supported codecs 
+ Input resolution: All supported resolutions.
+ Aspect ratio: Any aspect ratio 
+ Static image overlays and burned-in captions: We recommend that the source doesn’t include static image overlays or burned-in captions because the event clipping might cut them off awkwardly. 
+ Event clipping is supported in channels that implement input switching and/or input failover. 
+ Event clipping isn't supported in MediaLive Anywhere channels. 

# Setting up event clipping
<a name="event-clip-procedure-console"></a>

You can set up event clipping in a new MediaLive channel that you are creating. Or you can update an existing channel to include event clipping . You can set up event clipping and other Elemental Inference features at the same time, in either a new channel or an existing channel. 

This section describes how to set up event clipping using the MediaLive console. For information about setting up using an AWS API, see [Elemental Inference features using AWS CLI](elemental-inference-cli.md).

**Note**  
The information in this section assumes that you are familiar with the general steps for creating a channel, as described in [Creating a channel from scratch](creating-channel-scratch.md). 

You must enable event clipping in the channel. 

1. If you plan to update an existing feed, make sure that you have room in the [enabled outputs quota](https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/elemental-inference/quotas) for Elemental Inference. The list of quotas is sorted alphabetically. Look for quotas that don't start with "Request rate for".

   Keep in mind that each feature that you enable in a channel results in one Elemental Inference output.

1. On the **Create channel** or **Edit channel page**, choose **AWS Elemental Inference settings**. Complete the fields as follows:
   + In **State**, choose **Enabled**. Sections for each Elemental Inference feature appear. 
   + Expand the **Clip events** section. In **State**, choose **Enabled**. 
   + In **Callback config**, you can enter a string that you want Elemental Inference to always include in the event clipping metadata for this output. This information is useful when you later work with Elemental Inference events in EventBridge. You will be able to filter events using this information, in order to find the events for one feed. The string might identify the sports event in the feed, for example.

1. Save the channel. MediaLive calls the Elemental Inference `AssociateFeed` endpoint to perform these actions:
   + To create an event clipping output in the feed. 
   + To associate the channel (the resource) with the feed, if this is the first Elemental Inference feature that you are setting up.

   You now have a usable feed: resource - feed - output.

   You can start the channel. When the channel is running, MediaLive delivers the source stream to Elemental Inference and then retrieves metadata from Elemental Inference. This metadata provides information that you use to crop and scale the video. You use a third-party solution to transform the video. (MediaLive can't crop the video.) For more information, see [ Creating an Elemental Inference workflow](https://docs.aws.amazon.com/elemental-inference/latest/userguide/elemental-inference-configuration) in the *AWS Elemental Inference user guide*.

# Viewing the event clipping setup
<a name="event-clip-view-console"></a>

You can view information about the Elemental Inference features in a channel. 

**Note**  
This section describes how to set up view event clipping information using the MediaLive console. To view information using an AWS API, use the `GetFeed` operation. For more information, see [ GetFeed](https://docs.aws.amazon.com/elemental-inference/latest/APIReference/API_GetFeed) in the *AWS Elemental Inference API Reference*. 

You can view information about the Elemental Inference features in a channel. You can view information on the MediaLive console or the Elemental Inference console. 

## Viewing the setup on the MediaLive console
<a name="event-clip-eml-console-view"></a>

On the MediaLive console, in the left navigation bar, choose **Channels**, then choose the channel to view. In the tabs in the middle of the page, choose **AWS Elemental Inference**. Information appears, including the following:

**ID and ARN**

The ID and ARN of the Elemental Inference feed that is associated with the channel. 

The ID is identical to the last portion of the ARN of the feed. If you are interested in working with the feed using Elemental Inference directly, make a note of the ARN.

**Status of the feed**

These statuses are listed in lifetime order, from **CREATING** to **ARCHIVED**. Note the following:
+ A newly created feed typically transitions immediately from **CREATING** to **AVAILABLE** to **ACTIVE**. **ACTIVE** means that the feed is associated with the channel.
+ When MediaLive deletes a feed, its status changes to **DELETED**, then after a short period, it changes to **ARCHIVED**. There is no way to change the status of a feed that is **DELETED** or **ARCHIVED**. If you re-enable Elemental Inference features in a channel, MediaLive will create a new feed that has a new ID.

**Feature panels**

One panel appears for each Elemental Inference feature that you have enabled in the channel. Each panel includes the following information:
+ The type of feature.
+ The status of the feature, which will always be **ENABLED**. (If you disable the feature, the entire panel disappears, so you won't see **DISABLED**.)
+ Settings, which shows the value in the callback field.

## Viewing the setup using the Elemental Inference CLI
<a name="event-clip-inference-view-cli"></a>

To view information using an AWS API, use the `GetFeed` operation of Elemental Inference. For more information, see [ GetFeed](https://docs.aws.amazon.com/elemental-inference/latest/APIReference/API_GetFeed) in the *AWS Elemental Inference API Reference*. 

## Viewing the setup on the Elemental Inference console
<a name="event-clip-inference-view"></a>

To view information for a feed on the Elemental Inference console, see [ Creating an Elemental Inference workflow](https://docs.aws.amazon.com/elemental-inference/latest/userguide/monitoring-inference-via-console) in the *AWS Elemental Inference user guide*.

# Modifying the event clipping configuration
<a name="event-clip-modify"></a>

**Note**  
This section describes how to modify the event clipping configuration using the MediaLive console. For information about modifying using an AWS API, see [ Work with existing Elemental Inference feeds](https://docs.aws.amazon.com/elemental-inference/latest/userguide/elemental-inference-modify-delete) in the *AWS Elemental Inference user guide*. 

You can modify change the callback config field:

1. On the **Create channel** or **Edit channel page**, choose **AWS Elemental Inference settings**. If necessary, expand the **Event clipping** section. 

1. Change the value in **Callback config**.

# Disabling event clipping
<a name="event-clip-disable"></a>

You can disable event clipping in a channel. 

On the **Create channel** or **Edit channel page**, choose **AWS Elemental Inference settings**. Choose the appropriate action:
+ To disable all Elemental Inference features, set the **State** field for Elemental Inference to **Disabled**.
+ To disable only the event clipping feature, set the **State** field in **Event clipping** to **Disabled**.

# Monitoring event clipping activity
<a name="event-clip-monitor"></a>

You can monitor event clipping activity using these services:
+ Metrics that Amazon CloudWatch produces, using data sent by Elemental Inference. See [ Monitoring AWS Elemental Inference with Amazon CloudWatch ](https://docs.aws.amazon.com/elemental-inference/latest/userguide/monitoring-cloudwatch) in the *AWS Elemental Inference user guide*. 
+ Events that Elemental Inference produces. You can use Amazon EventBridge to work with these events. See [ Monitoring AWS Elemental Inference events with Amazon EventBridge ](https://docs.aws.amazon.com/elemental-inference/latest/userguide/monitoring-events) in the *AWS Elemental Inference user guide*. 
+ Actions that Amazon EventBridge takes and that are collected by AWS CloudTrail. See [ Monitoring Elemental Inference API calls with AWS CloudTrail](https://docs.aws.amazon.com/elemental-inference/latest/userguide/logging-using-cloudtrail) in the *AWS Elemental Inference user guide*. 