# ExportResult

Artifact: [androidx.media3:media3-transformer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/transformer/ExportResult.java+class:androidx.media3.transformer.ExportResult)

*** ** * ** ***


```
@UnstableApi
public final class ExportResult
```

<br />

*** ** * ** ***

Information about the result of an export.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/media3/transformer/ExportResult.Builder` A builder for `https://developer.android.com/reference/androidx/media3/transformer/ExportResult` instances. |
| `public final class https://developer.android.com/reference/androidx/media3/transformer/ExportResult.ProcessedInput` An input entirely or partially processed. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#CONVERSION_PROCESS_NA() = 0` The output file doesn't contain this track type. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#CONVERSION_PROCESS_TRANSCODED() = 1` The track was transcoded. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#CONVERSION_PROCESS_TRANSMUXED() = 2` The track was transmuxed. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#CONVERSION_PROCESS_TRANSMUXED_AND_TRANSCODED() = 3` The track was both transcoded and transmuxed. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_ABANDONED_KEYFRAME_PLACEMENT_OPTIMAL_FOR_TRIM() = 2` `https://developer.android.com/reference/androidx/media3/transformer/Transformer.Builder#experimentalSetTrimOptimizationEnabled(boolean)`, but it would not improve performance because of key frame placement. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_ABANDONED_OTHER() = 4` The requested optimization would not improve performance for a reason other than the ones specified above, so it was abandoned. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_ABANDONED_TRIM_AND_TRANSCODING_TRANSFORMATION_REQUESTED() = 3` `https://developer.android.com/reference/androidx/media3/transformer/Transformer.Builder#experimentalSetTrimOptimizationEnabled(boolean)`, but it would not improve performance because another transformation that requires transcoding was also requested. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_FAILED_EXTRACTION_FAILED() = 5` The optimization failed because mp4 metadata extraction failed (possibly because the file wasn't an mp4 file). |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_FAILED_FORMAT_MISMATCH() = 6` The optimization failed because the format between the two parts of the media to be put together did not match. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_NONE() = 0` No optimizations were applied since none were requested. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#OPTIMIZATION_SUCCEEDED() = 1` The optimization was successfully applied. |

| ### Public fields |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#approximateDurationMs()` The approximate duration of the file in milliseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#audioConversionProcess()` Returns the `https://developer.android.com/reference/androidx/media3/transformer/ExportResult.ConversionProcess` taken to create the audio track in the output file. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#audioEncoderName()` The name of the audio encoder used, or `null` if none were used. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#audioMimeType()` The output audio `https://developer.android.com/reference/androidx/media3/common/MimeTypes`, or `null` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#averageAudioBitrate()` The average bitrate of the audio track data, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#averageVideoBitrate()` The average bitrate of the video track data, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#channelCount()` The channel count of the audio, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/ColorInfo` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#colorInfo()` The `https://developer.android.com/reference/androidx/media3/common/ColorInfo` of the video, or `null` if unset or unknown. |
| `final long` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#durationMs()` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#approximateDurationMs()` instead. <br /> |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/transformer/ExportException` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#exportException()` The `https://developer.android.com/reference/androidx/media3/transformer/ExportException` that caused the export to fail, or `null` if the export was a success. |
| `final long` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#fileSizeBytes()` The size of the file in bytes, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#height()` The height of the video, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#optimizationResult()` The result of any requested optimizations. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#sampleRate()` The sample rate of the audio, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#videoConversionProcess()` Returns the `https://developer.android.com/reference/androidx/media3/transformer/ExportResult.ConversionProcess` taken to create the video track in the output file. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#videoEncoderName()` The name of the video encoder used, or `null` if none were used. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#videoFrameCount()` The number of video frames. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#videoMimeType()` The output video `https://developer.android.com/reference/androidx/media3/common/MimeTypes`, or `null` if unset or unknown. |
| `final int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#width()` The width of the video, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/ExportResult.Builder` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#buildUpon()()` |
| `boolean` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#hashCode()()` |

## Constants

### CONVERSION_PROCESS_NA

```
public static final int CONVERSION_PROCESS_NA = 0
```

The output file doesn't contain this track type.

### CONVERSION_PROCESS_TRANSCODED

```
public static final int CONVERSION_PROCESS_TRANSCODED = 1
```

The track was transcoded.

### CONVERSION_PROCESS_TRANSMUXED

```
public static final int CONVERSION_PROCESS_TRANSMUXED = 2
```

The track was transmuxed.

### CONVERSION_PROCESS_TRANSMUXED_AND_TRANSCODED

```
public static final int CONVERSION_PROCESS_TRANSMUXED_AND_TRANSCODED = 3
```

The track was both transcoded and transmuxed.

### OPTIMIZATION_ABANDONED_KEYFRAME_PLACEMENT_OPTIMAL_FOR_TRIM

```
public static final int OPTIMIZATION_ABANDONED_KEYFRAME_PLACEMENT_OPTIMAL_FOR_TRIM = 2
```

