Nothing Special   »   [go: up one dir, main page]

Adaptive With AME Slidedoc

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

ADOBE MEDIA ENCODER

Producing
Files for
Adaptive Apple Tech Note TN2224

Streaming
Adaptive streaming is the preferred technique for delivering video to a range of viewers on
varying devices and connections because it optimizes the experience for all viewers. In this
lesson, you’ll learn how to produce files for adaptive streaming with the Adobe Media
Encoder.

© Duarte,
© Jan Ozer
Inc. 2014 1
PRODUCING FILES FOR ADAPTIVE STREAMING

Overview

Producing for adaptive streaming involves


rendering multiple files from the same
source and distributing them to target Agenda
viewers depending upon their connection
speed and playback capabilities. In this 1. What adaptive streaming is and how it
chapter, you’ll learn how to determine the works
optimum number of files and how to
configure them. 2. RTMP and HTTP-based technologies,
and which the Adobe Media Encoder can
There are multiple adaptive streaming support
technologies, many of which Adobe Media
Encoder doesn’t currently support. You’ll 3. Producing adaptive streams
learn which alternatives the Adobe Media
Encoder does support, which it doesn’t, and
how to produce for unsupported
technologies in third party programs.
© Jan Ozer 2014 2
ADAPTIVE STREAMING

Create multiple files and customize delivery for bandwidth and device
capabilities

The first adaptive streaming technologies


You saw this slide in a previous lesson. For
required a streaming server, which cut off
review, adaptive streaming technologies produce
delivery if a viewer stopped watching,
multiple files at different data rates and
preserving unnecessary delivery bandwidth.
resolutions and deliver them depending upon the
Later technologies rely on the player to
viewer’s connection bandwidth and playback
retrieve video data as needed, so they are just
capabilities. Files are switched during playback
as bandwidth efficient but don’t require a
to adjust to changing conditions.
streaming server.
© Jan Ozer 2014 3
THE TWO TYPES OF ADAPTIVE STREAMING TECHNOLOGIES

RTMP-based Technologies HTTP-based Technologies

Distribution protocol: Distribution protocol:

• Uses the RTMP protocol to distribute • Uses the HTTP protocol to distribute
Technologies: Technologies:

• Adobe Flash Dynamic Streaming (RTMP) • Apple HTTP Live Streaming (HLS)
Encoding requirements: • Adobe HTTP-based Dynamic Streaming (HDS)
• Microsoft Smooth Streaming
• Standard MP4 files • Dynamic Adaptive Streaming over HTTP (DASH)
Encoding requirements:

• Segmented Audio/Video files and metadata files

HTTP-based technologies use segmented audio/video files and metadata files for operation. Adobe
Media Encoder doesn’t support these output types and can’t directly produce files to distribute
via these technologies. For these technologies, either produce MP4 files within Adobe Media Encoder
and process them in other tools like Apple’s Stream Segmenter, or encode your files and create the
segmented files in a third-party encoder like Apple Compressor or Sorenson Squeeze.

© Jan Ozer 2014 4


PRODUCING ADAPTIVE STREAMS

Configuration options to be explored in the next few sections

File configuration options Adaptive-specific encoding options

When producing for adaptive streaming, you There are also some adaptive-streaming-specific
have a number of file configuration decisions. encoding parameters that you need to consider.

• Number of streams – Deciding how • Key frame interval – typically much


many streams to produce shorter than when encoding for single files

• Resolution and data rate – Choosing • Bitrate control – Typically CBR is


the basic file configurations for those preferred, but not always
streams
• Audio settings – Some producers boost
• H.264 parameters – You’ll encode all audio quality with video; some keep them
files for adaptive streaming with H.264; the same for all streams.
but the configuration options will be
different than when encoding single files

© Jan Ozer 2014 5


HOW MANY SETS OF STREAMS?

Turner Broadcasting
Encoding configurations
for NBA League Pass

