# FragmentedMp4Extractor

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

*** ** * ** ***


```
@UnstableApi
public class FragmentedMp4Extractor implements Extractor
```

<br />

*** ** * ** ***

Extracts data from the FMP4 container format.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(flag = true, value = ) public annotation https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags` Flags controlling the behavior of the extractor. |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/media3/extractor/ExtractorsFactory` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FACTORY()` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#newFactory(androidx.media3.extractor.text.SubtitleParser.Factory)` instead. <br /> |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_DISABLE_ARTWORK_METADATA() = 1024` Flag to disable parsing of artwork metadata. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_DISABLE_HAGC_METADATA() = 2048` Flag to disable parsing of HAGC (ST 2094-50) metadata. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_EMIT_RAW_MEBX_DATA() = 4096` Flag to emit `mebx` tracks as raw `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_MEBX()` tracks without converting `it35` keys to `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_ITUT_T35()` or unboxing sample payloads, regardless of whether `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_DISABLE_HAGC_METADATA()` is set. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_EMIT_RAW_SUBTITLE_DATA() = 32` Flag to use the source subtitle formats without modification. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_ENABLE_EMSG_TRACK() = 4` Flag to indicate that the extractor should output an event message metadata track. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_MERGE_FRAGMENTED_SIDX() = 256` Flag to enable reading and merging of all sidx boxes before continuing extraction. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_READ_MFRA_FOR_SEEK_MAP() = 512` Flag to enable reading the 'mfra' box for seeking in fragmented MP4s. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME() = 1` Flag to work around an issue in some video streams where every frame is marked as a sync frame. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_WORKAROUND_IGNORE_EDIT_LISTS() = 16` Flag to ignore any edit lists in the stream. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_WORKAROUND_IGNORE_TFDT_BOX() = 2` Flag to ignore any tfdt boxes in the stream. |

| ### Public constructors |
|---|
| `[FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory)` instead <br /> |
| `[FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int))(@https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int)` instead <br /> |
| `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory)(https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory)` Constructs an instance. |
| `[FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster))( @https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead <br /> |
| `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int)( https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory, @https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags )` Constructs an instance. |
| `[FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track))( @https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track sideloadedTrack )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead <br /> |
| `[FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>))( @https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track sideloadedTrack, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead <br /> |
| `[FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput))( @https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track sideloadedTrack, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/TrackOutput additionalEmsgTrackOutput )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead <br /> |
| `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)( https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory, @https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track sideloadedTrack, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/TrackOutput additionalEmsgTrackOutput )` Constructs an instance. |

