> Documentation index: https://developer.android.com/reference/llms.txt

# VideoEncoderConfiguration

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

*** ** * ** ***


```
@ExperimentalApi
public final class VideoEncoderConfiguration
```

<br />

*** ** * ** ***

The complete configuration of a Video Encoder, including which `android.media.MediaCodec` is used, the settings to apply, and the bitrate to use.

## Summary

| ### Public fields |
|---|---|
| `final Format` | `format` The `Format` the codec described by this configuration produces. |
| `final boolean` | `isFallback` Whether this is a fallback configuration. |
| `final VideoEncoderSettings` | `videoEncoderSettings` The `VideoEncoderSettings` used to configure the codec described by this configuration. |

| ### Public constructors |
|---|
| `VideoEncoderConfiguration( VideoEncoderSettings videoEncoderSettings, Format format, boolean isFallback )` Creates an instance. |

| ### Public methods |
|---|---|
| `boolean` | `equals(@Nullable Object o)` |
| `int` | `hashCode()` |
| `String` | `toString()` |

## Public fields

### format

```
public final Format format
```

The `Format` the codec described by this configuration produces.

`sampleMimeType` is always set. `width`, `height`, `frameRate` and `averageBitrate` are `NO_VALUE` if not configured.

### isFallback

```
public final boolean isFallback
```

Whether this is a fallback configuration.

### videoEncoderSettings

```
public final VideoEncoderSettings videoEncoderSettings
```

The `VideoEncoderSettings` used to configure the codec described by this configuration.

## Public constructors

### VideoEncoderConfiguration

```
public VideoEncoderConfiguration(
    VideoEncoderSettings videoEncoderSettings,
    Format format,
    boolean isFallback
)
```

Creates an instance.

`format` must have a non-null `sampleMimeType`. It may optionally specify the resolution (`width`, `height`, and `frameRate`) and bitrate (`averageBitrate`); unset fields must be left at `NO_VALUE`, and any set resolution or bitrate fields must be strictly positive (with all three resolution fields set together).

| Parameters |
|---|---|
| `VideoEncoderSettings videoEncoderSettings` | The `VideoEncoderSettings` used to configure the encoder. |
| `Format format` | The `Format` of the encoded video stream. |
| `boolean isFallback` | Whether this is a fallback configuration. |

| Throws |
|---|---|
| `java.lang.IllegalArgumentException` | If `sampleMimeType` is `null`, if only a subset of resolution fields (`width`, `height`, `frameRate`) are set, or if any set resolution or bitrate field is not strictly positive. |

## Public methods

### equals

```
public boolean equals(@Nullable Object o)
```

### hashCode

```
public int hashCode()
```

### toString

```
public String toString()
```