docs/doc/reference/com/google/android/exoplayer2/transformer/DefaultEncoderFactory.html
Package com.google.android.exoplayer2.transformer
All Implemented Interfaces:Codec.EncoderFactory
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDefaultEncoderFactoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Codec.EncoderFactory](Codec.EncoderFactory.html "interface in com.google.android.exoplayer2.transformer")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
A default implementation of Codec.EncoderFactory.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | DefaultEncoderFactory.Builder |
Deprecated.
A builder for DefaultEncoderFactory instances.
|
Constructors | Constructor | Description |
| --- | --- |
| DefaultEncoderFactory(Context context) |
Deprecated.
Use DefaultEncoderFactory.Builder instead.
|
| DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, boolean enableFallback) |
Deprecated.
Use DefaultEncoderFactory.Builder instead.
|
| DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, VideoEncoderSettings requestedVideoEncoderSettings, boolean enableFallback) |
Deprecated.
Use DefaultEncoderFactory.Builder instead.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| DefaultCodec | createForAudioEncoding(Format format) |
Deprecated.
Returns a Codec for audio encoding.
|
| DefaultCodec | createForVideoEncoding(Format format) |
Deprecated.
Returns a DefaultCodec for video encoding.
|
| boolean | videoNeedsEncoding() |
Deprecated.
Returns whether the video needs to be encoded because of encoder specific configuration. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
audioNeedsEncoding
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public DefaultEncoderFactory([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)
Deprecated.
Use DefaultEncoderFactory.Builder instead.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public DefaultEncoderFactory([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[EncoderSelector](EncoderSelector.html "interface in com.google.android.exoplayer2.transformer")videoEncoderSelector,
boolean enableFallback)
Deprecated.
Use DefaultEncoderFactory.Builder instead.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public DefaultEncoderFactory([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[EncoderSelector](EncoderSelector.html "interface in com.google.android.exoplayer2.transformer")videoEncoderSelector,[VideoEncoderSettings](VideoEncoderSettings.html "class in com.google.android.exoplayer2.transformer")requestedVideoEncoderSettings,
boolean enableFallback)
Deprecated.
Use DefaultEncoderFactory.Builder instead.
-
public[DefaultCodec](DefaultCodec.html "class in com.google.android.exoplayer2.transformer")createForAudioEncoding([Format](../Format.html "class in com.google.android.exoplayer2")format)
throws[ExportException](ExportException.html "class in com.google.android.exoplayer2.transformer")
Deprecated.
Description copied from interface: Codec.EncoderFactory
Returns a Codec for audio encoding.
The caller should ensure the MIME type is supported on the device before calling this method.
Specified by:createForAudioEncoding in interface Codec.EncoderFactoryParameters:format - The Format (of the output data) used to determine the underlying encoder and its configuration values. Format.sampleMimeType, Format.sampleRate, Format.channelCount and Format.bitrate are set to those of the desired output video format.Returns:A Codec for encoding audio to the requested MIME type.Throws:ExportException - If no suitable Codec can be created.
-
public[DefaultCodec](DefaultCodec.html "class in com.google.android.exoplayer2.transformer")createForVideoEncoding([Format](../Format.html "class in com.google.android.exoplayer2")format)
throws[ExportException](ExportException.html "class in com.google.android.exoplayer2.transformer")
Deprecated.
Returns a DefaultCodec for video encoding.
Use DefaultEncoderFactory.Builder.setRequestedVideoEncoderSettings(com.google.android.exoplayer2.transformer.VideoEncoderSettings) with VideoEncoderSettings.bitrate set to request for a specific encoding bitrate. Bitrate settings in Format are ignored when VideoEncoderSettings.bitrate or VideoEncoderSettings.enableHighQualityTargeting is set.
Specified by:createForVideoEncoding in interface Codec.EncoderFactoryParameters:format - The Format (of the output data) used to determine the underlying encoder and its configuration values. Format.sampleMimeType, Format.width and Format.height are set to those of the desired output video format. Format.frameRate is set to the requested output frame rate, if available. Format.colorInfo is set to the requested output color characteristics, if available. Format.rotationDegrees is 0 and Format.width >= Format.height, therefore the video is always in landscape orientation.Returns:A Codec for encoding video to the requested MIME type.Throws:ExportException - If no suitable Codec can be created.
-
public boolean videoNeedsEncoding()
Deprecated.
Description copied from interface: Codec.EncoderFactory
Returns whether the video needs to be encoded because of encoder specific configuration.
Specified by:videoNeedsEncoding in interface Codec.EncoderFactory