Stay organized with collections
Save and categorize content based on your preferences.
public
static
final
class
MediaCodecInfo.EncoderCapabilities
extends Object
A class that supports querying the encoding capabilities of a codec.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Constants
BITRATE_MODE_CBR
public static final int BITRATE_MODE_CBR
Constant bitrate mode
Constant Value:
2
(0x00000002)
BITRATE_MODE_CBR_FD
public static final int BITRATE_MODE_CBR_FD
Constant bitrate mode with frame drops
Constant Value:
3
(0x00000003)
BITRATE_MODE_CQ
public static final int BITRATE_MODE_CQ
Constant quality mode
Constant Value:
0
(0x00000000)
BITRATE_MODE_VBR
public static final int BITRATE_MODE_VBR
Variable bitrate mode
Constant Value:
1
(0x00000001)
Public methods
getComplexityRange
public Range<Integer> getComplexityRange ()
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
public Range<Integer> getQualityRange ()
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
public boolean isBitrateModeSupported (int mode)
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nMediaCodecInfo.EncoderCapabilities\n==================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/MediaCodecInfo.EncoderCapabilities \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\nfinal\n\nclass\nMediaCodecInfo.EncoderCapabilities\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|--------------------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.media.MediaCodecInfo.EncoderCapabilities |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA class that supports querying the encoding capabilities of a codec.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [BITRATE_MODE_CBR](/reference/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_CBR) Constant bitrate mode |\n| `int` | [BITRATE_MODE_CBR_FD](/reference/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_CBR_FD) Constant bitrate mode with frame drops |\n| `int` | [BITRATE_MODE_CQ](/reference/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_CQ) Constant quality mode |\n| `int` | [BITRATE_MODE_VBR](/reference/android/media/MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_VBR) Variable bitrate mode |\n\n| ### Public methods ||\n|----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` `[Range](/reference/android/util/Range)`\u003c`[Integer](/reference/java/lang/Integer)`\u003e` | ` `[getComplexityRange](/reference/android/media/MediaCodecInfo.EncoderCapabilities#getComplexityRange())`() ` Returns the supported range of encoder complexity values. |\n| ` `[Range](/reference/android/util/Range)`\u003c`[Integer](/reference/java/lang/Integer)`\u003e` | ` `[getQualityRange](/reference/android/media/MediaCodecInfo.EncoderCapabilities#getQualityRange())`() ` Returns the supported range of quality values. |\n| ` boolean` | ` `[isBitrateModeSupported](/reference/android/media/MediaCodecInfo.EncoderCapabilities#isBitrateModeSupported(int))`(int mode) ` Query whether a bitrate mode is supported. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nConstants\n---------\n\n### BITRATE_MODE_CBR\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int BITRATE_MODE_CBR\n```\n\nConstant bitrate mode\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### BITRATE_MODE_CBR_FD\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int BITRATE_MODE_CBR_FD\n```\n\nConstant bitrate mode with frame drops\n\n\u003cbr /\u003e\n\nConstant Value:\n\n3\n(0x00000003)\n\n\n### BITRATE_MODE_CQ\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int BITRATE_MODE_CQ\n```\n\nConstant quality mode\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### BITRATE_MODE_VBR\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int BITRATE_MODE_VBR\n```\n\nVariable bitrate mode\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nPublic methods\n--------------\n\n### getComplexityRange\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Range\u003cInteger\u003e getComplexityRange ()\n```\n\nReturns the supported range of encoder complexity values.\n\n\nSome codecs may support multiple complexity levels, where higher\ncomplexity values use more encoder tools (e.g. perform more\nintensive calculations) to improve the quality or the compression\nratio. Use a lower value to save power and/or time.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------------------|--------|\n| [Range](/reference/android/util/Range)`\u003c`[Integer](/reference/java/lang/Integer)`\u003e` | \u003cbr /\u003e |\n\n### getQualityRange\n\nAdded in [API level 28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Range\u003cInteger\u003e getQualityRange ()\n```\n\nReturns the supported range of quality values.\n\nQuality is implementation-specific. As a general rule, a higher quality\nsetting results in a better image quality and a lower compression ratio.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------------------|--------|\n| [Range](/reference/android/util/Range)`\u003c`[Integer](/reference/java/lang/Integer)`\u003e` | \u003cbr /\u003e |\n\n### isBitrateModeSupported\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic boolean isBitrateModeSupported (int mode)\n```\n\nQuery whether a bitrate mode is supported.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|--------------|\n| `mode` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |"]]