# EncoderProfiles.VideoProfile

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

# VideoProfile

*** ** * ** ***

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

```
class VideoProfile
```

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

Configuration for a video encoder.

## Summary

|                                                                                                                Constants                                                                                                                 ||
|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [HDR_DOLBY_VISION](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_DOLBY_VISION:kotlin.Int) Dolby Vision |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [HDR_HDR10](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HDR10:kotlin.Int) HDR10.                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [HDR_HDR10PLUS](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HDR10PLUS:kotlin.Int) HDR10+.            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [HDR_HLG](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HLG:kotlin.Int) HLG (Hybrid-Log Gamma).        |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [HDR_NONE](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_NONE:kotlin.Int) Not HDR (SDR).               |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [YUV_420](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_420:kotlin.Int) YUV 4:2:0.                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [YUV_422](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_422:kotlin.Int) YUV 4:2:2.                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [YUV_444](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_444:kotlin.Int) YUV 4:4:4.                     |

|                                                                                                                                  Public methods                                                                                                                                   ||
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getBitDepth](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getBitDepth())`()` The bit depth of the encoded video.                                  |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getBitrate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getBitrate())`()` The target video output bitrate in bits per second                     |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getChromaSubsampling](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getChromaSubsampling())`()` The chroma subsampling of the encoded video.       |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getCodec](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getCodec())`()` The video encoder being used for the video track                           |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getFrameRate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getFrameRate())`()` The target video frame rate in frames per second.                  |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getHdrFormat](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getHdrFormat())`()` The HDR format of the encoded video.                               |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getHeight](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getHeight())`()` The target video frame height in pixels                                  |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getMediaType](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getMediaType())`()` The media type of the video encoder being used for the video track |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getProfile](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getProfile())`()` The video encoder profile being used for the video track.              |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getWidth](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getWidth())`()` The target video frame width in pixels                                     |

## Constants

### HDR_DOLBY_VISION

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

```
static val HDR_DOLBY_VISION: Int
```

Dolby Vision

An HDR format specifying Dolby Vision. For this format the codec is always a Dolby Vision encoder. The encoder profile specifies which Dolby Vision version is being used.  

    Value: 4

**See Also**