The first question is whether to produce a single producers use a single set of files for all targets,
set of streams for all targets, or a different group many based upon Apple Tech Note TN2224,
for each target. Separate groups would allow which presents Apple’s view of how a single set of
producers to use the High profile for all streams streams should be configured for mobile, desktop
targeted for computers and OTT devices, and the and OTT playback, the most encoding efficient
Baseline profile for older mobile devices. approach. This lesson assumes that you will
produce one group for all targets.
Many larger organizations, like Turner, create a
separate group for all three targets. Most smaller
© Jan Ozer 2014 6
HOW MANY STREAMS?

MTV Networks encoding


configurations for their
multiple properties

There are no hard and fast rules. You saw on the • Entertainment or business? Entertainment
previous slide that Turner used 5 streams for content typically has more streams.
computers, 6 for iPhones and 3 for OTT. As shown
above, MTV uses 2 for mobile and 6 for computers. • Subscription or free? Subscription content
Here are the factors you should consider when typically has more streams for a superior
choosing the number of streams. experience.

• SD or HD source? 3-4 works for SD, but • Number of window sizes on web page – You
you’ll need up to 11 or 12 for HD. need at least one stream for each playback
window size on your web page.

© Jan Ozer 2014 7


CHOOSING THE STREAM CONFIGURATIONS

Configure mobile first

Here’s TN2224. Start with


the mobile streams

Start with Apple Tech Note TN2224 as your guide If all else fails, just use Apple’s suggested
and configure your mobile streams first, as these configurations as shown above, particularly using
are the most challenging. the Baseline profile for low-end compatibility.

Decide the lowest bitrate stream that you want to Whenever practical, use a resolution displayed on
distribute--some clients I’ve worked with have used your web site for some of these lower quality
100 kbps for the video component. Then decide streams. For example, if your website has a
how many streams you want between that and your 320x180 video window, configure your lowest
lowest quality desktop stream. quality streams in that size so they can perform
double duty for desktop and mobile delivery.

© Jan Ozer 2014 8


CHOOSING THE STREAM CONFIGURATIONS
Then configure your desktop streams

MTV Networks encoding


configurations for their
multiple properties
ensures one stream for
each window size on their
various websites

MTV Networks encodes at least one stream for each window Also, unlike scaling to higher resolutions, which is usually
size on their website. That’s because encoding video in the handled by the graphics chip (or GPU), squeezing a file for
same resolution as the playback window is most efficient for playback is handled by the CPU, and is a very inefficient
both quality and playback efficiency. process that can cause slow playback or waste battery life.
Bottom line? Configure at least one stream for each window
If you configure a stream that must be squeezed down for size on your website.
playback, like a 640x360 stream played in a 480x270
window, you waste data to achieve the desired quality, since When configuring these streams, use the Baseline profile
you can encode a 480x270 stream at a lower data rate than for any streams that might be delivered to older mobile
a 640x360 file and achieve the same quality. devices. Check TN2224 for details.

© Jan Ozer 2014 9


CHOOSING THE STREAM CONFIGURATIONS

Then full screen and OTT streams – How much can you afford?

Here’s TN2224 again.


Choose the stream sizes
for full screen and OTT
playback.

It’s a fair bet that Apple has more cash than you do and then work backwards to the optimal
(har, har) so I wouldn’t take their high-end stream resolution. If you only can afford 3 Mbps, stop at
recommendations at face value. After all, 720p. If you can go to 5 Mbps, encode some
depending upon how much you’re paying for streams at 1080p and see if the quality is sufficient.
bandwidth, an 8.628 Mbps stream could cost as
much as $0.50 per hour to deliver-can you afford Mind Apple’s recommendations regarding H.264
that? profile; use Main for 720p streams, and High for
1080p.
So when configuring your highest quality streams,
figure out the most you can spend to deliver them,
© Jan Ozer 2014 10
WHAT DATA RATE?
TN2224 Video Bit Rate Recommendations

Choose data rates that


make a meaningful
difference in quality

