supported-formats.md 5.7 KB
Newer Older
O
ojw28 已提交
1 2 3
---
layout: default
title: Supported formats
O
Oliver Woodman 已提交
4
weight: 3
O
ojw28 已提交
5 6
---

O
ojw28 已提交
7 8
When defining the formats that ExoPlayer supports, it's important to note that "media formats" are
in fact defined at multiple levels. From the lowest level to the highest, these are:
O
ojw28 已提交
9 10 11 12 13 14 15 16 17

* The format of the individual media samples (e.g. a frame of video or a frame of audio). We call
these *sample formats*. Note that a typical video file will contain media in at least two sample
formats; one for video (e.g. H.264) and one for audio (e.g. AAC).
* The format of the container that houses the media samples and associated metadata. We call these
*container formats*. A media file has a single container format (e.g. MP4), which is commonly
indicated by the file extension. Note that for some audio only formats (e.g. MP3), the sample and
container formats may be the same.
* Adaptive streaming technologies such as DASH, SmoothStreaming and HLS. These are not media formats
O
ojw28 已提交
18
as such, however it's still necessary to define what level of support ExoPlayer provides.
O
ojw28 已提交
19

O
ojw28 已提交
20
The following sections define ExoPlayer's support at each level, from highest to lowest.
O
ojw28 已提交
21 22 23 24 25

## Adaptive streaming ##

### DASH ###

O
ojw28 已提交
26 27
ExoPlayer supports DASH with the FMP4, WebM and Matroska container formats. Media streams must be
demuxed, meaning that video, audio and text must be defined in distinct AdaptationSet elements in
O
ojw28 已提交
28 29
the DASH manifest. The contained sample formats must also be supported (see the
[sample formats](#sample-formats) section for details).
O
ojw28 已提交
30 31 32 33

| Feature | Supported    | Comment              |
|---------|:------------:|:---------------------|
| **Containers** |||
O
ojw28 已提交
34 35 36 37
| FMP4                          | YES          | Demuxed streams only |
| WebM | YES | Demuxed streams only |
| Matroska | YES | Demuxed streams only |
| MPEG-TS | NO | No support planned |
O
ojw28 已提交
38
| **Closed captions/subtitles** |||
O
ojw28 已提交
39 40
| TTML | YES | Raw, or embedded in FMP4 according to ISO/IEC 14496-30 |
| WebVTT | YES | Raw, or embedded in FMP4 according to ISO/IEC 14496-30 |
O
ojw28 已提交
41 42 43 44 45 46
| Tx3g | YES | Embedded in FMP4 |
| SubRip | YES | Embedded in WebM |
| **Content protection**                  |||
| Widevine | YES | API 18 and higher |
| PlayReady SL2000                        | YES          | Android TV only      |

O
ojw28 已提交
47 48
### SmoothStreaming ###

O
ojw28 已提交
49 50
ExoPlayer supports SmoothStreaming with the FMP4 container format. Media streams must be demuxed,
meaning that video, audio and text must be defined in distinct StreamIndex elements in the
O
ojw28 已提交
51 52
SmoothStreaming manifest. The contained sample formats must also be supported (see the
[sample formats](#sample-formats) section for details).
O
ojw28 已提交
53 54 55 56

| Feature | Supported    | Comment              |
|---------|:------------:|:---------------------|
| **Containers**                          |||
O
ojw28 已提交
57
| FMP4                          | YES          | Demuxed streams only |
O
ojw28 已提交
58 59 60 61 62
| **Closed captions/subtitles**           |||
| TTML | YES | Embedded in FMP4 |
| **Content protection**                    |||
| PlayReady SL2000                        | YES          | Android TV only      |

O
ojw28 已提交
63 64
### HLS ###

O
ojw28 已提交
65
ExoPlayer supports HLS with the MPEG-TS, ADTS and MP3 container formats. The contained sample
O
ojw28 已提交
66 67 68
formats must also be supported (see the [sample formats](#sample-formats) section for details). Note
that we recommend using DASH (or SmoothStreaming) rather than HLS where possible. You can read about
some of the benefits of DASH
O
m  
Oliver Woodman 已提交
69
[here](https://medium.com/google-exoplayer/test-8b62d50362ef#.dlz6npay4).
O
ojw28 已提交
70 71 72 73 74 75 76 77 78 79 80 81 82 83

| Feature | Supported    | Comment              |
|---------|:------------:|:---------------------|
| **Containers**                          |||
| MPEG-TS                                 | YES          ||
| ADTS (AAC) | YES ||
| MP3 | YES ||
| **Closed captions/subtitles**           |||
| EIA-608 | YES ||
| WebVTT                                  | YES          ||
| **Metdata** |||
| ID3 metadata                            | YES          ||
| **Content protection**                  |||
| AES-128                                 | YES          ||
O
ojw28 已提交
84
| Sample AES-128 | NO ||
O
ojw28 已提交
85 86 87

## Standalone container formats ##

O
ojw28 已提交
88
Media files in the following container formats can be played directly by ExoPlayer. The contained
O
ojw28 已提交
89 90
sample formats must also be supported (see the [sample formats](#sample-formats) section for
details).
O
ojw28 已提交
91

O
ojw28 已提交
92 93 94 95 96 97 98
| Container format | Supported    | Comment              |
|------------------|:------------:|:---------------------|
| MP4 | YES ||
| FMP4 | YES ||
| WebM| YES ||
| Matroska| YES ||
| MP3 | YES ||
O
ojw28 已提交
99
| Ogg | YES | Containing Vorbis, Opus and Flac |
O
ojw28 已提交
100
| WAV | YES ||
O
ojw28 已提交
101 102 103 104
| MPEG-TS | YES | Not seekable* |
| MPEG-PS | YES | Not seekable* |
| FLV | YES | Not seekable* |
| ADTS (AAC) | YES | Not seekable* |
O
ojw28 已提交
105
| Flac | YES | Using the [Flac extension][] only |
O
ojw28 已提交
106

O
ojw28 已提交
107 108 109
\* Seeking is unsupported because the container does not provide metadata (e.g. a sample index) to
allow a media player to perform a seek in an efficient way. If seeking is required, we suggest using
a more appropriate container format.
O
ojw28 已提交
110 111 112

## Sample formats ##

O
ojw28 已提交
113
By default ExoPlayer uses Android's platform decoders. Hence the supported sample formats depend on
O
ojw28 已提交
114
the underlying platform rather than on ExoPlayer. Sample formats supported by Android devices are
O
ojw28 已提交
115
documented [here](https://developer.android.com/guide/appendix/media-formats.html#core). Note that
O
ojw28 已提交
116
individual devices may support additional formats beyond those listed.
O
ojw28 已提交
117 118 119 120 121 122 123

In addition to using Android's platform decoders, ExoPlayer can also make use of software decoder
extensions. These must be manually built and included in projects that wish to make use of them. We
currently provide software decoder extensions for
[VP9](https://github.com/google/ExoPlayer/tree/master/extensions/vp9),
[Flac](https://github.com/google/ExoPlayer/tree/master/extensions/flac) and
[Opus](https://github.com/google/ExoPlayer/tree/master/extensions/opus).
O
ojw28 已提交
124

O
ojw28 已提交
125
[Flac extension]: https://github.com/google/ExoPlayer/tree/master/extensions/flac