Sei sulla pagina 1di 67

Encoding H.

264 Video for


Streaming and Progressive
Download

Jan Ozer
www.streaminglearningcenter.com
jozer@mindspring.com/
276-238-9135

Agenda
z Generic encoding concepts
z Understanding H.264 encoding parameters
z Producing H.264 video for computers and devices
z Comparing the H.264 codecs
z Settings for common encoders
z Bonus subject: Producing for YouTube

1
Generic Encoding Parameters
z Terms and techniques
z Constant and variable bit rate encoding
z Delivery options
z Streaming
z Progressive download
z Multiple data rate delivery

Constant vs Variable Bit Rate


800 kbps VBR

500 kbps CBR

300 kbps

Low Motion Moderate Motion Low Moderate High


Motion Motion Motion

2
Constant vs Variable Bit Rate
z Constant Bit Rate (CBR)
z One bit rate applied to entire video,
irrespective of content
z Pros: Easy and fast
z Cons: Doesnt optimize quality

Constant vs Variable Bit Rate


z Variable Bit Rate (VBR)
z Dynamic bit rate matches motion in video
z Pros: Best quality
z Cons: Slow, can produce erratic stream

3
When Should I Use VBR/CBR?
z Consider VBR when:
z Clips are longer than 60 seconds too short, no
difference
z Producing for progressive download

When Should I Use VBR/CBR?


z Consider CBR when:
z In a hurry (or live encoding)
z Producing for streaming (as opposed to
progressive download to produce more
consistent stream)
z Restricted bandwidth delivery (e.g. cellular)

4
How do I Produce the Best
Quality CBR?

z Use 2-pass CBR when available


z Scans file (like VBR), but packs data into a
consistent stream
z Best of both worlds when available
z 1-pass of live or draft work

How Do I Produce the Optimal


VBR File?
z 2 passes or more
z Use Constrained
z Constrains to data rate
z Set Target and Max/Min
z Overall target 500 kbps
z Max/Peak bit rate how
high rate can go when
varying
z Rule of thumb is 1.5 - 2X of
target
z If minimum setting, use .5x

5
Delivery options

z Delivery options
z Streaming
z Progressive download
z Adaptive bitrate streaming
z HTTP vs. proprietary

Defining streaming
z What people think it is
z Video that plays immediately when you click and
smoothly to the end
z What it really is
z Video distributed via a streaming server
z May or may not be cached locally
z Whats a streaming server?
z Software other than web server dedicated solely
to distributing streaming video
z Flash Media Server, Wowza Media Server

6
Defining Progressive Download
z What people think it is
z trailers that take hours to download but then play
smoothly because theyre cached on your hard
drive.
z What it really is
z Video distributed from a web server rather than a
streaming server
z Video is typically stored locally (as in
progressively downloaded to hard drive)
z Most internet video is distributed via progressive
download (YouTube, ESPN, CNN, etc)

Delivery Mode Key Points


z If streaming
z Ask if there any server specific requirements
z Ask if cached on viewers computer
z If not, use data rate that ensures uninterrupted
delivery; otherwise, may never see a smooth playing
version
z usually produced with constant bit rate encoding
to produce a smooth stream