| ### Public methods |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/androidx/media3/extractor/SniffFailure>` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#getSniffFailureDetails()()` Returns additional details about the last call to `https://developer.android.com/reference/androidx/media3/extractor/Extractor#sniff(androidx.media3.extractor.ExtractorInput)`. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#init(androidx.media3.extractor.ExtractorOutput)(https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput output)` Initializes the extractor with an `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput`. |
| `static https://developer.android.com/reference/androidx/media3/extractor/ExtractorsFactory` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#newFactory(androidx.media3.extractor.text.SubtitleParser.Factory)(https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory)` Creates a factory for `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor` instances with the provided `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory`. |
| `int` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)(https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input, https://developer.android.com/reference/androidx/media3/extractor/PositionHolder seekPosition)` Extracts data read from a provided `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput`. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#release()()` Releases all kept resources. |
| `void` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#seek(long,long)(long position, long timeUs)` Notifies the extractor that a seek has occurred. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#sniff(androidx.media3.extractor.ExtractorInput)(https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input)` Returns whether this extractor can extract samples from the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput`, which must provide data from the start of the stream. |

| ### Protected methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track` | `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#modifyTrack(androidx.media3.extractor.mp4.Track)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track track)` |

### Inherited Constants

From [androidx.media3.extractor.Extractor](https://developer.android.com/reference/androidx/media3/extractor/Extractor) `static final int` `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_CONTINUE() = 0`

Returned by `https://developer.android.com/reference/androidx/media3/extractor/Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)` if the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` passed to the next `https://developer.android.com/reference/androidx/media3/extractor/Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)` is required to provide data continuing from the position in the stream reached by the returning call.
`static final int` `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_END_OF_INPUT() = -1`

Returned by `https://developer.android.com/reference/androidx/media3/extractor/Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)` if the end of the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` was reached.
`static final int` `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_SEEK() = 1`

Returned by `https://developer.android.com/reference/androidx/media3/extractor/Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)` if the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` passed to the next `https://developer.android.com/reference/androidx/media3/extractor/Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)` is required to provide data starting from a specified position in the stream.

### Inherited methods

From [androidx.media3.extractor.Extractor](https://developer.android.com/reference/androidx/media3/extractor/Extractor) `https://developer.android.com/reference/androidx/media3/extractor/Extractor` `@https://checkerframework.org/api/org/checkerframework/dataflow/qual/SideEffectFree.html
https://developer.android.com/reference/androidx/media3/extractor/Extractor#getUnderlyingImplementation()()`

Returns the 'real' `Extractor` implementation if this is a delegating instance, or `
this` if this instance does the extraction directly without delegating (the default behaviour).

## Constants

### FACTORY

```
public static final ExtractorsFactory FACTORY
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#newFactory(androidx.media3.extractor.text.SubtitleParser.Factory)` instead.

### FLAG_DISABLE_ARTWORK_METADATA

```
public static final int FLAG_DISABLE_ARTWORK_METADATA = 1024
```

Flag to disable parsing of artwork metadata.

### FLAG_DISABLE_HAGC_METADATA

```
public static final int FLAG_DISABLE_HAGC_METADATA = 2048
```

Flag to disable parsing of HAGC (ST 2094-50) metadata.

### FLAG_EMIT_RAW_MEBX_DATA

```
public static final int FLAG_EMIT_RAW_MEBX_DATA = 4096
```

Flag to emit `mebx` tracks as raw `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_MEBX()` tracks without converting `it35` keys to `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_ITUT_T35()` or unboxing sample payloads, regardless of whether `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_DISABLE_HAGC_METADATA()` is set.

### FLAG_EMIT_RAW_SUBTITLE_DATA

```
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 32
```

Flag to use the source subtitle formats without modification. If unset, subtitles will be transcoded to `https://developer.android.com/reference/androidx/media3/common/MimeTypes#APPLICATION_MEDIA3_CUES()` during extraction.

### FLAG_ENABLE_EMSG_TRACK

```
public static final int FLAG_ENABLE_EMSG_TRACK = 4
```

Flag to indicate that the extractor should output an event message metadata track. Any event messages in the stream will be delivered as samples to this track.

### FLAG_MERGE_FRAGMENTED_SIDX

```
public static final int FLAG_MERGE_FRAGMENTED_SIDX = 256
```

Flag to enable reading and merging of all sidx boxes before continuing extraction.

### FLAG_READ_MFRA_FOR_SEEK_MAP

```
public static final int FLAG_READ_MFRA_FOR_SEEK_MAP = 512
```

Flag to enable reading the 'mfra' box for seeking in fragmented MP4s.

### FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME

```
public static final int FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME = 1
```

Flag to work around an issue in some video streams where every frame is marked as a sync frame. The workaround overrides the sync frame flags in the stream, forcing them to false except for the first sample in each segment.

This flag does nothing if the stream is not a video stream.

### FLAG_WORKAROUND_IGNORE_EDIT_LISTS

```
public static final int FLAG_WORKAROUND_IGNORE_EDIT_LISTS = 16
```

Flag to ignore any edit lists in the stream.

### FLAG_WORKAROUND_IGNORE_TFDT_BOX

```
public static final int FLAG_WORKAROUND_IGNORE_TFDT_BOX = 2
```

Flag to ignore any tfdt boxes in the stream.

## Public constructors

### FragmentedMp4Extractor

```
public [FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory)` instead

### FragmentedMp4Extractor

```
public [FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int))(@FragmentedMp4Extractor.Flags int flags)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int)` instead

### FragmentedMp4Extractor

```
public FragmentedMp4Extractor(SubtitleParser.Factory subtitleParserFactory)
```

Constructs an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory` | The `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` for parsing subtitles during extraction. |

### FragmentedMp4Extractor

```
public [FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster))(
    @FragmentedMp4Extractor.Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead

### FragmentedMp4Extractor

```
public FragmentedMp4Extractor(
    SubtitleParser.Factory subtitleParserFactory,
    @FragmentedMp4Extractor.Flags int flags
)
```

Constructs an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory` | The `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` for parsing subtitles during extraction. |
| `@https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags` | Flags that control the extractor's behavior. |

### FragmentedMp4Extractor

```
public [FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track))(
    @FragmentedMp4Extractor.Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead

### FragmentedMp4Extractor

```
public [FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>))(
    @FragmentedMp4Extractor.Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack,
    List<Format> closedCaptionFormats
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead

### FragmentedMp4Extractor

```
public [FragmentedMp4Extractor](https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput))(
    @FragmentedMp4Extractor.Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack,
    List<Format> closedCaptionFormats,
    @Nullable TrackOutput additionalEmsgTrackOutput
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FragmentedMp4Extractor(androidx.media3.extractor.text.SubtitleParser.Factory,int,androidx.media3.common.util.TimestampAdjuster,androidx.media3.extractor.mp4.Track,java.util.List<androidx.media3.common.Format>,androidx.media3.extractor.TrackOutput)` instead

### FragmentedMp4Extractor

```
public FragmentedMp4Extractor(
    SubtitleParser.Factory subtitleParserFactory,
    @FragmentedMp4Extractor.Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack,
    List<Format> closedCaptionFormats,
    @Nullable TrackOutput additionalEmsgTrackOutput
)
```

Constructs an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory subtitleParserFactory` | The `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory` for parsing subtitles during extraction. |
| `@https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor.Flags int flags` | Flags that control the extractor's behavior. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/util/TimestampAdjuster timestampAdjuster` | Adjusts sample timestamps. May be null if no adjustment is needed. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/mp4/Track sideloadedTrack` | Sideloaded track information, in the case that the extractor will not receive a moov box in the input data. Null if a moov box is expected. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/Format> closedCaptionFormats` | For tracks that contain SEI messages, the formats of the closed caption channels to expose. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/extractor/TrackOutput additionalEmsgTrackOutput` | An extra track output that will receive all emsg messages targeting the player, even if `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor#FLAG_ENABLE_EMSG_TRACK()` is not set. Null if special handling of emsg messages for players is not required. |

## Public methods

### getSniffFailureDetails

```
public ImmutableList<SniffFailure> getSniffFailureDetails()
```

Returns additional details about the last call to `https://developer.android.com/reference/androidx/media3/extractor/Extractor#sniff(androidx.media3.extractor.ExtractorInput)`. The returned list may be empty if no additional details are available, or the last `https://developer.android.com/reference/androidx/media3/extractor/Extractor#sniff(androidx.media3.extractor.ExtractorInput)` call returned `
true`.

This only contains details that were discovered before `https://developer.android.com/reference/androidx/media3/extractor/Extractor#sniff(androidx.media3.extractor.ExtractorInput)` returned `
false`, it is not an exhaustive list of issues which, if resolved, would cause the file to be successfully sniffed.

### init

```
public void init(ExtractorOutput output)
```

Initializes the extractor with an `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput`. Called at most once.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput output` | An `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput` to receive extracted data. |

### newFactory

```
public static ExtractorsFactory newFactory(SubtitleParser.Factory subtitleParserFactory)
```

Creates a factory for `https://developer.android.com/reference/androidx/media3/extractor/mp4/FragmentedMp4Extractor` instances with the provided `https://developer.android.com/reference/androidx/media3/extractor/text/SubtitleParser.Factory`.

### read

```
public int read(ExtractorInput input, PositionHolder seekPosition)
```

Extracts data read from a provided `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput`. Must not be called before `https://developer.android.com/reference/androidx/media3/extractor/Extractor#init(androidx.media3.extractor.ExtractorOutput)`.

A single call to this method will block until some progress has been made, but will not block for longer than this. Hence each call will consume only a small amount of input data.

In the common case, `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_CONTINUE()` is returned to indicate that the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` passed to the next read is required to provide data continuing from the position in the stream reached by the returning call. If the extractor requires data to be provided from a different position, then that position is set in `seekPosition` and `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_SEEK()` is returned. If the extractor reached the end of the data provided by the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput`, then `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_END_OF_INPUT()` is returned.

When this method throws an `https://developer.android.com/reference/java/io/IOException.html`, extraction may continue by providing an `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` with an unchanged `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput#getPosition()` to a subsequent call to this method.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input` | The `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` from which data should be read. |
| `https://developer.android.com/reference/androidx/media3/extractor/PositionHolder seekPosition` | If `https://developer.android.com/reference/androidx/media3/extractor/Extractor#RESULT_SEEK()` is returned, this holder is updated to hold the position of the required data. |

| Returns |
|---|---|
| `int` | One of the `RESULT_` values defined in this interface. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | If an error occurred reading from or parsing the input. |

### release

```
public void release()
```

Releases all kept resources.

### seek

```
public void seek(long position, long timeUs)
```

Notifies the extractor that a seek has occurred.

Following a call to this method, the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` passed to the next invocation of `https://developer.android.com/reference/androidx/media3/extractor/Extractor#read(androidx.media3.extractor.ExtractorInput,androidx.media3.extractor.PositionHolder)` is required to provide data starting from `
position` in the stream. Valid random access positions are the start of the stream and positions that can be obtained from any `https://developer.android.com/reference/androidx/media3/extractor/SeekMap` passed to the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput`.

| Parameters |
|---|---|
| `long position` | The byte offset in the stream from which data will be provided. |
| `long timeUs` | The seek time in microseconds. |

### sniff

```
public boolean sniff(ExtractorInput input)
```

Returns whether this extractor can extract samples from the `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput`, which must provide data from the start of the stream.

If `true` is returned, the `input`'s reading position may have been modified. Otherwise, only its peek position may have been modified.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput input` | The `https://developer.android.com/reference/androidx/media3/extractor/ExtractorInput` from which data should be peeked/read. |

| Returns |
|---|---|
| `boolean` | Whether this extractor can read the provided input. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | If an error occurred reading from the input. |

## Protected methods

### modifyTrack

```
protected @Nullable Track modifyTrack(@Nullable Track track)
```