# VideoFrameAggregationParameters.Builder

Artifact: [androidx.media3:media3-transformer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/transformer/VideoFrameAggregationParameters.java+class:androidx.media3.transformer.VideoFrameAggregationParameters.Builder)

*** ** * ** ***


```
public final class VideoFrameAggregationParameters.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters.Builder#Builder()()` Creates a new instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters` | `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters.Builder#build()()` Builds a `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters` instance. |
| `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters.Builder#setFrameRate(android.util.Rational)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/util/Rational.html frameRate)` Sets the target frame rate for aggregating video frames. |

## Public constructors

### Builder

```
public Builder()
```

Creates a new instance.

## Public methods

### build

```
public VideoFrameAggregationParameters build()
```

Builds a `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters` instance.

### setFrameRate

```
@CanIgnoreReturnValue
public VideoFrameAggregationParameters.Builder setFrameRate(@Nullable Rational frameRate)
```

Sets the target frame rate for aggregating video frames.

If set, the aggregation process will drop or reuse frames (with appropriate retiming) to match this rate. This allows the pipeline to guarantee a single, constant frame rate before frames enter the processing layer. For example, if the target frame rate is 30 FPS, a 24 FPS video will have some frames reused, and a 60 FPS video will have some frames dropped to meet the target.

If `null`, the aggregation follows the primary sequence's physical timestamps. The default is `null`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/util/Rational.html frameRate` | The target frame rate, in frames per second. Must be strictly positive or `null`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/VideoFrameAggregationParameters.Builder` | This builder. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `frameRate` is not strictly positive and not ` null`. |