A gentle(*) introduction to video encoding (*)for some definition of “gentle” Mark Pilgrim January 8, 2009
Video is everywhere Handhelds iPod, cell phone, PSP, Archos Internet YouTube, Daily Motion, Metacafe Television Broadcast,...
Video is everywhere But how does it get there?
Encoding process Source material (video + audio) Raw video Compressed video Demuxing  separates streams Encoding  compress...
Encoding process Source material (video + audio) Raw video Compressed video Single video file Raw audio Compressed audio T...
The Zen of video encoding
Elements of a video The  video container  holds it all together 4 The  caption format   defines when captions are displaye...
How to choose the right formats Pick a  video container  that works on your target platform 4 Pick a  caption format   tha...
Constraints <ul><ul><li>CPU capacity for encoding </li></ul></ul><ul><ul><li>CPU capacity for decoding and playing in real...
The Zen of video encoding “ There is no right or wrong; there is only what works and what doesn’t.”
Video codecs The wool pulled over your eyes to blind you from the truth
What is a video codec? “ A video codec defines the compression algorithm used to store the array of pixels that are eventu...
Acronym overload: video codecs Dirac Theora VC-1 WMV H.264 MPEG-4 ASP MPEG-2 MPEG-1 WTF? “ I could tell by the pixels…”
Common video codecs (*) As far as we know Source: Wikipedia No YouTube, Google Video MPEG WG H.263 HDTV broadcast Free Sof...
Video encoders Source: DigitalContentProducer.com, doom9.org, Wikipedia Adobe Premiere ffmpeg H.263 none none Windows Medi...
Audio codecs The hand is quicker than the ear
What is an audio codec? “ An audio codec defines the compression algorithm used to store the waveforms that are eventually...
Acronym overload: audio codecs DTS AC3 Vorbis WMA AAC MP3 MP2 AMR Seriously, WTF? “ Can you hear me now?”
Common audio codecs (*) As far as we know Source: Wikipedia No iPod, iTunes Store videos MPEG WG AAC Blu-Ray DVD Free Soft...
Audio encoders Sources: HydrogenAudio.org, Wikipedia iTunes, Nero FAAC AAC DTS, Inc. Dolby none Windows Media Encoder iTun...
Captioning formats Just shoot me
What is a captioning format? “ A captioning format defines when, where, and how captions for the hearing impaired are disp...
Acronym overload: caption formats DVD MP4TT SMIL SAMI ASS (really) SRT Teletext Line 21 Baby Jesus cries “ No, I can’t hea...
Overview of caption formats Source: Wikipedia DVD Stored as images DVD-Forum DVD Analog TV (Europe) custom BBC et. al. Tel...
Container formats … those should be simple, right?
What is a video container? “ A container format defines how video tracks, audio tracks, captions, and metadata are stored ...
Video metadata <ul><ul><li>Technical metadata </li></ul></ul><ul><ul><ul><li>How many video tracks? </li></ul></ul></ul><u...
Metadata matters Without human-readable metadata, the iTunes Store would look like this: Source: list of top movies from R...
Acronym overload: container formats EVO VOB ASF OGG FLV MP4 MKV AVI LOL One ring to rule them all, and in the darkness bin...
Overview of container formats (*) Seriously, some guys in Russia. They contributed it to the public domain, so technically...
Putting it all together Where’s the kaboom? There was supposed to be an Earth-shattering kaboom!
Common combinations Source: Wikipedia SAMI WMA WMV, VC-1 ASF Windows Kate Vorbis Theora OGG Linux QTTextTrack AAC H.264 MO...
Thank You! Q&A
Upcoming SlideShare
Loading in …5
×

A gentle introduction to video encoding [diveintomark]

22,103 views

Published on

From http://diveintomark.org/archives/2009/01/08/give-slides

3 Comments
35 Likes
Statistics
Notes
No Downloads
Views
Total views
22,103
On SlideShare
0
From Embeds
0
Number of Embeds
4,827
Actions
Shares
0
Downloads
454
Comments
3
Likes
35
Embeds 0
No embeds