7
Delivery Mode Key Points
z If progressive
z May be some specific encoding requirements
(Fast Start for QuickTime, MOOV atom for Flash
z Produce at streaming rates to ensure responsive
user experience (most web sites)
z Or, produce at higher bit rates to ensure high
quality video
z Movie trailer scenario
z Usually encode with variable bit rate encoding (for
best quality)

Considering a Streaming
Server?
Pros Cons
z More secure stream z Cost
(not cached)
z Complexity
z Bandwidth negotiation
(dynamic streaming)
z Enables DRM
z More efficient
streaming (video doled
out rather than burst)
z Better statistics

8
Adaptive Bitrate Streaming
H.264
z Concept
z Customize file for viewer device and bandwidth
z Adapt to changing conditions
z Requires some intelligent component (server or player)
z Multiple options
z Adobes Dynamic Streaming (RTMP)
z Move Networks Adaptive Streaming (HTTP)
z Microsofts Smooth Streaming (HTTP)
z Apples HTTP Live Streaming
z H.264 Scalable Video Coding - HTTP (not here yet)
z Adobe HTTP streaming

Whats the Fuss About HTTP?


z Big protocol battle in large event streaming
space
z Flash dominant market share proprietary
streaming protocol
z Everyone else Microsoft, Move Networks, Apple
very small share but HTTP

9
HTTP Pros and Cons
z Pros: z Cons
z Fewer firewall issues z Less secure (cached
z Takes advantage of local locally)
caching z Initially less featured than
z More efficient, so s/b RTMP/RTSP
cheaper z Pause, seek, replay

z Less requirement for z DRM


streaming servers z DVR
z Again s/be cheaper z But HTTP services are
z Easier for CDNs to catching up
support z Players not ubiquitous
z Silverlight/Move

RTMP/RTSP Pros and Cons


z Pros: z Cons
z More secure (no local z More expensive
caching, more mature z No local caching
DRM) z Streaming servers
z Initially better featured required
z Flash Player is z CDN support is more
ubiquitous expensive

10
Availability
z Dynamic Streaming
z Now (VP6 and H.264)
z Smooth Streaming
z Now Silverlight 3 player (for H.264 compatibility)
z Adaptive Streaming (Move)
z VP6/7 today, H.264 coming
z Apple Live Streaming (primarily relevant for iPhone)
z Now
z HTTP to Flash
z First half of 2010
z Scalable Video Coding
z Down the road (1-2 years out)

About H.264
z Introduction to H.264
z Basic H.264 encoding parameters
z Producing H.264 for computer playback
z Producing H.264 for devices
z Comparing the H.264 encoders
z Producing H.264

11
What is H.264?

z Adapted by ISO and


ITU
z Telephony/cellular
z TV - consumer
electronics
z Computer electronics
z Only codec adopted by
top three streaming
providers (Apple,
Adobe, Microsoft)
Streamcrest Associates
http://www.streamcrest.com/SDF%20Final1.pdf

Whats H.264 Cost?


z MPEG-LA -
z For AVC video delivered via the Internet to an end user
who does not pay for the right to view, i.e., neither title-by-
title nor subscription, there will be no royalty through
December 31, 2010
z and after the first term the royalty shall be no more than the
economic equivalent of royalties payable during the same
time for free television.

12
H.264 Royalties Free TV
z One of two royalty options:
z (i) a one-time payment of $2,500 per AVC
transmission encoder (for each AVC encoder
used by Licensee in transmitting AVC video or
z (ii) annual fee per Broadcast Market
z $2.5K/year/market - 100K - 500K households,
z $5K/year/market - 500K 1M households
z $10K/year/market 1 M+

Impact
z Internet unique views of all H.264 video
z If under 100K, probably no royalty
z If > 100K, probably royalty
z Different internet sites might generate royalty
obligation
z Pod casts are definitely covered
z Intranet same deal, separate market
z If under 100K, probably no royalty
z If > 100K, probably royalty
z Either way:
z VC-1 same structure (and duplicative)

13
What is an MP4 file (and what
are the variants)?

z .MP4 - official MPEG-4 wrapper


z .M4V - Apples variant for iTunes
and devices
z .MOV - H.264 file for editing or
QuickTime delivery
z .F4V - H.264 for Flash
z .3GP - (not shown) - phone
z .MPG - H.264 in MPEG-2
transport stream
z W4M? - will Microsoft create a
new extension?

H.264 Encoding Parameters


z The basics
z Stream related options
z Search related options
z Miscellaneous options

14
Whats the Point?
z Typical encoding tool
gives you several H.264
encoding options
z Here we explain these
options, so you can
understand how to set
them later

H.264 Encoding - The Basics


z Profiles and Levels
z Entropy encoding

15
What are H.264 Profiles?
z Define a set of coding tools or algorithms
that can be used in generating a bitstream

Which Profile?

16
Which Profile?
z Critical to know your target profile before
encoding
z Device - iPod/iPhone - Always Baseline
z Computer playback - typically High
z QuickTime
z Flash - should be compatible with all relevant
profiles
z Silverlight ditto
z As youll see YouTubes 720p H264
implementation uses the High Profile

What are H.264 Levels?

z Constrains key parameters in the bitstream

17
H.264 Levels
z Primarily an issue when encoding for devices
z Must ensure that encoding parameters are within target
level (most templates do this); otherwise video wont play.
z For computer playback,
z All H.264 players can play ALL levels of ALL supported
profiles so not a playback-related issue
z The major concern is the playback performance of viewers
computer, not the level
z If level too low for selected encoding
parameters, just raise the level (Episode
does this automatically) to equal or
exceed parameters

Entropy Encoding

z CABAC (Context-adaptive binary arithmetic coding)


z More efficient (e.g. better quality), but harder to decode
z CAVLC (Context-adaptive variable-length coding)
z Less efficient, easier to decode
z Big question - does quality improvement outweigh
increase in required CPU horsepower

18
CABAC vs CAVLC Quality

z In challenging scenes, CABAC was noticeably better


z Most authorities place quality advantage at 10-15%

CABAC vs CAVLC
Performance
Playback 720p files CABAC CAVLC

HP 8710w - Core 2 duo (% of both 31.1% 30.5%


CPUs)
PowerMac - Dual 2.7 GHz PPC G5 (% of 71.17 67.34
1 processor)

z Does increase playback requirements slightly


on lower power computers
z My recommendation:
z CABAC - unless really concerned about low
power computers (schools, etc)

19
Reality Check - YouTube 720P
z High Profile
z CABAC
z 2 B-frames (not shown
in chart from another
analysis tool)
z 3 Reference frames
(ditto)

Configuration Lessons from


the Field
Profile CABAC
Cranky Geeks Main No
YouTube - H.264 High Yes
Apple battery video Main No
Facebook - high rez High Yes
Facebook - low rez High Yes

20
Deep Dive into H.264
Parameters
z Caveats:
z Presented differently by each encoding tool
z Only have time to cover most critical parameters
z To understand your encoder
z Read manual/help file to understand parameters
and their trade-offs; generally
z Encoding time vs. quality
z Complexity (and maybe encoding time) vs. quality
z Use MainConcept's reference encoder to
illustrate

General Options
z Frame coding
(progressive)
z Key frame interval
z 300
z Scene change
detection
z Bitrate
z CBR
z Insert data rate

21
What are I, B and P Frames?
z I-Frame - encoded
 
without reference to
other frames (also
called Key Frames)
z P - looks backward to
I and P frames
(predictive)
z B - looks forward and backward to previous I and P
frames (Bi-directional interpolated)
z No frames refer to B-Frame (most of the time)

What do I Need to Know About


Key Frames?
z Least efficient so largest (which is bad)
z But, key frames enhance interactivity
z All playback starts on a key frame
z When seeking to random frame,
must start playback at key frame
z Maximum interval should be 5-10
seconds
z Key frames "reset" quality:
z Useful at scene changes
z Enable natural key frames or key
frames at scene changes

22
What do I Need to Know About B
Frames?
z The most efficient frame
z So improves quality (comparisons to come)
z Hardest to decode
z Decoder has to have all referenced frames
in memory to decode B-frame
z Frame usually delivered out of order, which
also complicates playback

B-frames - Yes/No

23
B-frames - Yes/No

B-frames - Yes/No
z Noticeable quality improvement
z 5-10% increase in decompression CPU load
z Recommend
z Say YES to B-frames
z 2-3 is a good number for real world video
z Experiment with higher numbers with animations

24
Typical B-Frame Encoding
Parameters

z Number is number of B frames between I


and P-Frames; (IBBBPBBBPBBBPBBBP)
z 2 - 3 is recommended (I use 3)
z Reference frames
z Number of frames searched for redundancies
z 3-5 is recommended setting (I use 5)

Stream Structure
z B-Slices as references?
z Use B-frames as references for
B&P frames
 z Also called B-frame pyramidwhen
enabled as reference for B-frames
z Impact
z Potential quality improvement (more
redundancies)
z Potential increase in encoding time
z Potential increase in decode
complexity (more frames in RAM)

25
More B-frame Options
z Adaptive B-frame placement
z Overrides B-frame quantity
when necessary to improve
quality
z Like scene change
z Always enable
z Separate presentation of
Reference B-Pictures and
Pyramid B-frame encoding
z Never got cohesive explanation
z Say yes for max quality

Stream Structure
z Multiple Slices
z Divides image up into slices
z Benefit
z May speed encode on MP
systems
z May speed decode on MP
systems
z Downside
z May limit quality because limits
searches within slices
z My take generally 1 or 0
(depending upon the tool)

26
Search/Prediction Related
z In general, these manage the
trade-off between search
accuracy (and quality) and
search time
z Can improve quality
z Minimal (if any) impact on
required decompression

Search Shape
z Search shape is the size of
the macro block used for
searching redundancies
z 8x8 is slower but more
accurate than 16x16,
potentially delivering better
quality
z Use 8x8 unless in a huge
hurry

27
Sub-pixel Mode
z Sub-pixel mode
z Dictates depth of search
shape
z Full is faster but less accurate
z Quarter is slower but may
improve quality
z Use Quarter unless in a real
hurry

Motion Estimation (ME)


Algorithms
z Multi-reference Frame ME
/Sub-block ME
z Complex for quality (and
longer encoding time
z Fast for encoding speed and
less quality

28
Other Search-Related Options
z Rate distortion manages
quality/data rate trade-off
z Fast - heuristic optimization
thats faster, but can cause
quality loss
z Complex is slower, with better
quality
z Fast Intra/Inter Decisions
z Speed/quality trade-offs in
decision metrics

Search Related Quality


z Observations:
z Time differential can be +/- 50% on tested
encoders
z Quality difference was minimal on 2 of 3 tested
encoders. I recommend:
z Check the help file
Episode - help file says that settings beyond 50 typically
wont increase quality
Test at both extremes to ID time/quality difference
Apply to your unique encoding situation

29
Hadamard Transformation

z Enable/Disable Hadamard Transformation


z Encoding technique to improve compressed quality
z Yes - Better quality, longer encoding time
z HP xw8400 DP QC, one minute SD file
62 seconds with Hadamard enabled
60 seconds without
z No noticeable qualitative difference, but minimal affect
on encoding time
z Unless in a real hurry, opt yes

Deblocking Filter/Other

z Deblocking filter
z Minimizes blockiness, but extends encoding time and can
slow decompression
z Recommend - always enable (assume on by default with tools
that dont show this option)
z Encoding Speed vs. quality
z How encoder vendors combine multiple options into one
slider
z Varies by encoder/codec

30
H.264 Encoding Summary
z Profiles/Levels
- dictated by target
z Entropy Encoding - typically
CABAC
z Not available for Baseline
z B-frames - Use when available
z Not available for Baseline

Producing H.264 Video for


Computers and Devices
z Format specific considerations
z Flash
z QuickTime
z Silverlight
z Optimizing for computer playback
z Optimizing for devices

31
Flash and H.264
z Flash Player 9 Update 3 contained:
z Software H.264 decoder (Baseline/Main/High profiles)
z Not DivX, H.263 or Sorenson
z AAC decoder
z No special encoding requirements for the Flash Media
Server
z Flash player can play mp4, m4v, m4a, mov and .3gp
files
z Evolving best practice - FLV for VP6 and F4V for H.264

Producing for QuickTime


z Customizing for QuickTime
Streaming
z When distributing via a
streaming server, opt for
Hinted Streaming
z For progressive download,
use Fast Start -
Compressed Header
z Otherwise file may completely
download before playing

32
Producing for Silverlight 3
z File requirements
z Self-contained .mp4 (including .f4v and .m4a) and
.mov file formats
z Simple, Main, and High 4:2:0 profiles (progressive
only)
z AAC-LC audio mono or stereo (HE AAC will play back
with lower fidelity, as in QuickTime)
z Local files or http progressive download.
z Or, sliced another way, Silverlight 3 will play
pretty much all MPEG-4 files that would play
back well in both QuickTime and Flash.
http://blogs.iis.net/benwagg/archive/2009/03/18/silverlight-3-beta-what-s-new-for-media.aspx

Optimizing H.264 for Computer


Playback
z Perspective
z We understand H.264 encoding params
z We understand QuickTime/Flash specifics
z Now we learn how to configure a stream
that will smoothly play on the lowest
platform you care about

33
H.264 Playback - SD File

Dell HP xw4100 MacBook Dell Precision


Latitude Pro 390
1600 MHz 3.0 GHz P4 2.4 GHz 3.0 GHz Core 2
Pentium M with HTT Core 2 Duo Duo
SD Tests
H.264 - Main - tricked 88% 25% 29% 12%
out (QT Player)
H.264 Baseline (QT 80% 30% 19% 8%
Player)

H.264 Playback - 720p File

Dell HP xw4100 MacBook Dell


Latitude Pro Precision
390
1600 MHz 3.0 GHz 4 2.4 GHz 3.0 GHz
Pentium M with HTT Core 2 Duo Core 2 Duo
HD Tests
H.264 High 99% 78% 50% 28%
H.264 Baseline 100% 68% 58% 21%

34
H.264 Playback 1080p File

Dell HP xw4100 MacBook Dell


Latitude Pro Precision
390
1600 MHz 3.0 GHz P 4 2.4 GHz 3.0 Ghz Core
Pentium M with HTT Core 2 Duo 2 Duo
HD Tests
H.264 - Main - tricked 100% 69% 48% 40%
out (QT Player)
H.264 Baseline (QT 100% 79% 42% 26%
Player)

H.264 Compared to Other


Codecs
z 720p playback tests
z H.264 requires less CPU to playback than
VP6 or Silverlight
Flash H.264
Flash VP6E - High Silverlight
HP xw4100, 3.0 GHz P4 with HTT
Processor CPU during playback 54.6% 45.1% 52.5%
Drop frames Yes No No
HP 8710P, 2.2 GHz Core 2 Duo
Processor CPU during playback 51.9% 34.8% 47.3%
Drop frames No No No
Precision 390, 2.9 GHz Core 2 Duo
Processor CPU during playback 22.7% 7.7% 26.0%
Drop frames No No No

35
My Take on H.264 Quality
z H.264 produces better quality than VP6 or
VC-1
z If converting from either codec, you can use
the same encoding parameters with:
z No loss in quality
z No increase in required CPU on playback station

Lessons from the Field


The Good Width Height Total Frame Video Data Bits per pixel
Pixels Rate Rate
Cranky Geeks 640 360 230,400 29.97 500 0.072
YouTube - H.264 1280 720 921,600 29.97 2002 0.072
Apple battery video 848 480 407,040 29.97 1089 0.089
Facebook - high rez 1280 720 921,600 29.97 2463 0.089
Facebook - low rez 576 324 186,624 24 428 0.096
The Bad
McKinsey & Company 774 440 340,560 15 585 0.115
TED Talks (BMW) 432 240 103,680 24 351 0.141
Wal-Mart 640 426 272,640 29.97 1,538 0.188
MacBreak 640 360 230,400 24 1078 0.195
The Ugly
CNET 320 180 57,600 29.97 492 0.285
Government Tech News 320 240 76,800 29.97 739 0.321
Wine Library 640 480 307,200 29.97 4096 0.445

36
Bits Per Pixel
z In general
z .1 or lower should be fine
z .15 is very conservative; beyond that is a waste
z The larger the resolution, the lower you can go
z .1 @ 320x240 could be dicey
z .1 @ 720p should be fine
z Formula
z Data rate / (pixels x frame rate)

Bits Per Pixel


z Or, get MediaInfo

mediainfo.sourceforge.net/en

37
Producing for Computers
z Mind your format specific parameters
z Choose profile, resolution and other
parameters that ensure smooth playback on
your target
z Or, offer multiple files and let viewer decide which
to download
z In general, if youre converting over from another
codec, H.264 will be similar in quality and required
playback horsepower to other codecs

Optimizing for Devices


z Digesting iPod/iPhone Specs
z Lessons from iTunes
z Recommendations

38
iPod Specs
Original iPod iPod Nano iPod Classic iPod Touch/
(pre-5g) iPhone
Device resolution 320x240 320x240 320x240 480x320
Aspect Ratio 4:3 4:3 4:3 16:9-ish
Video codec H.264 H.264 H.264 H.264
Data rate 768 kbps 2.5 Mbps 2.5 Mbps 2.5 Mbps
Resolution 320x240 640x480 640x480 640x480
Frame rate 30 fps 30 fps 30 fps 30 fps
Profile Baseline Profile Baseline Profile Baseline Profile Baseline Profile
to Level 1.3 up to Level 3.0 up to Level 3.0 up to Level 3.0
Audio codec AAC-LC AAC-LC AAC-LC AAC-LC
Data rate 160 kbps 160 kbps 160 kbps 160 kbps
Audio parameters 48 kHz, stereo 48 kHz, stereo 48 kHz, stereo 48 kHz, stereo
Formats m4v/mp4/mov m4v/mp4/mov m4v/mp4/mov m4v/mp4/mov

Lessons from iTunes


z Best practices of current producers
z Downloaded and analyzed 50 podcasts from
iTunes
z Review standard encoding parameters
z Key mistakes that prevented podcasts from
playing on iPod
z Optimizing 16:9 video

39
Encoding Parameters - Video
Size Frame Codec Aspect Data Rate Extension Key
Rate H.264/ 4:3/ 16:9 mov/m4v/mp4 Frame
MPEG-4
Small 320x240 4 - 15f 22/2 20/5 (2 605K average 2/13/10 94 average
(25/44) 21 - 30f letterbox)

low - 83K low - 24


hi - 1.4 mbps hi - 300

Large 640x360+ 1-15f 18/1 13/6 1.281 mbps 2/11/5 121 average
(19/44) 4-24f average
14-30f
low - 813K low - 32
hi - 2 mbps hi - 300

Encoding Parameters - Audio


z All used Low Complexity AAC audio
z Average data rate - 116,000+
z Stereo/Mono - 42/2
z Low data rate - 32kbps/High - 160 kbps

40
Errors that Prevented
Playback
z Main or High Profile - 5
z Exceed data rate - 4 (high of 6.5 mbps)

z Exceed resolution - 2

z Wrong codec - 1 (Sorenson Video 3)

Note that there were some duplication of errors. A total of six


videos wouldnt load, including videos produced by HBO, E-
Online and Discovery Channel

Optimizing 16:9 Video


z If producing 16:9 video, note that:
z iPod Touch/iPhone is 16:9, all others 4:3
z At default configuration, 4:3 players will
display center cut, cutting off right and left
edges
z OK for many videos, but a potential
problem when critical content is on the
edge

41
Center-Cut - Screencam

Screencam action not visible in 4:3 display

Center-Cut - Real World Video

Oprah - logo cut off, but shot with 4:3 safe zones

42
When Producing 16:9 Video
z Shoot for center cut display (like Oprah)
z Or, instruct viewers to change default
playback parameters from center cut to
letterbox
z Videos > Settings > Fit to Screen > Off

Recommended Encoding
Parameters
320x240 640x4801

Video codec H.264 codec, Baseline H.264 codec, Baseline


profile profile

Data rate 768,000/CBR 1,120,000/CBR

Key frames 150 - 300 150 - 300

Frame rate match source match source

Audio AAC Low AAC Low

Data rate 128 kbps/stereo 128 kbps/stereo

Extension .mv4 .mv4

1 From Compressor

43
Comparing the H.264 Codecs
z Test description
z Apple, Dicas (Episode Pro), Main Concept
(Carbon Coder/Squeeze)
z Two files
z SD - 640x480@30 fps, 468/32, 2-pass VBR, highest
supported profile/quality options
z HD - 1280x720@30 fps, 800/128, 2-pass VBR,
highest supported profile/quality options

Test Description
z Still image quality
z Grab frames and compare
z Motion quality
z Compare quality during real time playback
z Look for motion artifacts like banding and
mosquitoes
z Smoothness
z Whether codec/encoder dropped frames at
selected parameters

44
HD Samples

z All codecs perform well with low motion footage

HD Samples

z Walking around (and panning) tends to separate the


contenders (note detail in curtain)

45
HD Samples

z Jumping further separates the contenders

HD Test Results

Apple Episode Dicas Main Concept

Still Quality 3 2 1
Motion Quality 2 1 1
Smoothness 1 1 1
Total 6 4 3

46
HD Test Analysis
z Difference between Dicas and Main Concept
is commercially irrelevant
z Viewers wouldnt notice absent side--by-side
comps (which, of course, they never have)
z Apples is much more significant
z Avoid if seeking highest quality at lowest bitrate
z At about 2.5 mbps, the quality is nearly the
equivalent of the others

SD Comparisons
z Still
z Motion
z Results
z Summary

47
SD Samples

z Low motion again easy

SD Samples

z Tai Kwon Do starts to separate again

48
SD Samples

z As does skating

SD Test Results

Apple Episode AME - Squeeze


Dicas Main Concept Main Concept

Still Quality 2 1 1 1
Motion Quality 2 1 1 1
Smoothness 1 1 1 1
Total 6 3 3 3

49
SD Test Analysis
z No meaningful difference between Dicas and
Main Concept in SD clips
z Apple again lagging
z Though fine for low volume SD production where
data rate isnt critical

What this means for encoding


tools
z Encoding tools follow codec
z Dicas/Main Concept
z MC slightly better in HD, but not commercially
significant
z Nearly identical in SD
z Apple
z OK choice for SD
z Avoid for HD when trying to achieve optimal data
rate

50
Settings for Common
Encoders
z Apple Compressor
z Adobe Media Encoder CS3
z Sorenson Squeeze
z Telestream Episode Pro
z Inlet Fathom

Apple Compressor -
Compression Settings
Compression Type:
Choose codec here

Key Frames:
-Choose Automatic to
select scene change
detection

Frame Reordering:
- Uncheck for Baseline
Profile
- Check for Main with 1 B
frame

Encoding: Optimized for:


-Best - multi-pass - Streaming: CBR
-Faster - single-pass - Download: VBR

51
Apple Compressor - Streaming
Related Settings
Streaming:
- None - disc based playback
- Fast start - Compressed
Header - web, no streaming
server
- Hinted Streaming: QuickTime
Streaming Server

Click here:

To open this:

Adobe Media Encoder - Format


Format:
- QuickTime for MOV extension

Format:
- FLV/F4V for Flash

Format:
-- H.264 for devices

52
AME - QuickTime Video

Codec:
- H.264

Set key Frame Distance:


Change to 300 (otherwise 30):

Click Frame Reordering to


enable B-frames

Click Set Bitrate to set bitrate

AME - QuickTime - Audio


Codec:
- H.264

Choose Sample Rate and


channels:

AME chooses the data rate

53
AME - Device
Format:
- Choose H.264

Then, choose device:

AME - Device - Video

Profile/Level:

Bitrate settings

Click Set key Frame Distance:


Otherwise 30

54
AME - Device - Audio

Choose AAC:

Basic audio parameters

Choose bitrate

Prioritize bitrate over


frequency

AME - Device Multiplexing

Click Multiplexer tab:


To access 3GPP or MP4
settings. MP4 has settings for
Standard, PSP and iPod

55
AME - Flash - Format

Format:
-Choose FLV|FV4

Click Format tab:


FLV for VP6, FV4 for H.264

AME - Flash - Video

Profile/Level:
Set to desired parameters

Set key Frame Distance


(otherwise 30):

56
AME - Flash - Audio

Codec:
Choose AAC

Normal parameters and


bitrate control

Sorenson Squeeze - Interface

z Template screen
z Format choices on
top
z Audio on the left
z Video on the right

57
Sorenson Squeeze - Basics

Format Constraints:

Stream Type:
- Hint or not hint

Codec:
Multiple H.264/MPEG-4
codecs; MainConcept is the
best (and the default in 5.0)

Sorenson Squeeze - Data Rate


and Key Frames

Max Data Rate:


Resolved key frame issue -
set to 200%

Set key Frame Distance


Enable Auto Key

58
Sorenson Squeeze - H.264
controls
Profile:
- Baseline/Main/High

Interlace Mode:
-Progressive (field order
grays out)

Encoding Effort:
Next slide

B-frames:
3 maximum

CABAC Coding: Slices:


Yes/no No impact on encoding time
on 8-core HP workstation

Sorenson Squeeze - Effort


Matters
z Assume amalgam of search functions
z Best produces noticeably better quality in
challenging scenes

Best: 63.23 to encode 1 minute file Fast: 48:34 to encode 1 minute file

59
Sorenson Squeeze

Audio Codec:

Use Coding Technologies


AAC for compatibility

Other parameters:

As normal

Episode Pro
z Output format
z Video settings
z Audio settings
z Switch using
tabs atop the
Job Batch
Window

Hint for streaming

60
Episode - Output Format

z MP4 or MOV?
z Both play in QuickTime Player
z Both play in Flash Player
z MP4 plays in more devices (e.g.
Zune)
z Recommend MP4

Episode - General
Natural and forced
ten seconds recommended

Recommended
technique unless
streaming (CBR)

Set average (target Frames searched


and Peak (2X) when creating
P/B frame (5 max
recommended)

B-frames 2-3
recommended

61
Episode - Profile and Quality
Display aspect ratio
use 1:1
Profile (Main or High
unless device)

Encoding
Entropy Encoding speed
(CABAC unless - settings
device) over 50
generally
show little
Use 2-pass unless improvement
draft work -I use 90

2-pass interval - set to max Only enable for


(number of frames searched Always use interlaced output
before encoding pass). deblocking filter

Episode - Advanced IDR frames


(use default)

1 slice (for max


quality)/may slow
encoding
Limit frame size
Initial buffer (dont enable)
fullness
(use default)

Blu-ray or
set top options Auto level

62
Episode - Audio

Audio: Set Bit rate (use Low


Complexity)

Press AAC Setting


Guidelines to open chart

Channels: Choose

Sample Rate : Make sure


within recommended sample
rate for bit rate setting

Inlet Fathom
z Provides full
control over
virtually all H.264
parameters
z No abstraction,
so great ability to
customize
encoding
parameters

63
Rhozet Carbon Coder
z Same paradigm
z Direct access to
critical parameters
z Minimal
abstraction

Encoding Tool Summary


z All present different parameters in different
ways
z Generally two trade-offs
z Trade encoding time for video quality
z Trade quality (and perhaps encoding time) for
decompression complexity
z Understand and categorize parameters, and
apply them to your unique situation

64
YouTubes Delivery Options
z The problem - no docs
z What they are

z Upload requirements

New HQ Mode - Compared


Low Quality High Quality HD

Codec Spark (H.263) Spark (H.263) H.264 (high)


Encoded Resolution 320x180 (16:9) 640x360 (16:9) 1280x720
320x240 (4:3) 480x360 (4:3)
Displayed resolution 480x360 640x360 853x480
Data rate 286 (16:9) 628 kbps 1.995 mbps
kbps
Frame rate 24 fps 24 fps 24 fps
Audio 64 kbps, stereo 96 kbps, mono 125 kbps stereo

65
Accessing HQ Mode
z Upload file with resolution of 480x360 or
higher
z Still 10 minute limit, which means max per second
data rate of 13 mbps
z New 1 GB limit for uploaded file

http://www.pcmag.com/article2/0,2817,2330990,00.asp

Accessing HD Mode
z Upload file with resolution of 720p
z Higher resolutions didnt convert to 720p
z Still 10 minute limit, which means max per second
data rate of 13 mbps
z New 1 GB limit for uploaded file

http://www.streaminglearningcenter.com/articles/18/1/YouTube-does-720P-HD-using-H264/Page1.html

66
Questions?
z Thanks for coming

67

Potrebbero piacerti anche