- [#getProfile](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getProfile())  

### HDR_HDR10

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

```
static val HDR_HDR10: Int
```

HDR10.

An HDR format specifying HDR10.  

    Value: 2

### HDR_HDR10PLUS

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

```
static val HDR_HDR10PLUS: Int
```

HDR10+.

An HDR format specifying HDR10+.  

    Value: 3

### HDR_HLG

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

```
static val HDR_HLG: Int
```

HLG (Hybrid-Log Gamma).

An HDR format specifying HLG.  

    Value: 1

### HDR_NONE

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

```
static val HDR_NONE: Int
```

Not HDR (SDR).

An HDR format specifying SDR (Standard Dynamic Range) recording.  

    Value: 0

### YUV_420

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

```
static val YUV_420: Int
```

YUV 4:2:0.

A chroma subsampling where the U and V planes are subsampled by 2 both horizontally and vertically.  

    Value: 0

### YUV_422

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

```
static val YUV_422: Int
```

YUV 4:2:2.

A chroma subsampling where the U and V planes are subsampled by 2 horizontally alone.  

    Value: 1

### YUV_444

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

```
static val YUV_444: Int
```

YUV 4:4:4.

A chroma subsampling where the U and V planes are not subsampled.  

    Value: 2

## Public methods

### getBitDepth

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

```
fun getBitDepth(): Int
```

The bit depth of the encoded video.

This value is effectively 8 or 10, but some devices may support additional values.  

### getBitrate

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

```
fun getBitrate(): Int
```

The target video output bitrate in bits per second

This is the target recorded video output bitrate if the application configures the video recording via[MediaRecorder.setProfile](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setProfile(android.media.CamcorderProfile))without specifying any other[MediaRecorder](https://developer.android.com/reference/kotlin/android/media/MediaRecorder)encoding parameters. For example, for high speed quality profiles (from[CamcorderProfile.QUALITY_HIGH_SPEED_LOW](https://developer.android.com/reference/kotlin/android/media/CamcorderProfile#QUALITY_HIGH_SPEED_LOW:kotlin.Int)to[android.media.CamcorderProfile#QUALITY_HIGH_SPEED_2160P](https://developer.android.com/reference/kotlin/android/media/CamcorderProfile#QUALITY_HIGH_SPEED_2160P:kotlin.Int)), this is the bitrate where the video is recorded with. If the application intends to record slow motion videos with the high speed quality profiles, it must set a different video bitrate that is corresponding to the desired recording output bit rate (i.e., the encoded video bitrate during normal playback) via[MediaRecorder.setVideoEncodingBitRate](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setVideoEncodingBitRate(kotlin.Int)). For example, if[android.media.CamcorderProfile#QUALITY_HIGH_SPEED_720P](https://developer.android.com/reference/kotlin/android/media/CamcorderProfile#QUALITY_HIGH_SPEED_720P:kotlin.Int)advertises 240fps[getFrameRate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getFrameRate())and 64Mbps[getBitrate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getBitrate())in the high speed VideoProfile, and the application intends to record 1/8 factor slow motion recording videos, the application must set 30fps via[MediaRecorder.setVideoFrameRate](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setVideoFrameRate(kotlin.Int))and 8Mbps ([getBitrate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getBitrate())\* slow motion factor) via[MediaRecorder.setVideoEncodingBitRate](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setVideoEncodingBitRate(kotlin.Int)). Failing to do so will result in videos with unexpected frame rate and bit rate, or[MediaRecorder](https://developer.android.com/reference/kotlin/android/media/MediaRecorder)error if the output bit rate exceeds the encoder limit. If the application intends to do the video recording with[MediaCodec](https://developer.android.com/reference/kotlin/android/media/MediaCodec)encoder, it must set each individual field of[MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat)similarly according to this VideoProfile.  
**See Also**

- [#getFrameRate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getFrameRate())
- [android.media.MediaRecorder](https://developer.android.com/reference/kotlin/android/media/MediaRecorder)
- [android.media.MediaCodec](https://developer.android.com/reference/kotlin/android/media/MediaCodec)
- [android.media.MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat)  

### getChromaSubsampling

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

```
fun getChromaSubsampling(): Int
```

The chroma subsampling of the encoded video.

For most devices this is always YUV_420 but some devices may support additional values.

|                                                                                                                                                                                                                                                                                             Return                                                                                                                                                                                                                                                                                              ||
|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is[android.media.EncoderProfiles.VideoProfile#YUV_420](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_420:kotlin.Int),[android.media.EncoderProfiles.VideoProfile#YUV_422](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_422:kotlin.Int), or[android.media.EncoderProfiles.VideoProfile#YUV_444](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_444:kotlin.Int) |

**See Also**

- [#YUV_420](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_420:kotlin.Int)
- [#YUV_422](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_422:kotlin.Int)
- [#YUV_444](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#YUV_444:kotlin.Int)  

### getCodec

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

```
fun getCodec(): Int
```

The video encoder being used for the video track

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Return                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is[android.media.MediaRecorder.VideoEncoder#DEFAULT](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#DEFAULT:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#H263](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#H263:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#H264](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#H264:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#MPEG_4_SP](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#MPEG_4_SP:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#VP8](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#VP8:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#HEVC](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#HEVC:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#VP9](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#VP9:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#DOLBY_VISION](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#DOLBY_VISION:kotlin.Int),[android.media.MediaRecorder.VideoEncoder#AV1](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#AV1:kotlin.Int), or[android.media.MediaRecorder.VideoEncoder#APV](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder#APV:kotlin.Int) |

**See Also**

- [android.media.MediaRecorder.VideoEncoder](https://developer.android.com/reference/kotlin/android/media/MediaRecorder.VideoEncoder)  

### getFrameRate

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

```
fun getFrameRate(): Int
```

The target video frame rate in frames per second.

This is the target recorded video output frame rate per second if the application configures the video recording via[MediaRecorder.setProfile](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setProfile(android.media.CamcorderProfile))without specifying any other[MediaRecorder](https://developer.android.com/reference/kotlin/android/media/MediaRecorder)encoding parameters. For example, for high speed quality profiles (from[CamcorderProfile.QUALITY_HIGH_SPEED_LOW](https://developer.android.com/reference/kotlin/android/media/CamcorderProfile#QUALITY_HIGH_SPEED_LOW:kotlin.Int)to[android.media.CamcorderProfile#QUALITY_HIGH_SPEED_2160P](https://developer.android.com/reference/kotlin/android/media/CamcorderProfile#QUALITY_HIGH_SPEED_2160P:kotlin.Int)), this is the frame rate where the video is recorded and played back with. If the application intends to create slow motion use case with the high speed quality profiles, it must set a different video frame rate that is corresponding to the desired output (playback) frame rate via[android.media.MediaRecorder#setVideoFrameRate](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setVideoFrameRate(kotlin.Int)). For example, if[android.media.CamcorderProfile#QUALITY_HIGH_SPEED_720P](https://developer.android.com/reference/kotlin/android/media/CamcorderProfile#QUALITY_HIGH_SPEED_720P:kotlin.Int)advertises 240fps[getFrameRate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getFrameRate())in the VideoProfile, and the application intends to create 1/8 factor slow motion recording videos, the application must set 30fps via[android.media.MediaRecorder#setVideoFrameRate](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setVideoFrameRate(kotlin.Int)). Failing to do so will result in high speed videos with normal speed playback frame rate (240fps for above example). If the application intends to do the video recording with[MediaCodec](https://developer.android.com/reference/kotlin/android/media/MediaCodec)encoder, it must set each individual field of[MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat)similarly according to this VideoProfile.  
**See Also**

- [#getBitrate](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#getBitrate())
- [android.media.MediaRecorder](https://developer.android.com/reference/kotlin/android/media/MediaRecorder)
- [android.media.MediaCodec](https://developer.android.com/reference/kotlin/android/media/MediaCodec)
- [android.media.MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat)  

### getHdrFormat

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

```
fun getHdrFormat(): Int
```

The HDR format of the encoded video.

This is one of the HDR_ values.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Return                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is[android.media.EncoderProfiles.VideoProfile#HDR_NONE](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_NONE:kotlin.Int),[android.media.EncoderProfiles.VideoProfile#HDR_HLG](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HLG:kotlin.Int),[android.media.EncoderProfiles.VideoProfile#HDR_HDR10](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HDR10:kotlin.Int),[android.media.EncoderProfiles.VideoProfile#HDR_HDR10PLUS](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HDR10PLUS:kotlin.Int), or[android.media.EncoderProfiles.VideoProfile#HDR_DOLBY_VISION](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_DOLBY_VISION:kotlin.Int) |

**See Also**

- [#HDR_NONE](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_NONE:kotlin.Int)
- [#HDR_HLG](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HLG:kotlin.Int)
- [#HDR_HDR10](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HDR10:kotlin.Int)
- [#HDR_HDR10PLUS](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_HDR10PLUS:kotlin.Int)
- [#HDR_DOLBY_VISION](https://developer.android.com/reference/kotlin/android/media/EncoderProfiles.VideoProfile#HDR_DOLBY_VISION:kotlin.Int)  

### getHeight

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

```
fun getHeight(): Int
```

The target video frame height in pixels  

### getMediaType

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

```
fun getMediaType(): String
```

The media type of the video encoder being used for the video track

|                                                    Return                                                     ||
|----------------------------------------------------------------------------------|-----------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be`null`. |

**See Also**

- [android.media.MediaFormat#KEY_MIME](https://developer.android.com/reference/kotlin/android/media/MediaFormat#KEY_MIME:kotlin.String)  

### getProfile

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

```
fun getProfile(): Int
```

The video encoder profile being used for the video track.

This value is negative if there is no profile defined for the video codec.  
**See Also**

- [android.media.MediaRecorder#setVideoEncodingProfileLevel](https://developer.android.com/reference/kotlin/android/media/MediaRecorder#setVideoEncodingProfileLevel(kotlin.Int,%20kotlin.Int))
- [android.media.MediaFormat#KEY_PROFILE](https://developer.android.com/reference/kotlin/android/media/MediaFormat#KEY_PROFILE:kotlin.String)  

### getWidth

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

```
fun getWidth(): Int
```

The target video frame width in pixels