1--- 2title: Supported formats 3--- 4 5When defining the formats that ExoPlayer supports, it's important to note that 6"media formats" are defined at multiple levels. From the lowest level to the 7highest, these are: 8 9* The format of the individual media samples (e.g., a frame of video or a frame 10 of audio). These are *sample formats*. Note that a typical video file will 11 contain media in at least two sample formats; one for video (e.g., H.264) and 12 one for audio (e.g., AAC). 13* The format of the container that houses the media samples and associated 14 metadata. These are *container formats*. A media file has a single container 15 format (e.g., MP4), which is commonly indicated by the file extension. Note 16 that for some audio only formats (e.g., MP3), the sample and container formats 17 may be the same. 18* Adaptive streaming technologies such as DASH, SmoothStreaming and HLS. These 19 are not media formats as such, however it's still necessary to define what 20 level of support ExoPlayer provides. 21 22The following sections define ExoPlayer's support at each level, from highest to 23lowest. The last two sections describe support for standalone subtitle formats 24and HDR video playback. 25 26## Adaptive streaming ## 27 28### DASH ### 29 30{% include_relative _page_fragments/supported-formats-dash.md %} 31 32### SmoothStreaming ### 33 34{% include_relative _page_fragments/supported-formats-smoothstreaming.md %} 35 36### HLS ### 37 38{% include_relative _page_fragments/supported-formats-hls.md %} 39 40## Progressive container formats ## 41 42{% include_relative _page_fragments/supported-formats-progressive.md %} 43 44## RTSP ## 45 46{% include_relative _page_fragments/supported-formats-rtsp.md %} 47 48## Sample formats ## 49 50By default ExoPlayer uses Android's platform decoders. Hence the supported 51sample formats depend on the underlying platform rather than on ExoPlayer. 52Sample formats supported by Android devices are documented 53[here](https://developer.android.com/guide/appendix/media-formats.html#core). 54Note that individual devices may support additional formats beyond those listed. 55 56In addition to Android's platform decoders, ExoPlayer can also make use of 57software decoder extensions. These must be manually built and included in 58projects that wish to make use of them. We currently provide software decoder 59extensions for 60[AV1]({{ site.release_v2 }}/extensions/av1), 61[VP9]({{ site.release_v2 }}/extensions/vp9), 62[FLAC]({{ site.release_v2 }}/extensions/flac), 63[Opus]({{ site.release_v2 }}/extensions/opus) and 64[FFmpeg]({{ site.release_v2 }}/extensions/ffmpeg). 65 66### FFmpeg extension ### 67 68The [FFmpeg extension]({{ site.release_v2 }}/extensions/ffmpeg) supports 69decoding a variety of different audio sample formats. You can choose which 70decoders to include when building the extension, as documented in the 71extension's [README.md]({{ site.release_v2 }}/extensions/ffmpeg/README.md). The 72following table provides a mapping from audio sample format to the corresponding 73FFmpeg decoder name. 74 75| Sample format | Decoder name(s) | 76|---------------:|----------------------------| 77| Vorbis | vorbis | 78| Opus | opus | 79| FLAC | flac | 80| ALAC | alac | 81| PCM μ-law | pcm_mulaw | 82| PCM A-law | pcm_alaw | 83| MP1, MP2, MP3 | mp3 | 84| AMR-NB | amrnb | 85| AMR-WB | amrwb | 86| AAC | aac | 87| AC-3 | ac3 | 88| E-AC-3 | eac3 | 89| DTS, DTS-HD | dca | 90| TrueHD | mlp truehd | 91 92## Standalone subtitle formats ## 93 94ExoPlayer supports standalone subtitle files in a variety of formats. Subtitle 95files can be side-loaded as described on the [media items page][]. 96 97| Container format | Supported | MIME type | 98|---------------------------|:------------:|:----------| 99| WebVTT | YES | MimeTypes.TEXT_VTT | 100| TTML / SMPTE-TT | YES | MimeTypes.APPLICATION_TTML | 101| SubRip | YES | MimeTypes.APPLICATION_SUBRIP | 102| SubStationAlpha (SSA/ASS) | YES | MimeTypes.TEXT_SSA | 103 104[media items page]: {{ site.baseurl }}/media-items.html#sideloading-subtitle-tracks 105 106## HDR video playback ## 107 108ExoPlayer handles extracting high dynamic range (HDR) video in various 109containers, including Dolby Vision in MP4 and HDR10+ in Matroska/WebM. Decoding 110and displaying HDR content depends on support from the Android platform and 111device. See 112[HDR Video Playback](https://source.android.com/devices/tech/display/hdr.html) 113to learn about checking for HDR decoding/display capabilities and limitations of 114HDR support across Android versions. 115 116When playing an HDR stream that requires support for a particular codec profile, 117ExoPlayer's default `MediaCodec` selector will pick a decoder that supports that 118profile (if available), even if another decoder for the same MIME type that 119doesn't support that profile appears higher up the codec list. This can result 120in selecting a software decoder in cases where the stream exceeds the 121capabilities of a hardware decoder for the same MIME type. 122