# Muxer.Factory

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

*** ** * ** ***


```
interface Muxer.Factory
```

<br />

Known direct subclasses [DefaultMuxer.Factory](https://developer.android.com/reference/kotlin/androidx/media3/transformer/DefaultMuxer.Factory), [FrameworkMuxer.Factory](https://developer.android.com/reference/kotlin/androidx/media3/transformer/FrameworkMuxer.Factory), [InAppFragmentedMp4Muxer.Factory](https://developer.android.com/reference/kotlin/androidx/media3/transformer/InAppFragmentedMp4Muxer.Factory), [InAppMp4Muxer.Factory](https://developer.android.com/reference/kotlin/androidx/media3/transformer/InAppMp4Muxer.Factory)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/transformer/DefaultMuxer.Factory` | A `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory` for `https://developer.android.com/reference/kotlin/androidx/media3/transformer/DefaultMuxer`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/transformer/FrameworkMuxer.Factory` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory` for `https://developer.android.com/reference/kotlin/androidx/media3/transformer/FrameworkMuxer`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/transformer/InAppFragmentedMp4Muxer.Factory` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory` for `https://developer.android.com/reference/kotlin/androidx/media3/transformer/InAppFragmentedMp4Muxer`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/transformer/InAppMp4Muxer.Factory` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory` for `https://developer.android.com/reference/kotlin/androidx/media3/transformer/InAppMp4Muxer`. |

*** ** * ** ***

Factory for muxers.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer!` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory#create(java.lang.String)(path: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns a new `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer!` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory#create(android.os.ParcelFileDescriptor)(pfd: https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!)` Returns a new `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer`. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory#getSupportedSampleMimeTypes(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType trackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the supported sample `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes` for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory#supportsWritingNegativeTimestampsInEditList()()` Whether the muxer supports writing negative timestamps into an edit list to instruct players to ignore these samples. |

## Public functions

### create

```
fun create(path: String!): Muxer!
```

Returns a new `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer`.

| Parameters |
|---|---|
| `path: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The path to the output file. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/muxer/MuxerException` | If an error occurs opening the output file for writing. |

### create

```
fun create(pfd: ParcelFileDescriptor!): Muxer!
```

Returns a new `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer`.

The caller transfers ownership of the `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html` to the `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer.Factory`. If this method returns successfully, the created `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer` is responsible for closing the descriptor when `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer#close()` is called. If an error occurs and a `https://developer.android.com/reference/kotlin/androidx/media3/muxer/MuxerException` is thrown, the descriptor is closed before the exception is thrown.

Whether the provided `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html` must be seekable depends on the container format and `https://developer.android.com/reference/kotlin/androidx/media3/muxer/Muxer` implementation. For example, standard MP4 muxers require seekable descriptors (such as those opened with `"rwt"` or `"rw"`), whereas streaming muxers (such as fragmented MP4 muxers) also accept non-seekable streams like pipes.

| Parameters |
|---|---|
| `pfd: https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` | the `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html` to write output to |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/muxer/MuxerException` | if an error occurs opening the output for writing or if the descriptor does not satisfy the seekability requirements of the muxer |

### getSupportedSampleMimeTypes

```
fun getSupportedSampleMimeTypes(@C.TrackType trackType: Int): ImmutableList<String!>!
```

Returns the supported sample `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes` for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType`.

### supportsWritingNegativeTimestampsInEditList

```
fun supportsWritingNegativeTimestampsInEditList(): Boolean
```

Whether the muxer supports writing negative timestamps into an edit list to instruct players to ignore these samples.