SlideShare a Scribd company logo
1 of 33
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, cable, DVD, Blu-Ray “ It’s a bird…It’s a plane…It’s…Beauregard!” PCs QuickTime, Windows Media Player, VLC
Video is everywhere But how does it get there?
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
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
The Zen of video encoding
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
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
Constraints ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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 eventually displayed on the screen.” … and they cheat. A lot. And hope you won’t notice.
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 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
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
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 played through your speakers.” … and they cheat, too.
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 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
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
Captioning formats Just shoot me
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.
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?”
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
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 together in a single file.” … like a ZIP archive
Video metadata ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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
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.
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
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 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
Thank You! Q&A

More Related Content

Viewers also liked

Audio and video streaming
Audio and video streamingAudio and video streaming
Audio and video streamingRohan Bhatkar
 
7th Gen AMD A-Series Announcement
7th Gen AMD A-Series Announcement7th Gen AMD A-Series Announcement
7th Gen AMD A-Series AnnouncementKok Kee
 
NFV for beginners
NFV for beginnersNFV for beginners
NFV for beginnersDave Neary
 
NFV : Virtual Network Function Architecture
NFV : Virtual Network Function ArchitectureNFV : Virtual Network Function Architecture
NFV : Virtual Network Function Architecturesidneel
 

Viewers also liked (6)

Bgp (1)
Bgp (1)Bgp (1)
Bgp (1)
 
AMD FreeSync 2
AMD FreeSync 2 AMD FreeSync 2
AMD FreeSync 2
 
Audio and video streaming
Audio and video streamingAudio and video streaming
Audio and video streaming
 
7th Gen AMD A-Series Announcement
7th Gen AMD A-Series Announcement7th Gen AMD A-Series Announcement
7th Gen AMD A-Series Announcement
 
NFV for beginners
NFV for beginnersNFV for beginners
NFV for beginners
 
NFV : Virtual Network Function Architecture
NFV : Virtual Network Function ArchitectureNFV : Virtual Network Function Architecture
NFV : Virtual Network Function Architecture
 

Similar to A gentle introduction to video encoding [diveintomark]

Intro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for LearningIntro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for LearningNick Floro
 
Preserving Audiovisual Materials (LIS 198-Digital Preservation)
Preserving Audiovisual Materials (LIS 198-Digital Preservation)Preserving Audiovisual Materials (LIS 198-Digital Preservation)
Preserving Audiovisual Materials (LIS 198-Digital Preservation)Roy Santos Necesario
 
New Media Video Overview
New Media Video OverviewNew Media Video Overview
New Media Video Overviewtoddatmtsu
 
BD/BRrip, DVDrip, R5, PPVrip, TS, etc..
BD/BRrip, DVDrip, R5, PPVrip, TS, etc..BD/BRrip, DVDrip, R5, PPVrip, TS, etc..
BD/BRrip, DVDrip, R5, PPVrip, TS, etc..Steve Brown
 
what_is_a_codec_2010
what_is_a_codec_2010what_is_a_codec_2010
what_is_a_codec_2010Justin Giles
 
HTML5 Multimedia Accessibility
HTML5 Multimedia AccessibilityHTML5 Multimedia Accessibility
HTML5 Multimedia Accessibilitybrucelawson
 
02.m3 cms sys-req4mediastreaming
02.m3 cms sys-req4mediastreaming02.m3 cms sys-req4mediastreaming
02.m3 cms sys-req4mediastreamingtarensi
 
Streaming Media over the Internet
Streaming Media over the InternetStreaming Media over the Internet
Streaming Media over the InternetVideoguy
 
Introduction to Transcoding: Tools and Processes
Introduction to Transcoding: Tools and ProcessesIntroduction to Transcoding: Tools and Processes
Introduction to Transcoding: Tools and ProcessesPrestoCentre
 
12.m3 cms content-updating-pt3
12.m3 cms content-updating-pt312.m3 cms content-updating-pt3
12.m3 cms content-updating-pt3tarensi
 
Week 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information TechnologyWeek 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information TechnologyVideoguy
 

Similar to A gentle introduction to video encoding [diveintomark] (20)

video tools
video toolsvideo tools
video tools
 
Intro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for LearningIntro to Compression: Audio and Video Optimization for Learning
Intro to Compression: Audio and Video Optimization for Learning
 
Preserving Audiovisual Materials (LIS 198-Digital Preservation)
Preserving Audiovisual Materials (LIS 198-Digital Preservation)Preserving Audiovisual Materials (LIS 198-Digital Preservation)
Preserving Audiovisual Materials (LIS 198-Digital Preservation)
 
Encoding
EncodingEncoding
Encoding
 
Slide
SlideSlide
Slide
 
New Media Video Overview
New Media Video OverviewNew Media Video Overview
New Media Video Overview
 
BD/BRrip, DVDrip, R5, PPVrip, TS, etc..
BD/BRrip, DVDrip, R5, PPVrip, TS, etc..BD/BRrip, DVDrip, R5, PPVrip, TS, etc..
BD/BRrip, DVDrip, R5, PPVrip, TS, etc..
 
what_is_a_codec_2010
what_is_a_codec_2010what_is_a_codec_2010
what_is_a_codec_2010
 
Video Meets Documentation
Video Meets DocumentationVideo Meets Documentation
Video Meets Documentation
 
HTML5 Multimedia Accessibility
HTML5 Multimedia AccessibilityHTML5 Multimedia Accessibility
HTML5 Multimedia Accessibility
 
Codecs
CodecsCodecs
Codecs
 
02.m3 cms sys-req4mediastreaming
02.m3 cms sys-req4mediastreaming02.m3 cms sys-req4mediastreaming
02.m3 cms sys-req4mediastreaming
 
Codecs
CodecsCodecs
Codecs
 
Streaming Media over the Internet
Streaming Media over the InternetStreaming Media over the Internet
Streaming Media over the Internet
 
Introduction to Transcoding: Tools and Processes
Introduction to Transcoding: Tools and ProcessesIntroduction to Transcoding: Tools and Processes
Introduction to Transcoding: Tools and Processes
 
12.m3 cms content-updating-pt3
12.m3 cms content-updating-pt312.m3 cms content-updating-pt3
12.m3 cms content-updating-pt3
 
Video1 history concepts
Video1 history conceptsVideo1 history concepts
Video1 history concepts
 
Week 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information TechnologyWeek 4 LBSC 690 Information Technology
Week 4 LBSC 690 Information Technology
 
Dcp
DcpDcp
Dcp
 
Bigger Hard Drive Jamie Lean
Bigger Hard Drive Jamie LeanBigger Hard Drive Jamie Lean
Bigger Hard Drive Jamie Lean
 

Recently uploaded

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Recently uploaded (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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.
  • 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
  • 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.
  • 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