No notes for slide
  • A gentle introduction to video encoding [diveintomark]

    1. A gentle(*) introduction to video encoding (*)for some definition of “gentle” Mark Pilgrim January 8, 2009
    2. Video is everywhere Handhelds iPod, cell phone, PSP, Archos Internet YouTube, Daily Motion, Metacafe Television Broadcast, cable, DVD, Blu-Ray “ It’s a bird…It’s a plane…It’s…Beauregard!” PCs QuickTime, Windows Media Player, VLC
    3. Video is everywhere But how does it get there?
    4. Encoding process Source material (video + audio) Raw video Compressed video Demuxing separates streams Encoding compresses streams Single video file Muxing combines streams again Raw audio Compressed audio
    5. Encoding process Source material (video + audio) Raw video Compressed video Single video file Raw audio Compressed audio Time-coded captions Hey, don’t forget about accessibility! Transcription
    6. The Zen of video encoding
    7. Elements of a video The video container holds it all together 4 The caption format defines when captions are displayed 3 The audio codec defines how waveforms are compressed 2 The video codec defines how the pixels are compressed 1
    8. How to choose the right formats Pick a video container that works on your target platform 4 Pick a caption format that works on your target platform 3 Pick a audio codec that works on your target platform 2 Pick a video codec that works on your target platform 1
    9. Constraints <ul><ul><li>CPU capacity for encoding </li></ul></ul><ul><ul><li>CPU capacity for decoding and playing in real time </li></ul></ul><ul><ul><li>Acceptable delay between recording and delivery </li></ul></ul><ul><ul><li>Acceptable quality degradation </li></ul></ul><ul><ul><li>Screen dimensions </li></ul></ul><ul><ul><li>Your bandwidth </li></ul></ul><ul><ul><li>My bandwidth </li></ul></ul><ul><ul><li>Hard limits on storage size (for physical media) </li></ul></ul><ul><ul><li>Video codec compatibility </li></ul></ul><ul><ul><li>Audio codec compatibility </li></ul></ul><ul><ul><li>Patent licensing costs </li></ul></ul><ul><ul><li>And on and on… </li></ul></ul>
    10. The Zen of video encoding “ There is no right or wrong; there is only what works and what doesn’t.”
    11. Video codecs The wool pulled over your eyes to blind you from the truth
    12. What is a video codec? “ A video codec defines the compression algorithm used to store the array of pixels that are eventually displayed on the screen.” … and they cheat. A lot. And hope you won’t notice.
    13. Acronym overload: video codecs Dirac Theora VC-1 WMV H.264 MPEG-4 ASP MPEG-2 MPEG-1 WTF? “ I could tell by the pixels…”
    14. Common video codecs (*) As far as we know Source: Wikipedia No YouTube, Google Video MPEG WG H.263 HDTV broadcast Free Software hippies Blu-Ray Microsoft world domination YouTube HD, iTunes, Blu-Ray Movie pirates DVD VCD Popular usage Yes* On2, Xiph.org Theora No Microsoft VC-1 Yes* BBC Dirac No Microsoft WMV No MPEG WG MPEG-2 No MPEG WG MPEG-1 No MPEG WG H.264 No MPEG WG MPEG-4 ASP Patent-free? Inventor Codec name
    15. Video encoders Source: DigitalContentProducer.com, doom9.org, Wikipedia Adobe Premiere ffmpeg H.263 none none Windows Media Encoder, Compressor, Squeeze Windows Media Encoder, Expression Encoder Adobe Media Encoder, Apple Compressor, On2 Flix Pro, Sorenson Squeeze, Telestream DivX, 3ivX Compressor, Sonic, TMPGEnc QuickTime Non-OSS tools oggenc, Thusnelda Theora none VC-1 dirac-research, Schroedinger Dirac none WMV ffmpeg, mpeg2enc MPEG-2 ffmpeg, MP1E MPEG-1 x264 H.264 ffmpeg, Xvid MPEG-4 ASP OSS tools Codec name
    16. Audio codecs The hand is quicker than the ear
    17. What is an audio codec? “ An audio codec defines the compression algorithm used to store the waveforms that are eventually played through your speakers.” … and they cheat, too.
    18. Acronym overload: audio codecs DTS AC3 Vorbis WMA AAC MP3 MP2 AMR Seriously, WTF? “ Can you hear me now?”
    19. Common audio codecs (*) As far as we know Source: Wikipedia No iPod, iTunes Store videos MPEG WG AAC Blu-Ray DVD Free Software hippies Microsoft world domination Music VCD, DVD, digital TV Ringtones, VoIP Popular usage No DTS Inc. DTS No Dolby AC3 Yes* Xiph.org Vorbis No MPEG WG MP2 No 3GPP AMR No Microsoft WMA No MPEG WG MP3 Patent-free? Owner Codec name
    20. Audio encoders Sources: HydrogenAudio.org, Wikipedia iTunes, Nero FAAC AAC DTS, Inc. Dolby none Windows Media Encoder iTunes Audio Transcoder, Easy CD-DA Extractor 3GPP reference encoder Non-OSS tools none DTS ffmpeg, Aften AC3 ffmpeg, aoTuV Vorbis TwoLAME MP2 ffmpeg, RetroCode AMR ffmpeg WMA LAME MP3 OSS tools Codec name
    21. Captioning formats Just shoot me
    22. What is a captioning format? “ A captioning format defines when, where, and how captions for the hearing impaired are displayed on screen while a video is playing.” … Some formats are reused for subtitles, translations, & commentary.
    23. Acronym overload: caption formats DVD MP4TT SMIL SAMI ASS (really) SRT Teletext Line 21 Baby Jesus cries “ No, I can’t hear you now. What else ya got?”
    24. Overview of caption formats Source: Wikipedia DVD Stored as images DVD-Forum DVD Analog TV (Europe) custom BBC et. al. Teletext Analog TV (US + Canada) pseudo-ASCII Electronic Industries Alliance Line 21 UTF-8 (multiple) (multiple) UTF-8 windows-1252 Encoding Windows Media Player MSDN page SAMI MP4 files, iTunes Store QuickTime (SMIL 1.0 only) AVI files, “fansubbing” AVI files, “fansubbing” Popular usage ISO 14966-17 MPEG-4 Timed Text A doom9.org forum post from 2004 SubRip W3C Recommendation SMIL Some Word document floating around the net Advanced SubStation Alpha Spec Caption format
    25. Container formats … those should be simple, right?
    26. What is a video container? “ A container format defines how video tracks, audio tracks, captions, and metadata are stored together in a single file.” … like a ZIP archive
    27. Video metadata <ul><ul><li>Technical metadata </li></ul></ul><ul><ul><ul><li>How many video tracks? </li></ul></ul></ul><ul><ul><ul><li>How many audio tracks? </li></ul></ul></ul><ul><ul><ul><li>How many caption tracks? </li></ul></ul></ul><ul><ul><ul><li>Where is everything within the file? (track IDs, byte ranges) </li></ul></ul></ul><ul><ul><li>Human-readable metadata </li></ul></ul><ul><ul><ul><li>Video title </li></ul></ul></ul><ul><ul><ul><li>Genre </li></ul></ul></ul><ul><ul><ul><li>Release date </li></ul></ul></ul><ul><ul><ul><li>MPAA rating </li></ul></ul></ul><ul><ul><ul><li>Cover art </li></ul></ul></ul>
    28. Metadata matters Without human-readable metadata, the iTunes Store would look like this: Source: list of top movies from RottenTomatoes.com $9.99 The.Chronicles.Of.Narnia.Prince.Caspian.2008.SciFi.Fantasy.720x480.02h29m.m4v $9.99 Smart.People.2008.Comedy.720x480.01h35m.m4v $9.99 Iron.Man.2008.Action.Adventure.720x480.02h42m.m4v $9.99 Kung.Fu.Panda.2008.Animation.Comedy.720x480.01h50m.m4v $9.99 WALL-E.2008.Animation.Action.Adventure.720x480.01h38m.m4v $9.99 Step.Brothers.2008.Comedy.720x480.01h45m.m4v $9.99 Wanted.2008.Action.Adventure.720x480.01h50m.m4v $9.99 Hancock.2008.Action.Adventure.720x480.01h42m.m4v
    29. Acronym overload: container formats EVO VOB ASF OGG FLV MP4 MKV AVI LOL One ring to rule them all, and in the darkness bind them.
    30. Overview of container formats (*) Seriously, some guys in Russia. They contributed it to the public domain, so technically you own it. Source: Wikipedia ffmpeg, MP4Box, mp4creator MPEG-LA .MP4, .M4V MPEG-4 ffmpeg Apple .MOV QuickTime ffmpeg, oggmux Xiph.org .OGG Ogg ffmpeg (in progress) Microsoft .ASF, .WMV Advanced Systems Format ffmpeg, AVIMux-GUI Microsoft .AVI Audio/Video Interchange ffmpeg, mkvtoolnix Some guys in Russia* .MKV Matroska ffmpeg Adobe .FLV Flash Video OSS tools Owner Extension Container Name
    31. Putting it all together Where’s the kaboom? There was supposed to be an Earth-shattering kaboom!
    32. Common combinations Source: Wikipedia SAMI WMA WMV, VC-1 ASF Windows Kate Vorbis Theora OGG Linux QTTextTrack AAC H.264 MOV Mac/QuickTime SRT, ASS MP3 MPEG-4 ASP AVI DVD pirates Blu-Ray subtitles (SUP) AC3, DTS H.264, VC-1 EVOB Blu-Ray SRT, ASS AC3, DTS H.264 MKV Blu-Ray pirates MP4 MP4 MP4 FLV VOB Container Custom, if any MP3 H.263 Flash 8 Line 21, DVD subtitles AC3 MPEG-2 DVD AAC+AC3 AAC AAC Audio MPEG-4 Timed Text H.264 iPod/iPhone MPEG-4 Timed Text Flash Timed Text Captions H.264 Flash 9+ H.264 AppleTV Video Platform/Audience
    33. Thank You! Q&A

    ×