# MediaCodecInfo.EncoderCapabilities

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# EncoderCapabilities

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaCodecInfo.EncoderCapabilities "View this page in Java")  

```
class EncoderCapabilities
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                       ||
| ↳ | [android.media.MediaCodecInfo.EncoderCapabilities](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#) |

A class that supports querying the encoding capabilities of a codec.

## Summary

|                                                                                                                                   Constants                                                                                                                                    ||
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_CBR](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_CBR:kotlin.Int) Constant bitrate mode                        |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_CBR_FD](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_CBR_FD:kotlin.Int) Constant bitrate mode with frame drops |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_CQ](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_CQ:kotlin.Int) Constant quality mode                          |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_VBR](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_VBR:kotlin.Int) Variable bitrate mode                        |

|                                                                                                                                                                                                                          Public methods                                                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Range](https://developer.android.com/reference/kotlin/android/util/Range.html#)\<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\>! | [getComplexityRange](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#getComplexityRange())`()` Returns the supported range of encoder complexity values.                                                                                        |
| [Range](https://developer.android.com/reference/kotlin/android/util/Range.html#)\<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\>! | [getQualityRange](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#getQualityRange())`()` Returns the supported range of quality values.                                                                                                         |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                               | [isBitrateModeSupported](https://developer.android.com/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities#isBitrateModeSupported(kotlin.Int))`(`mode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Query whether a bitrate mode is supported. |

## Constants

### BITRATE_MODE_CBR

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val BITRATE_MODE_CBR: Int
```

Constant bitrate mode  

    Value: 2

### BITRATE_MODE_CBR_FD

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val BITRATE_MODE_CBR_FD: Int
```

Constant bitrate mode with frame drops  

    Value: 3

### BITRATE_MODE_CQ

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val BITRATE_MODE_CQ: Int
```

Constant quality mode  

    Value: 0

### BITRATE_MODE_VBR

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val BITRATE_MODE_VBR: Int
```

Variable bitrate mode  

    Value: 1

## Public methods

### getComplexityRange

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getComplexityRange(): Range<Int!>!
```

Returns the supported range of encoder complexity values.

Some codecs may support multiple complexity levels, where higher complexity values use more encoder tools (e.g. perform more intensive calculations) to improve the quality or the compression ratio. Use a lower value to save power and/or time.  

### getQualityRange

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getQualityRange(): Range<Int!>!
```

Returns the supported range of quality values. Quality is implementation-specific. As a general rule, a higher quality setting results in a better image quality and a lower compression ratio.  

### isBitrateModeSupported

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun isBitrateModeSupported(mode: Int): Boolean
```

Query whether a bitrate mode is supported.