Skip to navigation

Deliver H.265 alongside H.264

Set codecTier to “plus” so FastPix encodes your media in H.265 (HEVC) as well as H.264, from one playback URL, with no change for viewers who cannot decode H.265.

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 qualityBaselineAbout 25% smaller
Device supportPlays almost everywhereNewer devices and browsers
In FastPixAlways encodedAdded 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.

codecTierCodecs encoded
basic (default)H.264
plusH.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 for what each level includes.

Media qualityCodec tiers
standardH.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).
probasic, plus
premiumbasic, plus
custombasic, plus. Your organization’s ladder sets each rendition’s bitrate. See 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.


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:

{
"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:

{
"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):

#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 devicePlays
Safari on macOS, iOS, iPadOS, and tvOSH.265
Chrome and Edge on desktopH.265 where the device has hardware HEVC decoding, otherwise H.264
FirefoxUsually H.264
Android apps using ExoPlayer or Media3Often 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 devicesUsually 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:

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:

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

What is H.265 (HEVC)?

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.

Is H.265 better than H.264?

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.

Will H.265 break playback on devices that cannot decode it?

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

Do I need a new playback URL or player for H.265?

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.

Does H.265 work in Chrome and Safari?

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.

Can I add H.265 to a video I already uploaded?

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

Does plus cost more?

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

Can I deliver H.265 only?

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