HLS Authoring Specification for Apple Devices
( go2sm.com/hls2017) that contains most of the
specifications relating to HEVC usage. The second are HLS examples provided by Apple at
go2sm.com/hlsexamples that fill in most of the
details missing from the Authoring Specification. For example, the Authoring Specification
states, “For backward compatibility some video content SHOULD be encoded with H.264.”
Apple’s examples show exactly which HEVC
and H.264 bitstreams Apple included in its HLS
presentation, as we’ll share with you below.
6. I Know How to Encode with H.264. What
Else Do I Need to Know to Produce HEVC?
If you understand H.264 encoding, you don’t
need to know much more to produce HEVC.
HEVC is a lot like H.264 and MPEG- 2 before it,
and most of what you know about data rates, key-frame intervals, bitrate control, and other common configuration options work very similarly.
Like H.264, HEVC has different profiles, two of
which are available for HLS—Main and Main 10.
As the name suggests, Main10 encodes in either
8-bit or 10-bit bit depths, while Main is 8-bit only.
HLS can handle either, though you’ll need to produce in Main 10 format for HDR output. Note that
the Authoring Specification has detailed rules
for bitrate control for live and VOD streams you
should learn if you’re new to HLS encoding.
Most encoders will have some kind of trade-off between complexity and quality. For example, the x265 codec uses the same presets as
x264 (ultra fast to placebo) while MainConcept
uses multiple levels from 1 to 30. Once you get
familiar with these controls for your codec/en-coder, you should be in good shape.
7. What Are the Requirements for HEVC?
The requirements fall into three rough
HEVC Encoded Files: The HLS Authoring
Specification states, “Profile, Level, and Tier for
HEVC MUST be less than or equal to Main10 Pro-
file, Level 5.0, High Tier.” Table 2 shows the lev-
el restrictions from the Wikipedia HEVC page
( go2sm.com/wikhevc) which details the level
and tier restrictions. Significantly, while you can
encode 1080p video at frame rates as high as 128
frames per second, 4K resolutions are restricted
to 30 fps or lower. Note that the HLS Authoring
Specification prohibits frame rates beyond 60
fps for all codecs.
Another notable requirement from the Authoring Specification is that “The container format for HEVC video MUST be fMP4,” or fragmented MP4 files, which means that MPEG- 2
transport streams are out. This should simplify delivering unencrypted HEVC encoded video to DASH and HLS clients since both should
be able to deploy the same bitstreams. In the
short term, differences between PlayReady
and FairPlay encryption schemes may prevent
interoperability of encrypted fMP4 content to
DASH and HLS end points, though Microsoft
has committed to resolving this for compatible
hardware devices in 2018 with the release of
PlayReady 4.0 ( go2sm.com/cmafunity).
The HLS Authoring Specification contains
two bitrate ladders, one for video files, the other for trick play files used for scrubbing and
scanning. The video bitrate ladder is included as Figure 4. Note that the suggested bitrate
ladder indicates that the frame rate for 2K and
4K resolutions be the same as source, which is
identical to all other resolutions down to 540p.
However, if you’re working with 60 fps 4K
source, the aforementioned Level 5 limitation
restricts you to 30 fps as shown in Table 2. Unfortunately, Apple hasn’t posted any HLS examples with 2K/4K videos, which might resolve this
seeming inconsistency. Until it is resolved, I recommend the conservative route and restricting
2K and 4K HEVC videos to 30 fps.
H.264 Encoded Files: As mentioned above,
the Authoring Specification requires that some
videos should be encoded with H.264, but provides no further guidance. So we looked at the
Level and Tier