> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Deliver H.265 alongside H.264

Add H.265 (HEVC) to your videos by setting `codecTier` to `"plus"` when you create a media. FastPix then encodes each video in H.265 as well as H.264, and serves both from one playback URL. Players that can decode H.265 use it, and every other player uses H.264.

\


## Why use H.265

H.265 (HEVC) carries the same picture in fewer bytes than H.264. On typical content, an H.265 rendition is about a quarter smaller than the matching H.264 rendition at the same visual quality. For your viewers, that means faster startup and less rebuffering on mobile networks. For you, it means less data delivered.

H.264 is always included, so every device can still play your video.

\


## How H.265 compares to H.264

|                               | H.264 (AVC)             | H.265 (HEVC)                     |
| ----------------------------- | ----------------------- | -------------------------------- |
| File size at the same quality | Baseline                | About 25% smaller                |
| Device support                | Plays almost everywhere | Newer devices and browsers       |
| In FastPix                    | Always encoded          | Added when `codecTier` is `plus` |

You do not choose one or the other. With `codecTier: "plus"`, FastPix encodes both and each player picks the one it can decode.

\


## Choose a codec tier

The `codecTier` field decides which codecs FastPix encodes.

| codecTier         | Codecs encoded  |
| ----------------- | --------------- |
| `basic` (default) | H.264           |
| `plus`            | H.264 and H.265 |

> **Billing:** `plus` encodes both H.264 and H.265, and both are billed. `basic` encodes H.264 only.

### Supported media quality levels

`codecTier` works with the `mediaQuality` levels below. See [Configure media quality levels](/docs/video-on-demand/configure-media-quality-levels) for what each level includes.

| Media quality | Codec tiers                                                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `standard`    | H.264 only. `codecTier` is not supported, and a request that sends it is refused with HTTP 400 (`codecTier is not supported when mediaQuality is standard`).  |
| `pro`         | `basic`, `plus`                                                                                                                                               |
| `premium`     | `basic`, `plus`                                                                                                                                               |
| `custom`      | `basic`, `plus`. Your organization's ladder sets each rendition's bitrate. See [Set your own encoding ladder](/docs/video-on-demand/set-your-own-encoding-ladder). |

> **Note:** On `pro` and `premium`, each H.265 rendition has the same resolution and the same advertised bandwidth as its H.264 counterpart, and the H.265 rendition usually uses less data than that advertised bandwidth. On `custom`, you set a separate, lower H.265 bitrate for each rendition. See [Set your own encoding ladder](/docs/video-on-demand/set-your-own-encoding-ladder).

\


## Request H.265 when you create a media

Add `codecTier` next to `mediaQuality` in your create request. It works for both upload methods.

**Upload a video from a URL:**

```json
{
  "inputs": [
    {
      "type": "video",
      "url": "https://static.fastpix.com/fp-sample-video.mp4"
    }
  ],
  "accessPolicy": "public",
  "maxResolution": "1080p",
  "mediaQuality": "pro",
  "codecTier": "plus"
}
```

**Upload a video from a device:**

```json
{
  "corsOrigin": "*",
  "pushMediaSettings": {
    "accessPolicy": "public",
    "maxResolution": "1080p",
    "mediaQuality": "pro",
    "codecTier": "plus"
  }
}
```

> **Note:** `codecTier` is fixed when the media is created, like `mediaQuality`. To add H.265 to an existing video, create a new media from the same source file with `codecTier: "plus"`.

\


## What viewers get

The playback URL does not change: `https://stream.fastpix.com/{PLAYBACK_ID}.m3u8`.

Its HLS playlist lists every H.264 rendition first, then an H.265 rendition at each of the same resolutions. Each rendition declares its codec in the `CODECS` attribute (`avc1...` for H.264, `hvc1...` for H.265):

```text
#EXT-X-STREAM-INF:BANDWIDTH=2303080,CODECS="avc1.64001f,mp4a.40.2",RESOLUTION=1280x720,...
(the other H.264 renditions)
#EXT-X-STREAM-INF:BANDWIDTH=2303080,CODECS="hvc1.1.2.L93.80,mp4a.40.2",RESOLUTION=1280x720,...
(the other H.265 renditions)
```

Players read the `CODECS` attribute and pick a codec they can decode. They stay on that codec for the whole session and switch only between resolutions. A player that does not read `CODECS` starts on the first rendition, which is H.264.

### Which codec each player uses

| Player or device                               | Plays                                                                                                                                 |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Safari on macOS, iOS, iPadOS, and tvOS         | H.265                                                                                                                                 |
| Chrome and Edge on desktop                     | H.265 where the device has hardware HEVC decoding, otherwise H.264                                                                    |
| Firefox                                        | Usually H.264                                                                                                                         |
| Android apps using ExoPlayer or Media3         | Often H.264, even on phones that can decode H.265. Plays H.265 after you set a codec preference (see Prefer H.265 in an Android app). |
| Smart TVs, streaming sticks, and older devices | Usually H.264                                                                                                                         |

> **Note:** Test playback on the devices your viewers use before you switch your whole library.

\


## Prefer H.265 in an Android app

ExoPlayer and Media3 do not mix codecs in one session, and may stay on H.264 even on phones that can decode H.265. Tell the player to prefer H.265:

```kotlin
player.trackSelectionParameters = player.trackSelectionParameters
    .buildUpon()
    .setPreferredVideoMimeTypes(MimeTypes.VIDEO_H265, MimeTypes.VIDEO_H264)
    .build()
```

Phones that cannot decode H.265 still play H.264. Safari, AVPlayer on Apple devices, and current web players choose H.265 on their own.

\


## Limit playback resolution

The `maxResolution` query parameter on the playback URL applies to both codecs:

```text
https://stream.fastpix.com/{PLAYBACK_ID}.m3u8?maxResolution=1080p
```

\


## Limits

* **DRM:** `plus` is not available for DRM-protected media yet. A DRM media that asks for it fails.
* **MP4 downloads:** files made with `mp4Support` are H.264.
* **Thumbnails, GIFs, and storyboards:** unchanged.

\


#### Frequently asked questions

H.265, also called HEVC (High Efficiency Video Coding), is a video codec that stores the same picture in fewer bytes than H.264 (AVC). At FastPix, you add it by setting `codecTier` to `plus` when you create a media.

H.265 delivers the same visual quality in about 25% fewer bytes than H.264, so it saves bandwidth and starts faster on mobile networks. H.264 still plays on more devices, which is why FastPix always includes it alongside H.265.

No. Those devices play the H.264 renditions from the same playback URL.

No. The playback URL and the FastPix Player work as before. Android apps that use ExoPlayer or Media3 directly should prefer H.265, as shown above.

Safari plays H.265 on Apple devices. Chrome and Edge play it where the device has hardware HEVC decoding, and fall back to H.264 otherwise. Firefox usually plays H.264.

Not to the same media, because `codecTier` is set at creation. Create a new media from the same source file with `codecTier: "plus"`.

Yes. When `codecTier` is `plus`, encoding is charged for both H.264 and H.265.

No. H.264 is always included, so every viewer can play the video. To make a player use H.265, set its codec preference.

\


## What's next

* [Configure media quality levels](/docs/video-on-demand/configure-media-quality-levels): choose standard, pro, or premium.
* [Set your own encoding ladder](/docs/video-on-demand/set-your-own-encoding-ladder): control each rendition's resolution and bitrate.
* [Play your videos](/docs/video-on-demand/play-your-videos): deliver playback to any device.