Stay organized with collections
Save and categorize content based on your preferences.
EncoderCapabilities
class EncoderCapabilities
A class that supports querying the encoding capabilities of a codec.
Summary
Constants |
static Int |
Constant bitrate mode
|
static Int |
Constant bitrate mode with frame drops
|
static Int |
Constant quality mode
|
static Int |
Variable bitrate mode
|
Public methods |
Range<Int!>! |
Returns the supported range of encoder complexity values.
|
Range<Int!>! |
Returns the supported range of quality values.
|
Boolean |
Query whether a bitrate mode is supported.
|
Constants
BITRATE_MODE_CBR
static val BITRATE_MODE_CBR: Int
Constant bitrate mode
Value: 2
BITRATE_MODE_CBR_FD
static val BITRATE_MODE_CBR_FD: Int
Constant bitrate mode with frame drops
Value: 3
BITRATE_MODE_CQ
static val BITRATE_MODE_CQ: Int
Constant quality mode
Value: 0
BITRATE_MODE_VBR
static val BITRATE_MODE_VBR: Int
Variable bitrate mode
Value: 1
Public methods
getComplexityRange
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
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
fun isBitrateModeSupported(mode: Int): Boolean
Query whether a bitrate mode is supported.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaCodecInfo.EncoderCapabilities\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nEncoderCapabilities\n===================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaCodecInfo.EncoderCapabilities \"View this page in Java\") \n\n```\nclass EncoderCapabilities\n```\n\n|---|-------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaCodecInfo.EncoderCapabilities](#) |\n\nA class that supports querying the encoding capabilities of a codec.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_CBR](#BITRATE_MODE_CBR:kotlin.Int) Constant bitrate mode |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_CBR_FD](#BITRATE_MODE_CBR_FD:kotlin.Int) Constant bitrate mode with frame drops |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_CQ](#BITRATE_MODE_CQ:kotlin.Int) Constant quality mode |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITRATE_MODE_VBR](#BITRATE_MODE_VBR:kotlin.Int) Variable bitrate mode |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Range](../util/Range.html#)\\\u003c[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\\\u003e! | [getComplexityRange](#getComplexityRange())`()` Returns the supported range of encoder complexity values. |\n| [Range](../util/Range.html#)\\\u003c[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)!\\\u003e! | [getQualityRange](#getQualityRange())`()` Returns the supported range of quality values. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isBitrateModeSupported](#isBitrateModeSupported(kotlin.Int))`(`mode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Query whether a bitrate mode is supported. |\n\nConstants\n---------\n\n### BITRATE_MODE_CBR\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val BITRATE_MODE_CBR: Int\n```\n\nConstant bitrate mode \n\n Value: 2\n\n### BITRATE_MODE_CBR_FD\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val BITRATE_MODE_CBR_FD: Int\n```\n\nConstant bitrate mode with frame drops \n\n Value: 3\n\n### BITRATE_MODE_CQ\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val BITRATE_MODE_CQ: Int\n```\n\nConstant quality mode \n\n Value: 0\n\n### BITRATE_MODE_VBR\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val BITRATE_MODE_VBR: Int\n```\n\nVariable bitrate mode \n\n Value: 1\n\nPublic methods\n--------------\n\n### getComplexityRange\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getComplexityRange(): Range\u003cInt!\u003e!\n```\n\nReturns the supported range of encoder complexity values.\n\nSome 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. \n\n### getQualityRange\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getQualityRange(): Range\u003cInt!\u003e!\n```\n\nReturns 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. \n\n### isBitrateModeSupported\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun isBitrateModeSupported(mode: Int): Boolean\n```\n\nQuery whether a bitrate mode is supported."]]