The data rates that you select for your streams Accordingly, as shown in the table, the data
should make a meaningful difference in quality, rate differential should increase as resolutions
which means that the data rate difference will increase.
increase with the stream resolutions. In
TN2224, the 600 kbps difference between the In use, the best configuration is one that
two 640x360 streams represents a 100% quickly settles in on a single stream used
increase that will noticeably improve stream throughout playback. Resist the urge to deploy
quality. If the same 600 kbps difference was too many streams at data rates so close that
used between the two 720p streams, the impact there is no meaningful difference, leading to
would be much less noticeable, if at all. unnecessary stream switches.
© Jan Ozer 2014 11
ENCODING CONFIGURATION OPTIONS

What key frame interval Interval?

With the RTMP-based adaptive streaming that


Adobe Media Encoder directly supports, all
stream switches occur on a key frame; so all
files should be encoded using the same key
frame interval. With some encoders, you’d also
disable key frames at scene changes, which
Adobe Media Encoder doesn’t enable (more on
the next slide).

If you’re producing MP4 files for conversion


into an HTTP-based adaptive streaming format
like HLS, the key frame distance should also
divide evenly into the segment size, which is
beyond the scope of this discussion. The most
common configuration (and one recommended
by Apple in TN2224), is a key frame interval of
3 distributed in a 9second segment.
© Jan Ozer 2014 12
DANGER WILL ROBINSON!

The perils of not being able to disable scene change detection.

On the right is a file encoded by the Adobe Media


Encoder analyzed in Inlet Semaphore, a tool no longer
for sale. The red bars on the blue line beneath the time
scale are key frames. As you can see, Adobe Media
Encoder is inserting key frames at irregular intervals;
paging through the file and studying the Current Values
dialog reveals the extra key frames are at scene changes.

While a server-based technology like RTMP streaming


can probably work with these files, you may run into
problems with these files if submitted to a third party
segmenter. That’s because the irregular key frames
could result in a segment that doesn’t start with a key
frame, which is a requirement for all HTTP-based
adaptive technologies. Though I haven’t personally
experienced this problem, or heard about it from others,
I’d be concerned using MP4 files encoded with the
Adobe Media Encoder with a third-party segmenter.

© Jan Ozer 2014 13


ENCODING CONFIGURATION OPTIONS

What method of bitrate control? VBR or CBR?

CBR is most
conservative
The most conservative approach for bitrate
control when encoding for adaptive streaming is
constant bitrate encoding (CBR). This creates a
stream that is simpler to consistently deliver than
a variable bitrate (VBR) stream that may have
significant data rate spikes in some regions.

As we saw previously, however, CBR can produce


ugly frames. Many producers use constrained
VBR, with the maximum bitrate constrained to
125%-150% of the target. This gives the encoder
the flexibility to avoid ugly frames while
producing a relatively uniform stream for Or use VBR
constrained
consistent delivery.

© Jan Ozer 2014 14


ENCODING CONFIGURATION OPTIONS

What about audio parameters? TN2224 Audio Recommendations

Until the most recent version of TN2224, released in


February, 2014, Apple recommended using the same
audio parameters for all files in an adaptive group,
which meant that audio quality didn’t scale upwards
with video quality. The rationale was that changing
audio parameters within the files could lead to Keep these
popping artifacts during stream switches. the same

As you can see on the right, Apple has relaxed that


approach, and scales through three levels of audio
quality in its adaptive group. If you use this
approach, keep the per-channel sample rate and bit
depth the same in all files to minimize the potential
for popping artifacts.

So, make your low quality streams 64 kbps/44 kHz/


16-bit mono, and your higher quality streams 96 and Adjust
128 kbps/44 kHz/16-bit stereo. these
© Jan Ozer 2014 15
LESSON END

Summary

• In this lesson, you learned:


• What adaptive streaming is
• The single adaptive streaming technology Adobe
Media Encoder supports
• How to choose the optimal number of streams and
stream configurations
• How to customize encoding parameters when
encoding these streams

© Duarte,
© Jan Ozer
Inc. 2014 16

You might also like