`https://developer.android.com/reference/androidx/media3/transformer/Transformer.Builder#experimentalSetTrimOptimizationEnabled(boolean)`, but it would not improve performance because of key frame placement. The optimization was abandoned and normal export proceeded.

The trim optimization does not improve performance when the requested `https://developer.android.com/reference/androidx/media3/common/MediaItem.ClippingConfiguration#startPositionUs()` is at a key frame, or when there are no key frames between the requested `https://developer.android.com/reference/androidx/media3/common/MediaItem.ClippingConfiguration#startPositionUs()` and `https://developer.android.com/reference/androidx/media3/common/MediaItem.ClippingConfiguration#endPositionUs()`

### OPTIMIZATION_ABANDONED_OTHER

```
public static final int OPTIMIZATION_ABANDONED_OTHER = 4
```

The requested optimization would not improve performance for a reason other than the ones specified above, so it was abandoned. Normal export proceeded.

### OPTIMIZATION_ABANDONED_TRIM_AND_TRANSCODING_TRANSFORMATION_REQUESTED

```
public static final int OPTIMIZATION_ABANDONED_TRIM_AND_TRANSCODING_TRANSFORMATION_REQUESTED = 3
```

`https://developer.android.com/reference/androidx/media3/transformer/Transformer.Builder#experimentalSetTrimOptimizationEnabled(boolean)`, but it would not improve performance because another transformation that requires transcoding was also requested. The optimization was abandoned and normal export proceeded.

### OPTIMIZATION_FAILED_EXTRACTION_FAILED

```
public static final int OPTIMIZATION_FAILED_EXTRACTION_FAILED = 5
```

The optimization failed because mp4 metadata extraction failed (possibly because the file wasn't an mp4 file). Normal export proceeded.

### OPTIMIZATION_FAILED_FORMAT_MISMATCH

```
public static final int OPTIMIZATION_FAILED_FORMAT_MISMATCH = 6
```

The optimization failed because the format between the two parts of the media to be put together did not match. Normal export proceeded.

### OPTIMIZATION_NONE

```
public static final int OPTIMIZATION_NONE = 0
```

No optimizations were applied since none were requested.

### OPTIMIZATION_SUCCEEDED

```
public static final int OPTIMIZATION_SUCCEEDED = 1
```

The optimization was successfully applied.

## Public fields

### approximateDurationMs

```
public final long approximateDurationMs
```

The approximate duration of the file in milliseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unset or unknown.

To get the actual duration use `
androidx.media3.inspector.MetadataRetriever#retrieveDurationUs`.

### audioConversionProcess

```
public final int audioConversionProcess
```

Returns the `https://developer.android.com/reference/androidx/media3/transformer/ExportResult.ConversionProcess` taken to create the audio track in the output file.

### audioEncoderName

```
public final @Nullable String audioEncoderName
```

The name of the audio encoder used, or `null` if none were used.

### audioMimeType

```
public final @Nullable String audioMimeType
```

The output audio `https://developer.android.com/reference/androidx/media3/common/MimeTypes`, or `null` if unset or unknown.

### averageAudioBitrate

```
public final int averageAudioBitrate
```

The average bitrate of the audio track data, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if unset or unknown.

### averageVideoBitrate

```
public final int averageVideoBitrate
```

The average bitrate of the video track data, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if unset or unknown.

### channelCount

```
public final int channelCount
```

The channel count of the audio, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown.

### colorInfo

```
public final @Nullable ColorInfo colorInfo
```

The `https://developer.android.com/reference/androidx/media3/common/ColorInfo` of the video, or `null` if unset or unknown.

### durationMs

```
public final long durationMs
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/transformer/ExportResult#approximateDurationMs()` instead.

### exportException

```
public final @Nullable ExportException exportException
```

The `https://developer.android.com/reference/androidx/media3/transformer/ExportException` that caused the export to fail, or `null` if the export was a success.

### fileSizeBytes

```
public final long fileSizeBytes
```

The size of the file in bytes, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown.

### height

```
public final int height
```

The height of the video, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown.

### optimizationResult

```
public final int optimizationResult
```

The result of any requested optimizations.

### sampleRate

```
public final int sampleRate
```

The sample rate of the audio, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if unset or unknown.

### videoConversionProcess

```
public final int videoConversionProcess
```

Returns the `https://developer.android.com/reference/androidx/media3/transformer/ExportResult.ConversionProcess` taken to create the video track in the output file.

### videoEncoderName

```
public final @Nullable String videoEncoderName
```

The name of the video encoder used, or `null` if none were used.

### videoFrameCount

```
public final int videoFrameCount
```

The number of video frames.

### videoMimeType

```
public final @Nullable String videoMimeType
```

The output video `https://developer.android.com/reference/androidx/media3/common/MimeTypes`, or `null` if unset or unknown.

### width

```
public final int width
```

The width of the video, or `https://developer.android.com/reference/androidx/media3/common/C#LENGTH_UNSET()` if unset or unknown.

## Public methods

### buildUpon

```
public ExportResult.Builder buildUpon()
```

### equals

```
public boolean equals(@Nullable Object o)
```

### hashCode

```
public int hashCode()
```