HLS Authoring Update

Session 515 WWDC 2017

HTTP Live Streaming (HLS) reliably delivers video to audiences around the world. Key to this reliability is a comprehensive set of tools to help you author, deliver, and validate the HLS streams you create. See what's new in these tools, learn the latest authoring recommendations, and how they apply to advances in HLS such as support for HEVC and IMSC1.

Welcome, my name is Eryk Vershen, I'm am AVFoundation engineer at Apple.

This is session 515 which is about HLS authoring and the HLS tools.

HLS is an abbreviation for HTTP Live Streaming.

HLS is the way you stream content to all Apple devices.

I'm going to be talking about the document HLS Authoring Specification for Apple Devices and the tools we distribute for creating and validating HLS content.

The Authoring Specification and other important documents about HLS can be found at this URL developer.apple.com/streaming.

The Authoring Specification is Apple's advice for authoring HLS content.

We wanted the HLS specification, the Internet draft, to include only absolutely necessary requirements.

The Authoring Specification, on the other hand, includes requirements that are specific to Apple's players, as well as things that, while not absolutely required, are part of best practice.

The big news this year is we've added support for HEVC.

Here are the limits on what is playable.

Main 10 Profile, Level 5.0, High Tier.

Now that we support HEVC content we've added bit rate guidelines for that as well.

You should treat those recommendations as very preliminary.

HEVC encoders are still evolving, we expect to see improvements over time so we may revise our guidelines in the future.

You should also remember that the bit rate recommendations in the Authoring Specification are guidelines, they are not cast in stone.

We are aware that all content is different, a bit rate that works for a video of two people talking is not likely to work for a sporting event.

And you may have different constraints on the number of bit rate variants that you can provide.

So, use the bit rate guidelines as a starting point.

Having HEVC means that you can have both H.264 and HEVC content in the same master playlist.

So, we've come up with some best practices.

First and most important, always use the CODECS attribute.

You need this so that older players don't try to play the HEVC content.

Second and almost as important, always include some H.264 content.

You need this so older players will have something that they can play.

Now the player will switch between H.264 and HEVC.

However, for two variants with similar bit rates the player will typically favor the HEVC content.

While H.264 content could be in FMP4 files for maximum compatibility keep your H.264 in transport streams.

The last point I want to make is that these same rules apply to so-called trick play content, that is I-frame-only content.

Along with adding HEVC support we also added support for a second subtitle format, IMSC.

If you want more detail on our support for IMSC1 you should look at this year's Advances in HTTP Live Streaming talk.

IMSC1 is based on TTML, the timed text markup language and it's compatible with standards from the EBU and SMPTE.

Let's talk about best practices for subtitle content.

We support the text profile of IMSC and note that IMSC content must be in fragmented MP4 files, you can't use plaintext files.

WebVTT is the same as it has been, text files typically having an extension of .VTT or .webVTT.

Remember that you can mix up IMSC and webVTT with H.264 HEVC content however you want, they're completely independent.

You should always use the IMSC1 CODECS value.

Including that value ensures that older clients will ignore the variant.

However, for maximum backward compatibilities don't put in the value for the webVTT content.

I want to change gears and talk about the HLS tools and the changes we've made there.

The tools are available on the developer site and you can find them through the same URL I mentioned earlier, developer.apple.com/streaming.

The tools fall into three rough categories, tools for segmenting video and audio, tools for validating content and making validation reports and finally, tools for creating subtitles, iv3 metadata and master playlists.

Now the validator does not do low-level bitstream checks, you should be using third-party tools if you think you may have issues with your encoders.

Let's look at some of the specific changes we made in the tools.

Well firstly, we've added the ability for MediaStreamValidator to check local files.

You no longer have to put an HTTP server to validate your streams.

If you have direct file access you can check them that way and you can use relative paths, absolute paths or file URLs.

However, I should note that you can't mix file URLs and HTTP, that is if the master playlist is a file path then the media playlist it references can't be HTTP URLs.

Of course, we added support for HEVC into the tools.

We've also made a lot of general improvements to the tools, principally the MediaStreamValidator and HLS report.

We check more things about the stream.

There are too many to list, but for example, we're now validating the CODEC usage.

We have better handling for errors on the stream during validation.

And we made the ordering of variants renditions in the reports be more consistent.

We've added several new options, I want to call out just three of them.

First, the description option on MediaStreamValidator.

The URLs for a stream don't necessarily make clear what the content is.

This option allows you to add some text describing the stream.

For example, such and such show, season two, episode five.

The text will appear at the top of the report near the URL.

For HLS report, we've added some new optional columns.

Rather than continue the way we had previously with separate options for each column, instead we've added a columns option that takes a list of column and identifiers.

The set of available column identifiers can be found using the Help option or in the [inaudible] page.

The old id and pl options that gave you data id values and playlist bit rates are still supported, but are deprecated in favor of column identifiers.

And the column identifiers for those are just id and pl.

Last year we added hdcp-level support, but we forgot to tell you about the hdcp-level option on MediaFileSegmenter.

This allows you to set the hdcp-level.

The hdcp-level is included in the Plist that gets generated by MediaFileSegmenter.

And you can pass that Plist to the variant playlist creator to get the hdcp-level attribute in the generated master playlist.

Here's a quick look of a sample report.

Notice the second line, that's from the description option that we passed in MediaStreamValidator.

And notice that we've now added a CODECS column so you can see which variants are H.264 and HEVC.

Now we use the AVC, the alternate name of H.264 so that we'll have more visible separation between the two CODEC types.

As part of the changes in the ordering of variants and renditions, we now keep audio, closed caption and subtitle renditions separate.

To summarize, remember that URL, developer.apple.com/streaming, everything you need to know is pointed to from that page.

Besides the various documents it also has links to sample streams, to the tools download, to past videos about HLS, the information about FairPlay Streaming and so on.

I encourage you all to read the HLS Authoring Specification for Apple Devices and the HLS spec.

For more information go to the webpage for this talk, developer.apple.com/WWDC17/515.

We have some related video sessions, Advances in HTTP Live Streaming.

This has more discussion of HEVC and IMSC1, as well as some other interesting topics.

And Error Handling Best Practices for HTTP Live Streaming.

That will help you understand what your server needs to do to be a good HLS server.

You can watch either of these videos via the web or in the WWDC app.

I hope you found the talk useful, thanks for watching.

Apple, Inc. AAPL
1 Infinite Loop Cupertino CA 95014 US