<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Whatley &#187; Technology</title>
	<atom:link href="http://www.simonwhatley.co.uk/topic/tech/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mark Pilgrim &#8211; A Gentle Introduction to Video Encoding: Constraints</title>
		<link>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-constraints</link>
		<comments>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-constraints#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:00:05 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Audio codecs]]></category>
		<category><![CDATA[Codec]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[Flash Video]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mark Pilgrim]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[Real Networks]]></category>
		<category><![CDATA[Theora]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Video codecs]]></category>
		<category><![CDATA[web video market]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=4811</guid>
		<description><![CDATA[I had lunch with my father the other day, and I explained this series as well as I could to someone who didn't start programming when he was 11. His immediate reaction was, "Why are there so many different formats? Why can't everybody just agree on a single format? It is political, or technical, or both?" The short answer is, it's both. The history of video in any medium — and especially since the explosion of amateur digital video — has been marred by a string of companies who wanted to use container formats and video codecs as tools to lock content producers and content consumers into their little fiefdoms. Own the format, own the future. And when I say "history" — well, it's still going on.]]></description>
			<content:encoded><![CDATA[<p><strong>This article was first published on 8th January 2009, on Mark Pilgrim&#8217;s website. That website no longer exists so this article serves as an historical record. I have preserved all emphasis and links as per the original article.</strong></p>
<p>I had lunch with my father the other day, and I explained this series as well as I could to someone who didn&#8217;t start programming when he was 11. His immediate reaction was, &#8220;Why are there so many different formats? Why can&#8217;t everybody just agree on a single format? It is political, or technical, or both?&#8221; The short answer is, it&#8217;s both. The history of video in any medium — and especially since the explosion of amateur digital video — has been marred by a string of companies who wanted to use container formats and video codecs as tools to lock content producers and content consumers into their little fiefdoms. Own the format, own the future. And when I say &#8220;history&#8221; — well, it&#8217;s still going on. Tried to play a Windows Media Video on Mac OS X lately? The <a href="http://www.telestream.net/flip4mac-wmv/overview.htm" title="Codec and container support" target="_blank" rel="nofollow">codec and container support is out there</a>, but it&#8217;s not baked in. Want to watch <a href="http://www.apple.com/trailers/" title="Movie trailers on Apple.com" target="_blank" rel="nofollow">movie trailers on Apple.com</a>? Please install QuickTime. And so forth and so on. The only thing that was pre-installed on both platforms was Flash, so when a few startups dipped their toes into the Internet video waters, the ones that used Flash Video won despite it being an objectively inferior codec. (Some revision of Flash 9 added support for H.264 video, AAC audio, and the MP4 container, which is what <a href="http://www.youtube.com/browse?s=mphd&#038;c=0&#038;l=&#038;b=0" title="YouTube HD" target="_blank" rel="nofollow">YouTube HD</a> uses.)</p>
<p>So that&#8217;s the politics. But there are also technical barriers. As with all engineering, video encoding is primarily about constraints. I can think of 10 just off the top of my head:</p>
<ol>
<li><strong>CPU capacity for decoding and playing in real time</strong>. This is one of the most important constraints, since <em>video is meant to be watched in real time</em>. That sounds simple, but it&#8217;s incredibly complex. Every video you&#8217;ve ever watched in your entire life had to be decoded and played in real time. Otherwise it stutters and the viewing experience sucks. And we&#8217;re talking about video here; if the viewing experience sucks, there&#8217;s nothing left. Some codecs are just more complex than others, and that translates into higher system requirements to decode videos in real time. As I&#8217;ve mentioned before, some codecs are now decoded by specialized hardware. iPhones have a little chip inside them that understands H.264 Baseline Profile; without that, the iPhone would need a Core 2 Duo processor to play movies, and it would have a battery life of 10 minutes.</li>
<li><strong>Codec compatibility</strong>. Normal people won&#8217;t download codecs or plug-ins just to watch a dog on a skateboard, or even to watch a trailer for a $100 million blockbuster. (Sadly, they <em>will</em> download plug-ins for porn, but those are invariably trojan horses. Or so I&#8217;ve read. Moving on&#8230;) The phone in your pocket can probably play AMR ringtones, maybe MP3 ringtones, but probably not Vorbis ringtones (unless you have an Android phone) — and you probably couldn&#8217;t download new codecs even if you wanted to (which, I must reiterate, nobody wants to). Apple and Real Networks tried for <em>years</em> to corner the web video market, but 99% of schmucks with a browser have Flash, so Flash video won on the web. Meanwhile, Firefox 3.1 will ship with support for the <code>&lt;video&gt;</code> element but will only support Theora and Vorbis in an Ogg container — even if your underlying operating system ships with other codecs.</li>
<li><strong>CPU capacity for encoding</strong>. Encoding takes a long time. Taking my home movie from iMovie to a DVD used to take 8 hours on a Powerbook G4 laptop. These days you can rip a DVD movie with Xvid in 30 minutes, or you can rip it with a more complex codec with all optional features turned on, and maybe it&#8217;ll still take 8 hours. It&#8217;ll look better, but will it look 16 times better? If you&#8217;re only doing it once, maybe you don&#8217;t care. If you&#8217;re running YouTube and people are uploading 13 hours of video every minute, maybe you do. CPU cycles aren&#8217;t free; at that scale, they&#8217;re not even cheap. (That&#8217;s a real statistic, by the way; I got it from the page on the Google intranet entitled &#8220;What can we tell non-Googlers?&#8221; and it&#8217;s accurate as of September 2008.)</li>
<li><strong>Acceptable delay between recording and delivery</strong>. In my own experience, videos I&#8217;ve uploaded on YouTube are available within minutes, which is just mind-boggling when you consider the volume. If you&#8217;re re-encoding a live stream, even a few minutes delay is probably unacceptable. That means you&#8217;ll need a faster encoder, a less complex codec, or lower quality settings.</li>
<li><strong>Audience size</strong>. It&#8217;s not a big secret that lots of video on the Internet looks like crap. Partly that&#8217;s because the video uploader uploaded crappy video, but it&#8217;s also because most Internet videos are only watched by a few people, and it&#8217;s just not a worthwhile tradeoff to spend 8 hours re-encoding it. On the other hand, if you&#8217;re mastering a DVD that&#8217;ll get sold to 10 million people, you&#8217;ll probably use higher quality settings.</li>
<li><strong>Screen dimensions</strong>. DVDs can&#8217;t store high-def 1920 x 1080 video because the standard doesn&#8217;t allow for it, which makes perfect sense because it was designed around the screen resolution of standard-def TVs. Blu-Ray ups the limit, but there&#8217;s still a limit. Screen sizes vary more for PC video, but there will always be practical upper limits depending on your audience.</li>
<li><strong>My bandwidth</strong>. If you&#8217;re streaming or downloading video, some percentage of your audience is probably living in a third-world country like the United States, with limited broadband access, slow speeds, and monthly bandwidth caps. Larger file size = longer wait to play = fewer videos watched overall.</li>
<li><strong>Your bandwidth</strong>. Obviously every bit I download is a bit that you upload, and bandwidth ain&#8217;t free either. &#8220;When I get a little money I buy bandwidth; and if any is left I buy food and clothes.&#8221; Or something like that.</li>
<li><strong>Hard limits on storage size</strong>. As I mentioned before, physical media has upper limits on total size. Commercial DVDs can hold upwards of 9 GB, which seems like a lot but really isn&#8217;t. Blu-Ray maxes out at 50 GB, which seems like a lot but really isn&#8217;t.</li>
<li><strong>Patents / licensing costs</strong>. Did I mention that most popular video codecs are patent-encumbered? This is why <a href="http://commons.wikimedia.org/wiki/Commons:Media_help" title="Wikimedia uses Theora exclusively" target="_blank" rel="nofollow">Wikimedia uses Theora exclusively</a>, and why Firefox can ship a native Theora decoder and but won&#8217;t ever ship H.264.</li>
</ol>
<p>&#8230;and that&#8217;s the short list.</p>
<p>All of which leads me to the Zen of video encoding, which is this:</p>
<p>There is no right or wrong. There is only what works and what doesn&#8217;t.</p>
<p>If you can find even one combination of tools, delivery devices, and target platforms that satisfies your constraints and still accomplishes your goals, congratulations. You&#8217;re ahead of 99% of the people who&#8217;ve tried.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-constraints/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mark Pilgrim &#8211; A Gentle Introduction to Video Encoding: Captioning</title>
		<link>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-captioning</link>
		<comments>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-captioning#comments</comments>
		<pubDate>Thu, 13 Oct 2011 09:00:41 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[accessible online video]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[assistive technology]]></category>
		<category><![CDATA[AVI]]></category>
		<category><![CDATA[Container formats]]></category>
		<category><![CDATA[DirectShow-based video player]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[HDMI]]></category>
		<category><![CDATA[Joe Clark]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mark Pilgrim]]></category>
		<category><![CDATA[Microsoft Corporation]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[MPEG]]></category>
		<category><![CDATA[MPEG-4]]></category>
		<category><![CDATA[MPEG-4 Part 17]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[SAMI]]></category>
		<category><![CDATA[SMIL]]></category>
		<category><![CDATA[SubRip]]></category>
		<category><![CDATA[SubStation Alpha]]></category>
		<category><![CDATA[Subtitle]]></category>
		<category><![CDATA[Subtitling]]></category>
		<category><![CDATA[SubViewer]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[video player]]></category>
		<category><![CDATA[VSFilter]]></category>
		<category><![CDATA[YouTube]]></category>
		<category><![CDATA[YouTube Inc]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=4809</guid>
		<description><![CDATA[The first thing you need to know about captions and subtitles is that captions and subtitles are different. The second thing you need to know about captions and subtitles is that you can safely ignore the differences unless you're creating your own from scratch. I'm going to use the terms interchangeably throughout this article, which will probably drive you crazy if you happen to know and care about the difference.]]></description>
			<content:encoded><![CDATA[<p><strong>This article was first published on 7th January 2009, on Mark Pilgrim&#8217;s website. That website no longer exists so this article serves as an historical record. I have preserved all emphasis and links as per the original article.</strong></p>
<p>The first thing you need to know about captions and subtitles is that <a href="http://joeclark.org/access/captioning/bpoc/ST.html" title="Captions and subtitles are different" target="_blank" rel="nofollow">captions and subtitles are different</a>. The second thing you need to know about captions and subtitles is that you can safely ignore the differences unless you&#8217;re creating your own from scratch. I&#8217;m going to use the terms interchangeably throughout this article, which will probably drive you crazy if you happen to know and care about the difference.</p>
<p>Historically, captioning has been driven by the needs of deaf and hearing impaired consumers, and captioning technology has been designed around <a href="http://en.wikipedia.org/wiki/Closed_captioning#Television_and_video" title="The technical quirks of broadcast television" target="_blank" rel="nofollow">the technical quirks of broadcast television</a>. In the United States, so-called &#8220;<a href="http://main.wgbh.org/wgbh/pages/mag/services/captioning/faq/" title="Closed captions" target="_blank" rel="nofollow">closed captions</a>&#8221; are embedded into a part of the NTSC video source (&#8220;Line 21&#8243;) that is normally outside the viewing area on televisions. In Europe, they use a completely different system that is embeddable in the PAL video source. Over time, each new medium (VHS, DVD, and now online digital video) has dealt a blow to the accessibility gains of the previous medium. For example:</p>
<ul>
<li>PAL VHS tapes did not have enough bandwidth to store closed captions at all.</li>
<li>DVDs have the technical capability, but producers often manage to screw it up anyway; e.g. DVDs of low-budget television shows are often released without the closed captions that accompanied the original broadcast.</li>
<li>HDMI cables drop &#8220;Line 21&#8243; closed captions altogether. If you play an NTSC DVD on an HDTV over HDMI, you&#8217;ll never see the closed captions, even if the DVD has them.</li>
</ul>
<p>And <a href="http://joeclark.org/book/sashay/serialization/Chapter13.html" title="Accessible online video is hopeless" target="_blank" rel="nofollow">accessible online video is just fucking hopeless</a>. (And no, it won&#8217;t change <a href="http://www.alistapart.com/articles/thisishowthewebgetsregulated/" title="Unless new regulation forces a change" target="_blank" rel="nofollow">unless new regulation forces it to change</a>. When it comes to captioning, Joe Clark has been right longer than many of you have been alive.)</p>
<p>So even in broadcast television, captioning technology was fractured by different broadcast technologies in different countries. Digital video had the capability of unifying the technologies and learning from their mistakes. Of course, exactly the opposite happened. Early caption formats split along company lines; each major video software platform (RealPlayer, QuickTime, Windows Media, Adobe Flash) implemented captioning in their own way, with levels of adoption ranging from nil to zilch. At the same time, an entire subculture developed around &#8220;<a href="http://en.wikipedia.org/wiki/Fansub" title="Wikipedia: Fan-subbing" target="_blank" rel="nofollow">fan-subbing</a>,&#8221; i.e. using captioning technology to provide translations of foreign language videos. For example, non-Japanese-speaking consumers wanted to watch Japanese anime films, so amateur translators stepped up to publish their own English captions that could be overlaid onto the original film. In the 1980s, fansubbers would actually take VHS tapes and overlay the English captions onto a new tape, which they would then (illegally) distribute. Nowadays, translators can simply publish their work on the Internet as a standalone file. English-speaking consumers can have their DVDs shipped directly from Japan, and they use software players that can overlay standalone English caption files while playing their Japanese-only DVDs. The legality of distributing these unofficial translations (even separately, in the form of standalone caption files) <a href="http://www.nytimes.com/2005/08/21/arts/21solo.html" target="_blank" rel="nofollow">has been disputed in recent years</a>, but the fansubbing community persists.</p>
<p>Technically, there is a lot of variation in captioning formats. At their core, captions are a combination of text to display, start and end times to display it, information about where to position the text on a screen, fonts, styling, alignment, and so on. Some captions roll up from the bottom of the screen, others simply appear and disappear at the appropriate time. Some caption formats mandate where each caption should be placed and how it should be styled; others merely suggest position and styling; others leave all display attributes entirely up to the player. Almost every conceivable combination of these variables has been tried. Some forms of media try multiple combinations at once. DVDs, for example, can have two entirely distinct forms of captioning — closed captioning (as used in NTSC broadcast television) embedded in the video stream, and one or more subtitle tracks. DVD subtitle tracks are used for many different things, including subtitles (just the words being spoken, in the same language as the audio), captions for the hearing impaired (which include extra notations of background noises and such), translations into other languages, and director&#8217;s commentary. Oh, and they&#8217;re stored on the DVD as images, not text, so the end user has no control over fonts or font size.</p>
<p>Beyond DVDs, most caption formats store the captions as text, which inevitably raises the issue of character encoding. Some caption formats explicitly specify the character encoding, others only allow UTF-8, others don&#8217;t specify any encoding at all. On the player side, most players respect the character encoding if present (but may only support specific encodings); in its absence, some players assume UTF-8, some guess the encoding, and some allow the user to override the encoding. Obviously standalone caption files can be in any format, but if you want to embed your captions as a track within a video container, your choices are limited to the caption formats that the video container supports.</p>
<p>And remember when I said that there were a metric fuck-ton of audio codecs? Forget that. There are an imperial fuck-ton of caption formats (i.e. multiply by 9/5 and add 32). Here is a partial list of caption formats, taken from the list of formats supported by <a href="http://www.urusoft.net/products.php?cat=sw" title="Subtitle Workshop" target="_blank" rel="nofollow">Subtitle Workshop</a>, which I used to caption my short-lived video podcast series:</p>
<p>Adobe Encore DVD, Advanced SubStation Alpha, AQTitle, Captions 32, Captions DAT, Captions DAT Text, Captions Inc., Cheetah, CPC-600, DKS Subtitle Format, DVD Junior, DVD Studio Pro, DVD Subtitle System, DVDSubtitle, FAB Subtitler, IAuthor Script, Inscriber CG, JACOSub 2.7+, Karaoke Lyrics LRC, Karaoke Lyrics VKT, KoalaPlayer, MacSUB, MicroDVD, MPlayer, MPlayer2, MPSub, OVR Script, Panimator, Philips SVCD Designer, Phoenix Japanimation Society, Pinnacle Impression, PowerDivX, PowerPixel, QuickTime Text, RealTime, SAMI Captioning, Sasami Script, SBT, Sofni, Softitler RTF, SonicDVD Creator, Sonic Scenarist, Spruce DVDMaestro, Spruce Subtitle File, Stream SubText Player, Stream SubText Script, SubCreator 1.x, SubRip, SubSonic, SubStation Alpha, SubViewer 1.0, SubViewer 2.0, TMPlayer, Turbo Titler, Ulead DVD Workshop 2.0, ViPlay Subtitle File, ZeroG.</p>
<p>Which of these formats are important? The answer will depend on whom you ask, and more specifically, how you&#8217;re planning to distribute your video. This series is primarily focused on videos delivered as files to be played on PCs or other computing devices, so my choices here will reflect that. These are some of the most well-supported caption formats:</p>
<ul>
<li>SubRip</li>
<li>SubStation Alpha</li>
<li>MPEG-4 Timed Text</li>
<li>SAMI</li>
<li>SMIL</li>
</ul>
<h3>SubRip</h3>
<p><a href="http://en.wikipedia.org/wiki/SubRip" title="Wikipedia: SubRip" target="_blank" rel="nofollow">SubRip</a> is the AVI of caption formats, in the sense that its basic functionality is supported everywhere but various people have tried to extend it in mostly incompatible ways and the result is a huge mess. As a standalone file, SubRip captions are most commonly seen with a <code>.srt</code> extension. SubRip is a text-based format which can include font, size, and position information, as well as a limited set of HTML formatting tags, although most of these features are <a href="http://ale5000.altervista.org/subtitles.htm" target="_blank" rel="nofollow">poorly supported</a>. Its &#8220;official&#8221; specification is <a href="http://forum.doom9.org/showthread.php?p=470941#post470941" title="doom9 post from 2004" target="_blank" rel="nofollow">a doom9 forum post from 2004</a>. Most players assume that .srt files are encoded in Windows-1252 (what Windows programs frequently call &#8220;ANSI&#8221;), although some can detect and switch to UTF-8 encoding automatically.</p>
<p>Because <code>.srt</code> files are so often <a href="http://www.opensubtitles.org/en" title="Open Subtitles" target="_blank" rel="nofollow">published</a> separately from the video files they describe, the most common use case is to put your <code>.srt</code> file in the same directory as your video file and give them the same name (up to the file extensions). But it is also possible to embed SubRip captions directly into AVI files with <a href="http://www.alexander-noe.com/video/amg/" title="AVI-Mux GUI" target="_blank" rel="nofollow">AVI-Mux GUI</a>, into MKV files with <a href="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html" title="mkvmerge tool" target="_blank" rel="nofollow">mkvmerge</a>, and into MP4 files with <a href="http://gpac.sourceforge.net/packager.php" title="MP4Box" target="_blank" rel="nofollow">MP4Box</a>.</p>
<p>You can play SubRip captions in Windows Media Player or other DirectShow-based video players after installing <a href="http://www.videohelp.com/tools/VSFilter_DirectVobSub" title="VSFilter" target="_blank" rel="nofollow">VSFilter</a>; in QuickTime after installing <a href="http://www.perian.org/" title="Perian" target="_blank" rel="nofollow">Perian</a>; on Linux, both <a href="http://www.mplayerhq.hu/DOCS/HTML/en/index.html" title="mplayer" target="_blank" rel="nofollow">mplayer</a> and <a href="http://www.videolan.org/vlc/" title="VLC" target="_blank" rel="nofollow">VLC</a> support it natively.</p>
<h3>SubStation Alpha</h3>
<p><a href="http://en.wikipedia.org/wiki/SubStation_Alpha" title="Wikipedia: SubStation Alpha" target="_blank" rel="nofollow">SubStation Alpha</a> and its successor, Advanced SubStation Alpha, are the preferred caption formats of the fansubbing community. As standalone files, they are commonly seen with <code>.ssa</code> or <code>.ass</code> extensions. They have <a href="http://www.matroska.org/technical/specs/subtitles/ssa.html" target="_blank" rel="nofollow">a spec longer than three paragraphs</a>. They are actually miniature scripting languages. A <code>.ass</code> file contains a series of commands to control position, scrolling, animation, font, size, scaling, letter spacing, borders, text outline, text shadow, alignment, and so on; and a series of time-coded events for displaying text given the current styling parameters. It has support for multiple character encodings.</p>
<p>The playing requirements for SubStation Alpha captions are almost identical to SubRip. The same plugins are required for Windows and Mac OS X. On Linux, mplayer prides itself on having the most complete SSA/ASS implementation.</p>
<h3>MPEG-4 Timed Text</h3>
<p>a.k.a. &#8220;MPEG-4 Part 17,&#8221; a.k.a. <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39478" title="ISO 14496-17" target="_blank" rel="nofollow">ISO 14496-17</a>, <a href="http://en.wikipedia.org/wiki/MPEG-4_Part_17" title="Wikipedia: MPEG-4 Timed Text" target="_blank" rel="nofollow">MPEG-4 Timed Text</a> (hereafter &#8220;MP4TT&#8221;) is the one and only caption format for the MP4 container. It is not a file format; it is only defined in terms of a track within an MP4 container. As such, it can not be embedded in any other video container, and it can not exist as a separate file. (Note: the last sentence was a lie; the MPEG-4 Timed Text format is really the 3GPP Timed Text format, and it can very much be embedded in a 3GPP container. What I meant to say is that the format can not be embedded in any of the other popular video container formats like AVI, MKV, or OGG. I could go on about the subtle differences between MPEG-4 Timed Text in an MP4 container and 3GPP Timed Text in a 3GPP container, but it would just make you cry, and besides, technical accuracy is for pussies.)</p>
<p>MP4TT defines detailed information on text positioning, fonts, styles, scrolling, and text justification. These details are encoded into the track at authoring time, and can not be changed by the end user&#8217;s video player. The most readable description of its features is actually the <a href="http://gpac.sourceforge.net/doc_ttxt.php" title="Documentation for GPAC" target="_blank" rel="nofollow">documentation for GPAC</a>, an open source implementation of much of the MPEG-4 specification (including MP4TT). Since MP4TT doesn&#8217;t define a text-based serialization, GPAC invented one for their own use; since their format is designed to capture all the possible information in an MP4TT track, it turns out to be an easy way to read about all of MP4TT&#8217;s features.</p>
<p><a href="http://gpac.sourceforge.net/packager.php" title="MP4Box" target="_blank" rel="nofollow">MP4Box</a>, part of the GPAC project, can take an <code>.srt</code> file and convert it into a MPEG-4 Timed Text track and embed it in an existing MP4 file. It can also reverse the process — extract a Timed Text track from an MP4 file and output a <code>.srt</code> file.</p>
<p>On Mac OS X, QuickTime supports MP4TT tracks within an MP4 container, but only if you rename the file from <code>.mp4</code> to <code>.3gp</code> or <code>.m4v</code>. I shit you not. (On the plus side, changing the file extension will allow you to sync compatible video to an iPod or iPhone, which will actually display the captions. Still not kidding.) On Windows, any DirectShow-based video player (such as Windows Media Player or <a href="http://sourceforge.net/project/showfiles.php?group_id=205650" title="Media Player Classic" target="_blank" rel="nofollow">Media Player Classic</a>) supports MP4TT tracks once you install <a href="http://haali.cs.msu.ru/mkv/" title="Haali Media Splitter" target="_blank" rel="nofollow">Haali Media Splitter</a>. On Linux, VLC has supported MP4TT tracks for several years.</p>
<h3>SAMI</h3>
<p><a href="http://en.wikipedia.org/wiki/SAMI" title="SAMI" target="_blank" rel="nofollow">SAMI</a> was Microsoft&#8217;s first attempt to create a captioning format for PC video files (as opposed to broadcast television or DVDs). As such, it is natively supported by Microsoft video players, including Windows Media Player, without the need for third-party plugins. It has a <a href="http://msdn.microsoft.com/en-us/library/ms971327.aspx" title="Specification on MSDN" target="_blank" rel="nofollow">specification on MSDN</a>. It is a text-based format that supports a large subset of HTML formatting tags. SAMI captions are almost always embedded in an ASF container, along with Windows Media video and Windows Media audio.</p>
<p>Don&#8217;t use SAMI for new projects; it has been superceded by <a href="http://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language" title="Wikipedia: Synchronised Multimedia Integration Language (SMIL)" target="_blank" rel="nofollow">SMIL</a>. For historical purposes, you may enjoy reading about <a href="http://www.webaim.org/techniques/captions/windows/" title="Creating SAMI captions" target="_blank" rel="nofollow">creating SAMI captions and embedding them in an ASF container</a>, as long as you promise to never, ever try it at home.</p>
<h3>SMIL</h3>
<p><a href="http://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language" title="Wikipedia: Synchronised Multimedia Integration Language (SMIL)" target="_blank" rel="nofollow">SMIL</a> (Synchronized Multimedia Integration Language) is not actually a captioning format. It is &#8220;an XML-based language that allows authors to write interactive multimedia presentations.&#8221; It also happens to have a <a href="http://www.w3.org/TR/SMIL3/smil-timing.html" title="Timing and synchronisation module" target="_blank" rel="nofollow">timing and synchronization module</a> that can, in theory, be used to display text on a series of moving pictures. That is to say, if you think of SMIL as a way to provide captions for a video, you&#8217;re doing it wrong. You need to invert your thinking — your video and your captions are each merely components of a SMIL presentation. SMIL captions are not embedded into a video container; the video and its captions are referenced from a SMIL document.</p>
<p>SMIL is <a href="http://www.w3.org/AudioVideo/" title="W3C Standard" target="_blank" rel="nofollow">a W3C standard</a>; the most recent revision, <a href="http://www.w3.org/TR/SMIL3/" title="SMIL 3.0" target="_blank" rel="nofollow">SMIL 3.0</a>, was just published in December 2008. If you printed out the SMIL 3.0 specification on US-Letter-sized paper, it would weigh in at 395 pages. So don&#8217;t do that.</p>
<p>QuickTime supports a <a href="http://developer.apple.com/documentation/QuickTime/IQ_InteractiveMovies/quicktimeandsmil/chapter_10_section_1.html" title="Subset of SMIL 1.0" target="_blank" rel="nofollow">subset of SMIL 1.0</a>. WebAIM provides a nice <a href="http://www.webaim.org/techniques/captions/quicktime/" title="Tutorial on using SMIL to add captions to a QuickTime movie" target="_blank" rel="nofollow">tutorial on using SMIL to add captions to a QuickTime movie</a>.</p>
<p><strong>Further reading</strong></p>
<ul>
<li><a href="http://joeclark.org/book/sashay/serialization/Chapter13.html" title="Multimedia Accessibility" target="_blank" rel="nofollow">Multimedia Accessibility</a> (Joe Clark)</li>
<li><a href="http://www.webaim.org/techniques/captions/" title="Web Captioning Overview" target="_blank" rel="nofollow">Web Captioning Overview</a> (WebAIM)</li>
<li><a href="http://www.afterdawn.com/guides/archive/subtitle_formats_explained.cfm" title="Subtitle formats explained" target="_blank" rel="nofollow">Subtitle formats explained</a> (AfterDawn)</li>
<li><a href="http://www.opensubtitles.org/en/downloads" title="How to play subtitles" target="_blank" rel="nofollow">How to play subtitles</a> (OpenSubtitles)</li>
<li><a href="http://en.wikipedia.org/wiki/Subtitle_%28captioning%29" title="Wikipedia: Subtitle captioning" target="_blank" rel="nofollow">Subtitle (captioning)</a></li>
<li><a href="http://en.wikipedia.org/wiki/Closed_captioning" title="Wikipedia: Closed captioning" target="_blank" rel="nofollow">Closed captioning</a></li>
<li><a href="http://forum.doom9.org/showthread.php?t=62723" title="MP4 FAQ" target="_blank" rel="nofollow">MP4 FAQ</a> (doom9)</li>
<li><a href="http://help.youtube.com/support/youtube/bin/answer.py?answer=100077&#038;cbid=-evuehvvzg96r&#038;src=cb&#038;lev=answer" title="Adding and editing YouTube captions" target="_blank" rel="nofollow">Adding/editing captions on YouTube videos</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-captioning/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mark Pilgrim &#8211; A Gentle Introduction to Video Encoding: Lossy Audio Codecs</title>
		<link>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-lossy-audio-codecs</link>
		<comments>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-lossy-audio-codecs#comments</comments>
		<pubDate>Wed, 12 Oct 2011 09:00:18 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[AMR]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Audio codecs]]></category>
		<category><![CDATA[Audio file format]]></category>
		<category><![CDATA[AVI]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[Digital Theater System]]></category>
		<category><![CDATA[Dolby Digital]]></category>
		<category><![CDATA[Dolby Laboratories]]></category>
		<category><![CDATA[DTS]]></category>
		<category><![CDATA[DTS Inc .]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[lossless]]></category>
		<category><![CDATA[lossy]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mark Pilgrim]]></category>
		<category><![CDATA[MP3]]></category>
		<category><![CDATA[MPEG-1]]></category>
		<category><![CDATA[Musepack]]></category>
		<category><![CDATA[natively decoding core DTS]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[PBX]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Vorbis]]></category>
		<category><![CDATA[Windows Media Audio]]></category>
		<category><![CDATA[WMA]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=4807</guid>
		<description><![CDATA[Unless you're going to stick to films made before 1927 or so, you're going to want an audio track. A future article will talk about how to pick the audio codec that's right for you, but for now I just want to introduce the concept and describe the playing field. (This information is likely to go out of date quickly; future readers, be aware that this was written in December 2008.)]]></description>
			<content:encoded><![CDATA[<p><strong>This article was first published on 30th December 2008, on Mark Pilgrim&#8217;s website. That website no longer exists so this article serves as an historical record. I have preserved all emphasis and links as per the original article.</strong></p>
<p>Unless you&#8217;re going to stick to films made before <a href="http://www.filmsite.org/jazz.html" title="Films made before 1927 or so" target="_blank" rel="nofollow">1927 or so</a>, you&#8217;re going to want an audio track. A future article will talk about how to pick the audio codec that&#8217;s right for you, but for now I just want to introduce the concept and describe the playing field. (This information is likely to go out of date quickly; future readers, be aware that this was written in December 2008.)</p>
<p>Like video codecs, <em>audio codecs</em> are algorithms by which an audio stream is encoded. Like video codecs, there are <em>lossy</em> and <em>lossless</em> audio codecs. Today&#8217;s article will only deal with lossy audio codecs. Actually, it&#8217;s even narrower than that, because there are different categories of lossy audio codecs. Audio is used in many places where video is not (telephony, for example), and there is an entire category of <a href="http://www.voip-info.org/wiki-Codecs" title="Audio codecs optimised for encoding speech" target="_blank" rel="nofollow">audio codecs optimized for encoding speech</a>. You wouldn&#8217;t rip a music CD with these codecs, because the result would sound like a 4-year-old singing into a speakerphone. But you <em>would</em> use them in an <a href="http://www.asterisk.org/" title="Asterisk PBX" target="_blank" rel="nofollow">Asterisk</a> PBX, because bandwidth is precious, and these codecs can compress human speech into a fraction of the size of general-purpose codecs.</p>
<p>And that&#8217;s all I have to say about speech-optimized audio codecs. Onward&#8230;</p>
<p>As I mentioned in part 2: lossy video codecs, when you &#8220;watch a video,&#8221; your player software is doing several things at once:</p>
<ol>
<li>Interpreting the container format</li>
<li>Decoding the video stream</li>
<li>Decoding the audio stream and sending the sound to your speakers</li>
<li>Possibly decoding the subtitle stream as well. (Tomorrow&#8217;s article will be all about subtitle formats! I can hardly wait!)</li>
</ol>
<p>The <em>audio codec</em> specifies how to do #3 — decoding the audio stream and turning it into digital waveforms that your speakers then turn into sound. As with video codecs, there are all sorts of tricks to minimize the amount of information stored in the audio stream. And since we&#8217;re talking about <em>lossy</em> audio codecs, information is being lost during the recording → encoding → decoding → listening lifecycle. Different audio codecs throw away different things, but they all have the same purpose: to trick your ears into not noticing the parts that are missing.</p>
<p>One concept that audio has that video does not is <em>channels</em>. We&#8217;re sending sound to your speakers, right? Well, how many speakers do you have? If you&#8217;re sitting at your computer, you may only have two: one on the left and one on the right. My desktop has three: left, right, and one more on the floor. So-called &#8220;<a href="http://en.wikipedia.org/wiki/Surround_sound" title="Wikipedia: Surround sound" target="_blank" rel="nofollow">surround sound</a>&#8221; systems can have six or more speakers, strategically placed around the room. Each speaker is fed a particular <em>channel</em> of the original recording. The theory is that you can sit in the middle of the six speakers, literally surrounded by six separate channels of sound, and your brain synthesizes them and feels like you&#8217;re in the middle of the action. Does it work? A multi-billion-dollar industry seems to think so.</p>
<p>Most general-purpose audio codecs can handle two channels of sound. During recording, the sound is split into left and right channels; during encoding, both channels are stored in the same audio stream; during decoding, both channels are decoded and each is sent to the appropriate speaker. Some audio codecs can handle more than two channels, and they keep track of which channel is which and so your player can send the right sound to the right speaker.</p>
<p>There are <em>lots</em> of audio codecs. Did I say there were lots of video codecs? Forget that. There are <a href="http://wiki.multimedia.cx/index.php?title=Category:Audio_Codecs" title="Audio codecs" target="_blank" rel="nofollow">a metric fuck-ton of audio codecs</a>. These are the ones you need to know about:</p>
<ul>
<li>MPEG-1 Audio Layer 3</li>
<li>Advanced Audio Coding</li>
<li>Windows Media Audio</li>
<li>Vorbis</li>
<li>Dolby Digital</li>
<li>Digital Theater System</li>
</ul>
<h3>MPEG-1 Audio Layer 3</h3>
<p><a href="http://en.wikipedia.org/wiki/MPEG-1_Audio_Layer_3" title="Wikipedia: MPEG-1 Audio Layer 3" target="_blank" rel="nofollow">MPEG-1 Audio Layer 3</a>&#8230;colloquially known as &#8220;MP3.&#8221; If you haven&#8217;t heard of MP3s, I don&#8217;t know what to do with you. <a href="http://www.walmart.com/catalog/catalog.gsp?cat=96469" title="Walmart portable music players" target="_blank" rel="nofollow">Walmart sells portable music players</a> and calls them &#8220;MP3 players.&#8221; <em>Walmart</em>. Anyway&#8230;</p>
<p>MP3s can contain <strong>up to 2 channels</strong> of sound. They can be encoded at different <em>bitrates</em>: 64 kbps, 128 kbps, 192 kbps, and a variety of others from 32 to 320. Higher bitrates mean larger file sizes and better quality audio, although the ratio of audio quality to bitrate is not linear. (128 kbs sounds more than twice as good as 64 kbs, but 256 kbs doesn&#8217;t sound twice as good as 128 kbs.) Furthermore, the MP3 format allows for <em>variable bitrate encoding</em>, which means that some parts of the encoded stream are compressed more than others. For example, silence between notes can be encoded at a very low bitrate, then the bitrate can spike up a moment later when multiple instruments start playing a complex chord. MP3s can also be encoded with a constant bitrate, which, unsurprisingly, is called <em>constant bitrate encoding</em>.</p>
<p>The MP3 standard doesn&#8217;t define exactly how to encode MP3s (although it does define exactly how to decode them); different encoders use different psychoacoustic models that produce wildly different results, but are all decodable by the same players. The open source <a href="http://lame.sourceforge.net/" title="LAME Project" target="_blank" rel="nofollow">LAME project</a> is the best free encoder, and arguably the best encoder period for all but the lowest bitrates.</p>
<p>The MP3 format was standardized in 1991 and <strong>is patent-encumbered</strong>, which explains why Linux  can&#8217;t play MP3 files out of the box. Pretty much every portable music player supports standalone MP3 files, and MP3 audio streams can be embedded in any video container. Adobe Flash can play both standalone MP3 files and MP3 audio streams within an MP4 video container.</p>
<h3>Advanced Audio Coding</h3>
<p><a href="http://en.wikipedia.org/wiki/Advanced_Audio_Coding" title="Advanced Audio Coding (AAC)" target="_blank" rel="nofollow">Advanced Audio Coding</a>&#8230;affectionately known as &#8220;AAC.&#8221; Standardized in 1997, it lurched into prominence when Apple chose it as their default format for the iTunes Store. Originally, all AAC files &#8220;bought&#8221; from the iTunes Store were encrypted with Apple&#8217;s proprietary DRM scheme, called <a href="http://en.wikipedia.org/wiki/FairPlay" title="Wikipedia: FairPlay" target="_blank" rel="nofollow">FairPlay</a>. Many songs in the iTunes Store are now available as unprotected AAC files, which Apple calls &#8220;iTunes Plus&#8221; because it sounds so much better than calling everything else &#8220;iTunes Minus.&#8221; <strong>The AAC format is patent-encumbered</strong>; <a href="http://www.vialicensing.com/Licensing/AAC_fees.cfm" title="Licensing fees" target="_blank" rel="nofollow">licensing rates are available online</a>.</p>
<p>AAC was designed to provide better sound quality than MP3 at the same <em>bitrate</em>, and it can encode audio at any bitrate. (MP3 is limited to a fixed number of bitrates, with an upper bound of 320 kbs.) AAC can encode <strong>up to 48 channels of sound</strong>, although in practice no one does that. The AAC format also differs from MP3 in defining multiple <em>profiles</em>, in much the same way as H.264, and for the same reasons. The &#8220;low-complexity&#8221; profile is designed to be playable in real-time on devices with limited CPU power, while higher profiles offer better sound quality at the same bitrate at the expense of slower encoding and decoding.</p>
<p>All current Apple products, including iPods, AppleTV, and QuickTime support certain profiles of AAC in standalone audio files and in audio streams in an MP4 video container. Adobe Flash supports all profiles of AAC in MP4, as do the open source mplayer and VLC video players. For encoding, the FAAC library is the open source option; support for it is a compile-time option in mencoder and ffmpeg. (I&#8217;ll dive into all the different encoding tools in a future article.)</p>
<h3>Windows Media Audio</h3>
<p><a href="http://en.wikipedia.org/wiki/Windows_Media_Audio" title="Wikipedia: Windows Media Audio (WMA)" target="_blank" rel="nofollow">Windows Media Audio</a>&#8230;a.k.a. &#8220;WMA.&#8221; As you might guess from the name, Windows Media Audio was developed by Microsoft. The acronym &#8220;WMA&#8221; has historically referred to many different things: a lossless audio codec (&#8220;WMA Lossless&#8221;), a speech-optimized codec (&#8220;WMA Voice&#8221;), and several different lossy audio codecs (&#8220;WMA 1,&#8221; &#8220;WMA 2,&#8221; &#8220;WMA 7,&#8221; &#8220;WMA 8,&#8221; &#8220;WMA 9,&#8221; and &#8220;WMA Pro&#8221;). It is also (incorrectly) used to refer to the Advanced Systems Format, because WMA-encoded audio streams are usually embedded in an ASF container. Roughly speaking, the lossy audio codecs (WMA 1-9) compete with MP3 and low-complexity AAC; WMA Lossless competes with Apple Lossless and FLAC; WMA Pro competes with high-complexity AAC, Vorbis, AC-3, and DTS.</p>
<p>All the different codecs under the &#8220;WMA&#8221; brand are playable with Windows Media Player, which comes pre-installed on desktops and laptops running Microsoft Windows XP and Vista. Portable devices like the Zune and the ironically named &#8220;PlaysForSure&#8221; devices can play WMA 1-9; stores that allow you to &#8220;purchase&#8221; WMA files generally encrypt them with a Microsoft-proprietary DRM scheme. The open source ffmpeg project can play WMA 1-9, and <a href="http://www.flip4mac.com/" title="Flip4Mac" target="_blank" rel="nofollow">Flip4Mac</a> offers a commercial <a href="http://www.telestream.net/flip4mac-wmv/overview.htm" title="QuickTime component to encode and decode WMA audio on Mac OS X" target="_blank" rel="nofollow">QuickTime component to encode and decode WMA audio on Mac OS X</a>.</p>
<p>WMA 1-9 support up to <strong>2 channels of sound</strong>; WMA Pro supports up to <strong>8 channels of sound</strong>. <strong>All WMA formats are patent-encumbered</strong>; <a href="http://www.microsoft.com/windows/windowsmedia/licensing/licensing.aspx" title="Licensing information from Microsoft" target="_blank" rel="nofollow">licensing information is available from Microsoft</a>.</p>
<h3>Vorbis</h3>
<p><a href="http://en.wikipedia.org/wiki/Vorbis" title="Wikipedia: Vorbis" target="_blank" rel="nofollow">Vorbis</a>&#8230;known to many as &#8220;Ogg Vorbis,&#8221; although for some reason that pisses off both Ogg and Vorbis advocates. (Technically, &#8220;Ogg&#8221; is a container format, and Vorbis audio streams can be embedded in other containers.) <strong>Vorbis is not encumbered by any known patents</strong> and is therefore supported out-of-the-box by all major Linux distributions and by portable devices running the open source <a href="http://www.rockbox.org/" title="Rockbox firmware" target="_blank" rel="nofollow">Rockbox</a> firmware. Mozilla Firefox 3.1 will support Vorbis audio files in an Ogg container, or Ogg videos with a Vorbis audio track. <a href="http://code.google.com/android/" title="Google Android" target="_blank" rel="nofollow">Android</a> mobile phones can also play standalone Vorbis audio files. Vorbis audio streams are usually embedded in an Ogg container, but they can also be <a href="http://samples.mplayerhq.hu/MPEG-4/vorbis-in-mp4/" title="Vorbis embedded in an MP4" target="_blank" rel="nofollow">embedded in an MP4</a> or <a href="http://en.wikipedia.org/wiki/Matroska" title="Wikipedia: Matroska" target="_blank" rel="nofollow">MKV</a> container (or, with some hacking, <a href="http://www.alexander-noe.com/video/amg/" target="_blank" rel="nofollow">in AVI</a>).</p>
<p>There are open source Vorbis encoders and decoders, including <a href="http://oggconvert.tristanb.net/" title="OggConvert" target="_blank" rel="nofollow">OggConvert</a> (encoder), <a href="http://www.ffmpeg.org/" title="ffmpeg" target="_blank" rel="nofollow">ffmpeg</a> (decoder), <a href="http://www.geocities.jp/aoyoume/aotuv/" title="aoTuV" target="_blank" rel="nofollow">aoTuV</a> (encoder), and <a href="http://downloads.xiph.org/releases/vorbis/" title="libvorbis" target="_blank" rel="nofollow">libvorbis</a> (decoder). There are also <a href="http://www.xiph.org/quicktime/" title="QuickTime components for Mac OS X" target="_blank" rel="nofollow">QuickTime components for Mac OS X</a> and <a href="http://www.xiph.org/dshow/" title="DirectShow filters for Windows" target="_blank" rel="nofollow">DirectShow filters for Windows</a>.</p>
<p><strong>Vorbis supports an arbitrary number of sound channels</strong>.</p>
<h3>Dolby Digital</h3>
<p><a href="http://en.wikipedia.org/wiki/Dolby_Digital#Dolby_Digital" title="Wikipedia: Dolby Digital" target="_blank" rel="nofollow">Dolby Digital</a>&#8230;a.k.a. &#8220;AC-3.&#8221; AC-3 was developed by <a href="http://www.dolby.com/index.html" title="Dolby Laboratories" target="_blank" rel="nofollow">Dolby Laboratories</a>. AC-3 is most well-known for being a mandatory format in the DVD standard; all DVD players must be able to decode AC-3 audio streams. It is also mandatory for Blu-Ray players, and many digital TV broadcasts send AC-3 audio streams as well. AC-3 supports <strong>up to 6 channels of sound</strong> and bitrates of <strong>up to 640 kbps</strong>, although its most popular application — audio on DVDs — is officially limited to 448 kbps. (Blu-Ray discs may use the maximum 640 kbps.)</p>
<p>There are open source encoders and decoders for AC-3, including <a href="http://liba52.sourceforge.net/" title="liba52" target="_blank" rel="nofollow">liba52</a> (decoding), <a href="http://ac3filter.net/" title="AC3Filter" target="_blank" rel="nofollow">AC3Filter</a> (decoding), and <a href="http://aften.sourceforge.net/" title="Aften" target="_blank" rel="nofollow">Aften</a> (encoding). ffmpeg has a compile-time option to include liba52, which will allow all ffmpeg-based players and plugin chains (like GStreamer) to play AC-3 audio streams. However, <strong>the AC-3 format is patent-encumbered</strong>; licensing is brokered by <a href="http://www.dolby.com/professional/getting-dolby-technologies/" title="Dolby Laboratories" target="_blank" rel="nofollow">Dolby Laboratories</a>.</p>
<p>AC-3 is rarely seen in standalone audio files; it is designed to be embedded in a video container. Other than DVDs and Blu-Ray discs (which use a video container format I haven&#8217;t talked about yet), you can embed AC-3 audio streams in MKV, AVI, and — just standardized earlier this year — <a href="http://webapp.etsi.org/WorkProgram/Report_WorkItem.asp?WKI_ID=28541" target="_blank" rel="nofollow">in MP4 files</a> (<a href="http://forum.doom9.org/showthread.php?p=1168961#post1168961" target="_blank" rel="nofollow">discussion</a>). Apple&#8217;s AppleTV set-top box is the only hardware device I know of that supports AC-3 in MP4; you can encode AppleTV-compatible AC3-in-MP4 videos with <a href="http://handbrake.fr/" title="HandBrake" target="_blank" rel="nofollow">HandBrake</a>, or manually insert AC-3 audio into existing MP4 files with this <a href="http://mp4creator.sourceforge.net/" title="Windows-only fork of mp4creator" target="_blank" rel="nofollow">Windows-only fork of mp4creator</a>.</p>
<h3>Digital Theater System</h3>
<p><a href="http://en.wikipedia.org/wiki/DTS_%28sound_system%29" title="Wikipedia: Digital Theater System (DTS)" target="_blank" rel="nofollow">Digital Theater System</a>&#8230;a.k.a. &#8220;DTS.&#8221; As you might guess from the name, DTS is designed for real-life movie theaters. Like WMA, &#8220;DTS&#8221; is a brand name for a family of different audio formats. The &#8220;core&#8221; DTS format supports <strong>up to six channels</strong>; later extensions like DTS-HD support <strong>up to eight channels</strong>. There is also <a href="http://en.wikipedia.org/wiki/DTS-HD_Master_Audio" title="Wikipedia: DTS-HD Master Audio" target="_blank" rel="nofollow">DTS-HD Master Audio</a>, a lossless variant by the same company. Core DTS is designed for high bitrates (<strong>up to 1536 kbps</strong>, which is virtually indistinguishable from being there in the first place). DTS-HD Master Audio bitrates can go even higher, although at some point even audiophiles will wonder why they should bother.</p>
<p>Core DTS was not originally part of the DVD specification, so early DVD players did not support it. Most recent DVD players support natively decoding core DTS audio or passing the audio stream through to an external speaker system which decodes it, but relatively few DVDs include a DTS stream due to size constraints. Core DTS <em>is</em> a mandatory part of the Blu-Ray specification, and many Blu-Ray discs include a DTS audio track — sometimes the exact same stream that was originally played in the movie theater. (DTS-HD Master Audio is an optional part of the Blu-Ray specification, but few Blu-Ray discs include it due to — you guessed it — size constraints.)</p>
<p><strong>DTS is patent-encumbered</strong>; licensing is brokered by <a href="http://www.dts.com/" title="DTS, Inc" target="_blank" rel="nofollow">DTS, Inc</a>.</p>
<p><strong>And so forth and so on&#8230;</strong><br />
As with everything else in this series, this article barely scratches the surface. (Really!) If you like, you can read about other audio codecs: <a href="http://en.wikipedia.org/wiki/Adaptive_Transform_Acoustic_Coding" title="Wikipedia: Adaptive Transform Acoustic Coding (ATRAC)" target="_blank" rel="nofollow">ATRAC</a>, <a href="http://en.wikipedia.org/wiki/Musepack" title="Wikipedia: Musepack" target="_blank" rel="nofollow">Musepack</a>, <a href="http://en.wikipedia.org/wiki/MP2_%28format%29" title="Wikipedia: MP2" target="_blank" rel="nofollow">MP2</a>, <a href="http://en.wikipedia.org/wiki/RealAudio" title="Wikipedia: RealAudio" target="_blank" rel="nofollow">RealAudio</a>, <a href="http://en.wikipedia.org/wiki/Adaptive_Multi-Rate" title="Wikipedia: Adaptive Multi-Rate (AMR)" target="_blank" rel="nofollow">AMR</a>, <a href="http://en.wikipedia.org/wiki/ADPCM" title="Wikipedia: ADPCM" target="_blank" rel="nofollow">ADPCM</a>, and so forth and so on. Wikipedia has a <a href="http://en.wikipedia.org/wiki/Comparison_of_audio_codecs" title="Wikipedia: Comparison of audio codecs" target="_blank" rel="nofollow">comparison of common audio codecs</a>, <a href="http://wiki.hydrogenaudio.org/index.php?title=Category:Codecs" title="HydrogenAudio technical details on audio codecs" target="_blank" rel="nofollow">HydrogenAudio has lots of technical details</a>, and <a href="http://wiki.multimedia.cx/index.php?title=Category:Audio_Codecs" title="Multimedia Wiki: Audio codecs" target="_blank" rel="nofollow">wiki.multimedia.cx is always your friend</a> too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-lossy-audio-codecs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mark Pilgrim &#8211; A Gentle Introduction to Video Encoding: Lossy Video Codecs</title>
		<link>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-lossy-video-codecs</link>
		<comments>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-lossy-video-codecs#comments</comments>
		<pubDate>Tue, 11 Oct 2011 09:00:51 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[AVI]]></category>
		<category><![CDATA[bbc]]></category>
		<category><![CDATA[Codec]]></category>
		<category><![CDATA[Container formats]]></category>
		<category><![CDATA[Dirac]]></category>
		<category><![CDATA[DivX]]></category>
		<category><![CDATA[DivX-certified]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[H.264]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iTunes Store]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mark Pilgrim]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft Corporation]]></category>
		<category><![CDATA[mobile devices]]></category>
		<category><![CDATA[MPEG]]></category>
		<category><![CDATA[MPEG-1]]></category>
		<category><![CDATA[MPEG-2]]></category>
		<category><![CDATA[MPEG-4]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[open source decoder software]]></category>
		<category><![CDATA[Theora]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Video codecs]]></category>
		<category><![CDATA[WMV]]></category>
		<category><![CDATA[Xiph.org Foundation]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=4805</guid>
		<description><![CDATA[The most important consideration in video encoding is choosing a video codec. A future article will talk about how to pick the one that’s right for you, but for now I just want to introduce the concept and describe the playing field. (This information is likely to go out of date quickly; future readers, be aware that this was written in December 2008.)]]></description>
			<content:encoded><![CDATA[<p><strong>This article was first published on 19th December 2008, on Mark Pilgrim&#8217;s website. That website no longer exists so this article serves as an historical record. I have preserved all emphasis and links as per the original article.</strong></p>
<p>The most important consideration in video encoding is choosing a video codec. A future article will talk about how to pick the one that&#8217;s right for you, but for now I just want to introduce the concept and describe the playing field. (This information is likely to go out of date quickly; future readers, be aware that this was written in December 2008.)</p>
<p>When you talk about &#8220;watching a video,&#8221; you&#8217;re probably talking about a combination of one video stream, one audio stream, and possibly some subtitles or captions. But you probably don&#8217;t have two different files; you just have &#8220;the video.&#8221; Maybe it&#8217;s an AVI file, or an MP4 file. These are just container formats, like a ZIP file that contains multiple kinds of files within it. The container format defines how to store the video and audio streams in a single file (and subtitles too, if any).</p>
<p>When you &#8220;watch a video,&#8221; your video player is doing several things at once:</p>
<ol>
<li>Interpreting the container format to find out which video and audio tracks are available, and how they are stored within the file so that it can find the data it needs to decode next</li>
<li>Decoding the video stream and displaying a series of images on the screen</li>
<li>Decoding the audio stream and sending the sound to your speakers</li>
<li>Possibly decoding the subtitle stream as well, and showing and hiding phrases at the appropriate times while playing the video</li>
</ol>
<p>A <em>video codec</em> is an algorithm by which a video stream is encoded, i.e. it specifies how to do #2 above. Your video player <em>decodes</em> the video stream according to the <em>video codec</em>, then displays a series of images, or &#8220;frames,&#8221; on the screen. Most modern video codecs use all sorts of tricks to minimize the amount of information required to display one frame after the next. For example, instead of storing each individual frame (like a screenshot), they will only store the differences between frames. Most videos don&#8217;t actually change all that much from one frame to the next, so this allows for high compression rates, which results in smaller file sizes. (There are many, many other complicated tricks too, which I&#8217;ll dive into in a future article.)</p>
<p>There are <em>lossy</em> and <em>lossless</em> video codecs; today&#8217;s article will only deal with lossy codecs. A <em>lossy video codec</em> means that information is being irretrievably lost during encoding. Like copying an audio cassette tape, you&#8217;re losing information about the source video, and degrading the quality, every time you encode. Instead of the &#8220;hiss&#8221; of an audio cassette, a re-re-re-encoded video may look blocky, especially during scenes with a lot of motion. (Actually, this can happen even if you encode straight from the original source, if you choose a poor video codec or pass it the wrong set of parameters.) On the bright side, lossy video codecs can offer amazing compression rates, and many offer ways to &#8220;cheat&#8221; and smooth over that blockiness during playback, to make the loss less noticeable to the human eye.</p>
<p>There are <a href="http://samples.mplayerhq.hu/V-codecs/" title="Video codecs" target="_blank" rel="nofollow"><em>tons</em> of video codecs</a>. Today I&#8217;ll discuss five modern lossy video codecs: MPEG-4 ASP, H.264, VC-1, Theora, and Dirac.</p>
<h3>MPEG-4 ASP</h3>
<p>a.k.a. &#8220;MPEG-4 Advanced Simple Profile.&#8221; <a href="http://en.wikipedia.org/wiki/MPEG-4_Part_2" title="MPEG-4 ASP" target="_blank" rel="nofollow">MPEG-4 ASP</a> was developed by <a href="http://en.wikipedia.org/wiki/Moving_Picture_Experts_Group" title="The MPEG Group" target="_blank" rel="nofollow">the MPEG group</a> and standardized in 2001. You may have heard of <a href="http://en.wikipedia.org/wiki/DivX" title="Wikipedia: DivX" target="_blank" rel="nofollow">DivX</a>, <a href="http://en.wikipedia.org/wiki/Xvid" title="Wikipedia: Xvid" target="_blank" rel="nofollow">Xvid</a>, or <a href="http://en.wikipedia.org/wiki/3ivx" title="Wikipedia: 3ivx" target="_blank" rel="nofollow">3ivx</a>; these are all competing implementations of the MPEG-4 ASP standard. <a href="http://www.xvid.org/" title="Xvid" target="_blank" rel="nofollow">Xvid is open source</a>; DivX and 3ivx are closed source. The company behind DivX has had some mainstream success in branding &#8220;DivX&#8221; as synonymous with &#8220;MPEG-4 ASP.&#8221; For example, this <a href="http://www.amazon.com/Philips-DVP642-DivX-Certified-Progressive-Scan-Player/dp/B000204SWE" title="Amazon: DivX certifiied DVD Player" target="_blank" rel="nofollow">&#8220;DivX-certified&#8221; DVD player</a> can actually play <a href="http://www.jarnot.com/twiki/bin/view/Public/DVP642LisaBsAVIGuide" title="MPEG-4 ASP videos" target="_blank" rel="nofollow">most MPEG-4 ASP videos</a> in an AVI container, even if they were created with a competing encoder. (To confuse things even further, the company behind <a href="http://en.wikipedia.org/wiki/DivX#DivX_Media_Format_.28DMF.29" title="DivX has now created their own container format" target="_blank" rel="nofollow">DivX has now created their own container format</a>.)</p>
<p><strong>MPEG-4 ASP is patent-encumbered</strong>; licensing is brokered through the <a href="http://www.mpegla.com/" title="MPEG LA Group" target="_blank" rel="nofollow">MPEG LA group</a>. MPEG-4 ASP video can be embedded in most popular container formats, including AVI, MP4, and MKV.</p>
<h3>H.264</h3>
<p>a.k.a. &#8220;MPEG-4 part 10,&#8221; a.k.a. &#8220;MPEG-4 AVC,&#8221; a.k.a. &#8220;MPEG-4 Advanced Video Coding.&#8221; <a href="http://en.wikipedia.org/wiki/H.264" title="Wikipedia: H.264" target="_blank" rel="nofollow">H.264</a> was also developed by the <a href="http://en.wikipedia.org/wiki/Moving_Picture_Experts_Group" title="Wikipedia: Moving Picture Experts Group (MPEG)" target="_blank" rel="nofollow">MPEG group</a> and standardized in 2003. It aims to provide a single codec for low-bandwidth, low-CPU devices (cell phones); high-bandwidth, high-CPU devices (modern desktop computers); and everything in between. To accomplish this, the H.264 standard is split into &#8220;<a href="http://en.wikipedia.org/wiki/H.264#Profiles" title="Wikipedia: H.264 Profiles" target="_blank" rel="nofollow">profiles</a>,&#8221; which each define a set of optional features that trade complexity for file size. Higher profiles use more optional features, offer better visual quality at smaller file sizes, take longer to encode, and require more CPU power to decode in real-time.</p>
<p>To give you a rough idea of the range of profiles, <a href="http://www.apple.com/iphone/specs.html" title="Apple's iPhone supports Baseline profile" target="_blank" rel="nofollow">Apple&#8217;s iPhone supports Baseline profile</a>, the <a href="http://www.apple.com/appletv/specs.html" title="AppleTV supports Baseline and Main profiles" target="_blank" rel="nofollow">AppleTV set-top box supports Baseline and Main profiles</a>, and <a href="http://www.kaourantin.net/2007/08/what-just-happened-to-video-on-web_20.html" title="Adobe Flash supports Baseline, Main and High profiles" target="_blank" rel="nofollow">Adobe Flash on a desktop PC supports Baseline, Main, and High profiles</a>. YouTube (owned by Google, my employer) now uses H.264 to encode <a href="http://blog.wired.com/business/2008/12/youtube-adds-hd.html" title="high-definition videos" target="_blank" rel="nofollow">high-definition videos</a>, playable through Adobe Flash; YouTube also provides H.264-encoded video to mobile devices, including Apple&#8217;s iPhone and phones running Google&#8217;s <a href="http://code.google.com/android/" title="Android mobile operating system" target="_blank" rel="nofollow">Android mobile operating system</a>. Also, H.264 is one of the video codecs mandated by the Blu-Ray specification; Blu-Ray discs that use it generally use the High profile.</p>
<p>Most non-PC devices that play H.264 video (including iPhones and standalone Blu-Ray players) actually do the decoding on a dedicated chip, since their main CPUs are nowhere near powerful enough to decode the video in real-time. Recent high-end desktop graphics cards also support decoding H.264 in hardware. There are a number of <a href="http://compression.ru/video/codec_comparison/mpeg-4_avc_h264_2007_en.html" title="Competing H.264 encoders" target="_blank" rel="nofollow">competing H.264 encoders</a>, including the <a href="http://www.videolan.org/developers/x264.html" title="Open source x264 library" target="_blank" rel="nofollow">open source x264 library</a>. The <strong>H.264 standard is patent-encumbered</strong>; licensing is brokered through the <a href="http://www.mpegla.com/" title="MPEG LA Group" target="_blank" rel="nofollow">MPEG LA group</a>. H.264 video can be embedded in most popular container formats, including MP4 (used primarily by <a href="http://www.apple.com/itunes/whatson/movies.html" title="Apple iTunes Store" target="_blank" rel="nofollow">Apple&#8217;s iTunes Store</a>) and MKV (used primarily by video pirates).</p>
<h3>VC-1</h3>
<p><a href="http://en.wikipedia.org/wiki/VC-1" title="Wikipedia: VC-1" target="_blank" rel="nofollow">VC-1</a> evolved from Microsoft&#8217;s WMV9 codec and was <a href="http://www.betanews.com/article/Microsoft_VC1_Codec_Now_a_Standard/1144097224" title="Codec standardised in 2006" target="_blank" rel="nofollow">standardized in 2006</a>. It is primarily used and promoted by Microsoft for high-definition video, although, like H.264, it has <a href="http://www.microsoft.com/windows/windowsmedia/howto/articles/vc1techoverview.aspx#OverviewofVC1" title="VC-1 profiles" target="_blank" rel="nofollow">a range of profiles</a> to trade complexity for file size. Also like H.264, it is mandated by the Blu-Ray specification, and all Blu-Ray players are required to be able to decode it. <strong>The VC-1 codec is patent-encumbered</strong>, with licensing brokered through the <a href="http://www.mpegla.com/" title="MPEG LA Group" target="_blank" rel="nofollow">MPEG LA group</a>.</p>
<p>Wikipedia has a brief <a href="http://en.wikipedia.org/wiki/Comparison_of_H.264_and_VC-1" title="Wikipedia: Technical compariosn of VC-1 and H.264" target="_blank" rel="nofollow">technical comparison of VC-1 and H.264</a>; <a href="http://www.microsoft.com/windows/windowsmedia/howto/articles/vc1techoverview.aspx#VC1ComparedtoOtherCodecs" title="Microsoft comparison of VC-1 with other codecs" target="_blank" rel="nofollow">Microsoft has their own comparison</a>; Multimedia.cx has a <a href="http://wiki.multimedia.cx/index.php?title=H.264" title="Venn diagram outlining similarities and differences between codecs" target="_blank" rel="nofollow">pretty Venn diagram outlining the similarities</a> and differences. Multimedia.cx also discusses the <a href="http://wiki.multimedia.cx/index.php?title=VC-1" title="Technical features of VC-1" target="_blank" rel="nofollow">technical features of VC-1</a>. I also found this <a href="http://www.avsforum.com/avs-vb/showthread.php?p=9931723#post9931723" title="History of VC-1 and H.264" target="_blank" rel="nofollow">history of VC-1 and H.264</a> to be interesting (as well as <a href="http://archive2.avsforum.com/avs-vb/showthread.php?p=6594314#post6594314" title="Rebuttal" target="_blank" rel="nofollow">this rebuttal</a>).</p>
<p>VC-1 is designed to be container-independent, although it is most often embedded in an ASF container. An open source decoder for VC-1 video was a <a href="http://code.google.com/soc/2006/ffmpeg/appinfo.html?csaid=5AA777DB19E2BB24" title="2006 Google Summer of Code project" target="_blank" rel="nofollow">2006 Google Summer of Code project</a>, and the resulting code was added to the multi-faceted <a href="http://ffmpeg.mplayerhq.hu/" title="ffmpeg library" target="_blank" rel="nofollow">ffmpeg library</a>.</p>
<h3>Theora</h3>
<p><a href="http://en.wikipedia.org/wiki/Theora" title="Wikipedia: Theora" target="_blank" rel="nofollow">Theora</a> evolved from the VP3 codec and has subsequently been developed by the <a href="http://xiph.org/" title="Xiph Foundation" target="_blank" rel="nofollow">Xiph.org Foundation</a>. <strong>Theora is a royalty-free codec and is not encumbered by any known patents</strong> other than the original VP3 patents, which have been irrevocably licensed royalty-free. Although the standard has been &#8220;frozen&#8221; since 2004, the Theora project (which includes an open source reference encoder and decoder) <a href="http://lists.xiph.org/pipermail/theora-dev/2008-November/003736.html" title="Version 1.0 November 2008" target="_blank" rel="nofollow">only hit 1.0 in November 2008</a>.</p>
<p>Theora video can be embedded in any container format, although it is most often seen in an Ogg container. All major Linux distributions support Theora out-of-the-box, and <a href="https://developer.mozilla.org/web-tech/2008/10/14/firefox-31-beta-1-an-overview-of-features-for-web-developers/" title="Mozilla Firefox 3.1 includes native support for Theora video" target="_blank" rel="nofollow">Mozilla Firefox 3.1 will include native support for Theora video in an Ogg container</a>. And by &#8220;native&#8221;, I mean &#8220;available on all platforms without platform-specific plugins.&#8221; You can also play Theora video <a href="http://www.xiph.org/dshow/" title="Theora video on Windows" target="_blank" rel="nofollow">on Windows</a> or <a href="http://xiph.org/quicktime/" title="Theora video on Mac OS X" target="_blank" rel="nofollow">on Mac OS X</a> after installing Xiph.org&#8217;s open source decoder software.</p>
<p>The reference encoder included in Theora 1.0 is widely criticized for being slow and poor quality, but Theora 1.1 will include a new encoder that takes better advantage of Theora&#8217;s features, while staying backward-compatible with current decoders. (Info: <a href="http://web.mit.edu/xiphmont/Public/theora/demo.html" title="Demo 1" target="_blank" rel="nofollow">1</a>, <a href="http://web.mit.edu/xiphmont/Public/theora/demo2.html" title="Demo 2" target="_blank" rel="nofollow">2</a>, <a href="http://web.mit.edu/xiphmont/Public/theora/demo3.html" title="Demo 3" target="_blank" rel="nofollow">3</a>, <a href="http://web.mit.edu/xiphmont/Public/theora/demo4.html" title="Demo 4" target="_blank" rel="nofollow">4</a>, <a href="http://web.mit.edu/xiphmont/Public/theora/demo5.html" title="Demo 5" target="_blank" rel="nofollow">5</a>, <a href="http://svn.xiph.org/branches/theora-thusnelda/" title="source code" target="_blank" rel="nofollow">source code</a>.)</p>
<h3>Dirac</h3>
<p>Dirac was <a href="http://www.bbc.co.uk/rd/projects/dirac/" title="Dirac, developed by the BBC" target="_blank" rel="nofollow">developed by the BBC</a> to provide a royalty-free alternative to H.264 and VC-1 that the BBC could use to stream high-definition television content in Great Britain. Like H.264, Dirac aims to provide a single codec for the full spectrum of very low- and very high-bandwidth streaming. <strong>Dirac is not encumbered by any known patents</strong>, and there are two open source implementations, <a href="http://diracvideo.org/download/dirac-research/" title="Dirac research" target="_blank" rel="nofollow">dirac-research</a> (the BBC&#8217;s reference implementation) and <a href="http://www.diracvideo.org/download/schroedinger/" title="Schroedinger" target="_blank" rel="nofollow">Schroedinger</a> (optimized for speed).</p>
<p>The Dirac standard was only finalized in 2008, so there is very little mainstream use yet, although the <a href="http://www.ibc.org/cgi-bin/ibc_dailynews_cms.cgi?story_no=25368&#038;issue=4" title="Dirac used internally during the 2008 Olympics" target="_blank" rel="nofollow">BBC did use it internally during the 2008 Olympics</a>. Dirac-encoded video tracks can be embedded in several popular container formats, including <a href="http://www.diracvideo.org/wiki/index.php/DiracInISOM" title="MP4 format" target="_blank" rel="nofollow">MP4</a>, <a href="http://www.diracvideo.org/wiki/index.php/DiracInOgg" title="Ogg format" target="_blank" rel="nofollow">Ogg</a>, <a href="http://www.diracvideo.org/wiki/index.php/DiracInMatroska" title="MKV format" target="_blank" rel="nofollow">MKV</a>, and <a href="http://www.diracvideo.org/wiki/index.php/DiracInAVI" title="AVI format" target="_blank" rel="nofollow">AVI</a>. <a href="http://www.videolan.org/vlc/" title="VLC" target="_blank" rel="nofollow">VLC</a> 0.9.2 (<a href="http://www.diracvideo.org/node/19" title="VLC 0.9.2 released in September 2008" target="_blank" rel="nofollow">released in September 2008</a>) can play Dirac-encoded video within an Ogg or MP4 container.</p>
<p><strong>And on and on&#8230;</strong><br />
Of course, this is only scratching the surface of all the available video codecs. Video encoding goes way back, but my focus in this series is on the present and near-future, not the past. If you like, you can read about <a href="http://en.wikipedia.org/wiki/MPEG-2" title="Wikipedia: MPEG-2" target="_blank" rel="nofollow">MPEG-2</a> (used in DVDs), <a href="http://en.wikipedia.org/wiki/MPEG-1" title="Wikipedia: MPEG-1" target="_blank" rel="nofollow">MPEG-1</a> (used in Video CDs), older versions of Microsoft&#8217;s <a href="http://en.wikipedia.org/wiki/Windows_Media_Video#Windows_Media_Video" title="Wikipedia: Windows Media Video (WMV)" target="_blank" rel="nofollow">WMV</a> family, <a href="http://en.wikipedia.org/wiki/Sorenson_codec" title="Wikipedia: Sorenson codec" target="_blank" rel="nofollow">Sorenson</a>, <a href="http://en.wikipedia.org/wiki/Indeo" title="Wikipedia: Indeo" target="_blank" rel="nofollow">Indeo</a>, and <a href="http://en.wikipedia.org/wiki/Cinepak" title="Wikipedia: Cinepak" target="_blank" rel="nofollow">Cinepak</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-lossy-video-codecs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mark Pilgrim &#8211; A Gentle Introduction to Video Encoding: Container Formats</title>
		<link>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-container-formats</link>
		<comments>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-container-formats#comments</comments>
		<pubDate>Mon, 10 Oct 2011 09:00:14 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Advanced Systems Format]]></category>
		<category><![CDATA[Audio Video Interleave]]></category>
		<category><![CDATA[AVI]]></category>
		<category><![CDATA[Codec]]></category>
		<category><![CDATA[Comparison of container formats]]></category>
		<category><![CDATA[Container formats]]></category>
		<category><![CDATA[digital video]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[Flash Video]]></category>
		<category><![CDATA[Mark Pilgrim]]></category>
		<category><![CDATA[Matroska]]></category>
		<category><![CDATA[MPEG]]></category>
		<category><![CDATA[MPEG-4 Part 14]]></category>
		<category><![CDATA[Ogg]]></category>
		<category><![CDATA[quicktime]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Windows Media Player]]></category>
		<category><![CDATA[Windows Media Video]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=4803</guid>
		<description><![CDATA[You may think of video files as “AVI files” or “MP4 files.” In reality, “AVI” and “MP4″ are just container formats. Just like a ZIP file can contain any sort of file within it, video container formats only define how to store things within them, not what kinds of data are stored. (It’s a little more complicated than that, because not all video streams are compatible with all container formats, but never mind that for now.) A video file usually contains multiple tracks — a video track (without audio), one or more audio tracks (without video), one or more subtitle/caption tracks, and so forth. Tracks are usually interrelated; an audio track contains markers within it to help synchronize the audio with the video, and a subtitle track contains time codes marking when each phrase should be displayed. Individual tracks can have metadata, such as the aspect ratio of a video track, or the language of an audio or subtitle track. Containers can also have metadata, such as the title of the video itself, cover art for the video, episode numbers (for television shows), and so on.]]></description>
			<content:encoded><![CDATA[<p><strong>This article was first published on 18th December 2008, on Mark Pilgrim&#8217;s website. That website no longer exists so this article serves as an historical record. I have preserved all emphasis and links as per the original article.</strong></p>
<p>You may think of video files as &#8220;AVI files&#8221; or &#8220;MP4 files.&#8221; In reality, &#8220;AVI&#8221; and &#8220;MP4″ are just container formats. Just like a ZIP file can contain any sort of file within it, video container formats only define <em>how</em> to store things within them, not <em>what</em> kinds of data are stored. (It&#8217;s a little more complicated than that, because not all video streams are compatible with all container formats, but never mind that for now.) A video file usually contains multiple <em>tracks</em> — a video track (without audio), one or more audio tracks (without video), one or more subtitle/caption tracks, and so forth. Tracks are usually interrelated; an audio track contains markers within it to help synchronize the audio with the video, and a subtitle track contains time codes marking when each phrase should be displayed. Individual tracks can have metadata, such as the aspect ratio of a video track, or the language of an audio or subtitle track. Containers can also have metadata, such as the title of the video itself, cover art for the video, episode numbers (for television shows), and so on.</p>
<p>There are <em>lots</em> of video container formats. Some of the most popular include:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/MPEG-4_Part_14" title="Wikipedia: MPEG-4" target="_blank" rel="nofollow">MPEG 4</a>, usually with an <code>.mp4</code> extension. The MPEG 4 container is <a href="http://www.chiariglione.org/mpeg/technologies/mp04-ff/index.htm" title="Apple's Quicktime container" target="_blank" rel="nofollow">based on Apple&#8217;s older QuickTime container</a> (<code>.mov</code>). <a href="http://www.apple.com/trailers/" title="Movie Trailers on Apple's website" target="_blank" rel="nofollow">Movie trailers on Apple&#8217;s website</a> still use the older QuickTime container, but movies that you rent from iTunes are delivered in an MPEG 4 container, although Apple likes to use the <code>.m4v</code> file extension instead of <code>.mp4</code>.</li>
<li><a href="http://en.wikipedia.org/wiki/Advanced_Systems_Format" title="Wikipedia: Advanced Systems Format" target="_blank" rel="nofollow">Advanced Systems Format</a>, usually with an <code>.asf</code> or <code>.wmv</code> extension. ASF was <a href="http://msdn.microsoft.com/en-us/library/ms983668.aspx" title="Microsoft - ASF invented by" target="_blank" rel="nofollow">invented by</a> and is primarily used by Microsoft in their Windows Media Player and their handheld Zune media device.</li>
<li><a href="http://en.wikipedia.org/wiki/Flash_Video" title="Wikipedia: Flash Video" target="_blank" rel="nofollow">Flash Video</a>, usually with an <code>.flv</code> extension. Flash Video is, unsurprisingly, used by Adobe Flash. Prior to Flash 9.0.60.184 (a.k.a. Flash Player 9 Update 3), this was the only container format that Flash supported. More recent versions of Flash also support the MPEG 4 container.</li>
<li><a href="http://en.wikipedia.org/wiki/Matroska" title="Wikipedia: Matroska" target="_blank" rel="nofollow">Matroska</a>, usually with an <code>.mkv</code> extension. Matroska is an open standard, unencumbered by any known patents, and there are open source reference implementations for doing everything you might want to do with MKV files. It is primarily used by Free Software-loving hippies and, oddly enough, pirates who rip high-definition movies and television shows and release them in The Scene.</li>
<li><a href="http://en.wikipedia.org/wiki/Ogg" title="Wikipedia: Ogg" target="_blank" rel="nofollow">Ogg</a>, usually with an <code>.ogv</code> extension. Like Matroska, Ogg is an open standard, open-source-friendly, and unencumbered by any known patents. Like Matroska, it is used primarily by Free Software-loving hippies, but that may begin to change once Mozilla ships their Firefox 3.1 browser. Firefox 3.1 will support — natively, without platform-specific plugins — the Ogg container format, the Ogg video codec (Theora), and the Ogg audio codec (Vorbis). On the desktop, Ogg is supported out-of-the-box by all major Linux distributions, and you can use it on Mac and Windows by installing the <a href="http://www.xiph.org/quicktime/" title="Quicktime components" target="_blank" rel="nofollow">QuickTime components</a> or <a href="http://www.xiph.org/dshow/" title="DirectShow filters" target="_blank" rel="nofollow">DirectShow filters</a>, respectively.</li>
<li><a href="http://en.wikipedia.org/wiki/AVI" title="Wikipedia: Audio Video Interleave (AVI)" target="_blank" rel="nofollow">Audio Video Interleave</a>, usually with an <code>.avi</code> extension. Also known as &#8220;the crappy, obsolete format that just won&#8217;t die.&#8221; The AVI container format was invented by Microsoft in a simpler time when the fact that computers could play video at all was considered pretty amazing. It does not officially support many of the features of more recent container formats; it does not officially support any sort of video metadata; it does not even officially support most of the modern video and audio codecs in use today. Over time, various companies have tried to extend it in generally incompatible ways to support this or that, and it is still the default container format for popular encoders such as <a href="http://www.mplayerhq.hu/DOCS/HTML/en/encoding-guide.html" title="MEncoder" target="_blank" rel="nofollow">MEncoder</a>.</li>
</ul>
<p>This is the briefest of overviews; there are literally dozens of other container formats in use today. DV, NUT, 3GP… the list goes on and on. And there are many others littering the landscape of failed or obsolete technologies, from companies that tried to corner the nascent digital video market by defining their own formats. </p>
<p><a href="http://en.wikipedia.org/wiki/Comparison_of_container_formats" title="Wikipedia: Comparison of container formats" target="_blank" rel="nofollow">Wikipedia has a good roundup of video container formats.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/mark-pilgrim-a-gentle-introduction-to-video-encoding-container-formats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run Two Versions of Firefox on Mac OSX</title>
		<link>http://www.simonwhatley.co.uk/run-two-versions-of-firefox-on-mac-osx</link>
		<comments>http://www.simonwhatley.co.uk/run-two-versions-of-firefox-on-mac-osx#comments</comments>
		<pubDate>Wed, 30 Mar 2011 09:03:52 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=3958</guid>
		<description><![CDATA[Last week Firefox 4.0 was released to the world. Web developers everywhere celebrated with delight, the new browser. Well, almost! The browser comes packed with a super-fast JavaScript engine called J&#228;gerMonkey, improved support for HTML5 and CSS3 and a bunch of new interface updates.]]></description>
			<content:encoded><![CDATA[<p>Last week Firefox 4.0 was released to the world. Web developers everywhere celebrated with delight, the new browser. Well, almost!  The browser comes packed with a <a href="http://www.mozilla.com/en-US/firefox/4.0/releasenotes/" title="Firefox 4.0 release notes" target="_blank" rel="nofollow">super-fast JavaScript engine called J&auml;gerMonkey, improved support for HTML5 and CSS3 and a bunch of new interface updates</a>. But don’t get too excited just yet! It&#8217;s still a good idea to keep that old version of Firefox around for testing; we can’t assume everyone has upgraded to Firefox 4. So, to run both Firefox 3.6 and Firefox 4.0 on the same machine, just follow these simple steps:</p>
<ol>
<li>Open up your Applications folder and find your old version of Firefox.</li>
<li>Right click -> Get Info.</li>
<li>Rename to &#8220;Firefox36.app&#8221;.</li>
<li>Download Firefox 4.0 and install as normal.</li>
</ol>
<p>Voil&agrave;! You now have more than one Firefox browser to play with.</p>
<p>That was really simple huh? If someone knows how to do this on the Windows and Linux side, I would love to hear how.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/run-two-versions-of-firefox-on-mac-osx/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Google&#039;s 5 Privacy Principles</title>
		<link>http://www.simonwhatley.co.uk/googles-5-privacy-principles</link>
		<comments>http://www.simonwhatley.co.uk/googles-5-privacy-principles#comments</comments>
		<pubDate>Thu, 28 Jan 2010 14:51:50 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Ethics]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Identity management]]></category>
		<category><![CDATA[Information privacy]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[world wide web]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=2255</guid>
		<description><![CDATA[In honour [sic] of International Data Privacy Day today, 28th January 2010, Google has published their own guidlines on privacy. The timing of this is quite intriguing following the recent hacking attack, supposedly orchestrated by the Chinese authorities, on Google, Yahoo, Adobe and some 20 other major international corporations; whilst there is also the ongoing concern from many quarters about Google is too dominant in many aspects of our online lives.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2010/01/googleprivacylogo.png" alt="" title="Google Privacy Logo" width="241" height="128" class="alignleft size-full wp-image-2264" />In honour [sic] of <a href="http://dataprivacyday2010.org" title="International Data Privacy Day" target="_blank" rel="nofollow">International Data Privacy Day</a> today, 28th January 2010, Google has published their own <a href="http://www.google.com/corporate/privacy_principles.html" title="Google's Privacy Principles" target="_blank" rel="nofollow">guidlines on privacy</a>.</p>
<p>The timing of this is quite intriguing following the recent hacking attack, supposedly orchestrated by the Chinese authorities, on Google, Yahoo, Adobe and some 20 other major international corporations; whilst there is also the ongoing concern from many quarters about Google is too dominant in many aspects of our online lives.</p>
<p>But less of the cynicism, the five principles are:</p>
<ul>
<li><strong>Use information to provide our users with valuable products and services.</strong><br />
<q>Focus on providing the best user experience</q> is the first tenet of Google&#8217;s philosophy. When users share information with us, it allows us to build services and products that are valuable to them. We believe that focusing on the user fosters both the products and privacy-enhancing features that have fueled innovation and built a loyal audience of users online.</li>
<li><strong>Develop products that reflect strong privacy standards and practices.</strong><br />
Our ambition is to be at the leading edge of technology, including the development of tools that help users manage their personal information in a simple, accessible manner without detracting from a valuable user experience. We comply with privacy laws, and additionally work internally and with regulators and industry partners to develop and implement strong privacy standards.</li>
<li><strong>Make the collection of personal information transparent.</strong><br />
We strive to show users the information used to customize our services. Where appropriate, we aim to be transparent about the information we have about individual users and how we use that information to deliver our services.</li>
<li><strong>Give users meaningful choices to protect their privacy.</strong><br />
People have different privacy concerns and needs. To best serve the full range of our users, Google strives to offer them meaningful and fine-grained choices over the use of their personal information. We believe personal information should not be held hostage and we are committed to building products that let users export their personal information to other services. We don&#8217;t sell users&#8217; personal information.</li>
<li><strong>Be a responsible steward of the information we hold.</strong><br />
We recognize our responsibility to protect the data that users entrust to us. We take security issues seriously and work together with a large community of users, developers and external security experts to make the Internet safer and more secure.</li>
</ul>
<p>Whether these principles can be fully adhered to by Google is an important question, but they do serve to calm the fears of many about what they&#8217;ll do with our data. If nothing else, they do serve to highlight the need for data privacy to be taken seriously by anyone considering building web applications.</p>
<p>If you’re interested in more of Google’s privacy stances, they’ve got an entire <a href="http://www.google.com/intl/en/privacy.html" title="Google's Privacy Centre" target="_blank" rel="nofollow">portal</a> dedicated to them.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/googles-5-privacy-principles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cartoon: Computer Worker&#039;s Free Time</title>
		<link>http://www.simonwhatley.co.uk/cartoon-computer-workers-free-time</link>
		<comments>http://www.simonwhatley.co.uk/cartoon-computer-workers-free-time#comments</comments>
		<pubDate>Thu, 05 Mar 2009 12:08:41 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[3D artist]]></category>
		<category><![CDATA[Asides]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[Computer Worker]]></category>
		<category><![CDATA[free time]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[IT Consultant]]></category>
		<category><![CDATA[Programmer]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[system administrator]]></category>
		<category><![CDATA[web developer]]></category>
		<category><![CDATA[workers]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1839</guid>
		<description><![CDATA[Reasons why people working with computers tend to have lots of free time...]]></description>
			<content:encoded><![CDATA[<p>Reasons why people working with computers tend to have lots of free time&#8230;</p>
<p><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/03/computerworkers.png" alt="Computer Workers" title="Computer Workers" width="580" height="501" class="aligncenter size-full wp-image-1838" /></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/cartoon-computer-workers-free-time/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Your Application &#8211; PCI DSS Specifications</title>
		<link>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications</link>
		<comments>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications#comments</comments>
		<pubDate>Mon, 26 Jan 2009 11:19:37 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe ColdFusion]]></category>
		<category><![CDATA[American Express]]></category>
		<category><![CDATA[anti-virus software]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[BlueDragon]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Administrator]]></category>
		<category><![CDATA[company processing]]></category>
		<category><![CDATA[compliance]]></category>
		<category><![CDATA[control measures]]></category>
		<category><![CDATA[Data Security Standard]]></category>
		<category><![CDATA[database server]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Discover Financial Services]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JCB International]]></category>
		<category><![CDATA[Manitoba]]></category>
		<category><![CDATA[Mastercard Worldwide]]></category>
		<category><![CDATA[Payment Card Industry]]></category>
		<category><![CDATA[Payment Card Industry Security Standards Council]]></category>
		<category><![CDATA[payment card processing]]></category>
		<category><![CDATA[Payment Processors]]></category>
		<category><![CDATA[PCI DSS]]></category>
		<category><![CDATA[public networks]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[raw processing]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[regulations]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[secure systems]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Security Standards Council]]></category>
		<category><![CDATA[security systems]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[software developers]]></category>
		<category><![CDATA[software releases]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[the Council]]></category>
		<category><![CDATA[Visa]]></category>
		<category><![CDATA[Visa Inc .]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web application developers]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web code]]></category>
		<category><![CDATA[Web Servers]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1785</guid>
		<description><![CDATA[PCI DSS stands for Payment Card Industry Data Security Standard, and is a worldwide security standard assembled by the Payment Card Industry Security Standards Council (PCI SSC). The PCI security standards are technical and operational requirements that were created to help organizations that process card payments prevent credit card fraud, hacking and various other security vulnerabilities and threats. The standards apply to all organizations that store, process or transmit cardholder data – with guidance for software developers and manufacturers of applications and devices used in those transactions. A company processing, storing, or transmitting cardholder data must be PCI DSS compliant.]]></description>
			<content:encoded><![CDATA[<p>PCI DSS stands for <a href="https://www.pcisecuritystandards.org/" title="Payment Card Industry Data Security Standard website" target="_blank" rel="nofollow">Payment Card Industry Data Security Standard</a>, and is a worldwide security standard assembled by the Payment Card Industry Security Standards Council (<abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr>). The <abbr title="Payment Card Industry">PCI</abbr> security standards are technical and operational requirements that were created to help organizations that process card payments prevent credit card fraud, hacking and various other security vulnerabilities and threats. The standards apply to all organizations that store, process or transmit cardholder data – with guidance for software developers and manufacturers of applications and devices used in those transactions. A company processing, storing, or transmitting cardholder data must be <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standard">DSS</abbr> compliant.</p>
<p><a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/payment-card-data.png"><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/payment-card-data.png" alt="Types of Data on a Payment Card" title="Types of Data on a Payment Card" width="600" height="255" class="aligncenter size-full wp-image-1815" /></a></p>
<p>The <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr> (<q>Council</q>) is responsible for managing the security standards, while compliance with the <abbr title="Payment Card Industry">PCI</abbr> set of standards is enforced by the founding members of the Council: <a href="http://www.americanexpress.com/datasecurity" title="American Express" target="_blank" rel="nofollow">American Express</a>, <a href="http://www.discovernetwork.com/fraudsecurity/disc.html" title="Discover Financial Services" target="_blank" rel="nofollow">Discover Financial Services</a>, <a href="http://www.jcb-global.com/english/pci/index.html" title="JCB International" target="_blank" rel="nofollow">JCB International</a>, <a href="http://www.mastercard.com/sdp" title="MasterCard Worldwide" target="_blank" rel="nofollow">MasterCard Worldwide</a> and <a href="http://www.visa.com/cisp" title="Visa" target="_blank" rel="nofollow">Visa Inc</a>. Non-compliant companies who maintain a relationship with one or more of the card brands, either directly or through an acquirer risk losing their ability to process credit card payments and being audited and/or fined.</p>
<p>All in-scope companies must validate their compliance annually. This validation can be conducted by Qualified Security Assessors, i.e. companies that have completed a <a href="https://www.pcisecuritystandards.org/qsa_asv/become_qsa.shtml" title="PCI: Becoming a Qualified Security Assessor" target="_blank" rel="nofollow">three-step certification process</a> by the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr> which recognises them as being qualified to assess compliance to the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standard">DSS</abbr> standard. However, smaller companies have the option to use a <a href="https://www.pcisecuritystandards.org/saq/index.shtml" title="PCI Self-Assessment Questionnaire" target="_blank" rel="nofollow">Self-Assessment Questionnaire</a>. Whether this questionnaire needs to be validated by a <abbr title="Qualified Security Assessors">QSA</abbr> depends on the requirements of the card brands in that merchant&#8217;s region.</p>
<p>The current version of the standard specifies 12 requirements for compliance, organised into 6 logically related groups, which are called &#8220;control objectives.&#8221;</p>
<ol>
<li>Build and Maintain a Secure Network
<ul>
<li>Requirement 1: Install and maintain a firewall configuration to protect cardholder data</li>
<li>Requirement 2: Do not use vendor-supplied defaults for system passwords and other security parameters</li>
</ul>
</li>
<li>Protect Cardholder Data
<ul>
<li>Requirement 3: Protect stored cardholder data</li>
<li>Requirement 4: Encrypt transmission of cardholder data across open, public networks</li>
</ul>
</li>
<li>Maintain a Vulnerability Management Program
<ul>
<li>Requirement 5: Use and regularly update anti-virus software</li>
<li>Requirement 6: Develop and maintain secure systems and applications</li>
</ul>
</li>
<li>Implement Strong Access Control Measures
<ul>
<li>Requirement 7: Restrict access to cardholder data by business need-to-know</li>
<li>Requirement 8: Assign a unique ID to each person with computer access</li>
<li>Requirement 9: Restrict physical access to cardholder data</li>
</ul>
</li>
<li>Regularly Monitor and Test Networks
<ul>
<li>Requirement 10: Track and monitor all access to network resources and cardholder data</li>
<li>Requirement 11: Regularly test security systems and processes</li>
</ul>
</li>
<li>Maintain an Information Security Policy
<ul>
<li>Requirement 12: Maintain a policy that addresses information security</li>
</ul>
</li>
</ol>
<p>Compliance with these requirements can be summarized into 3 main stages:</p>
<ul>
<li>Collecting and storing: Secure collection and tamper-proof storage of all log data so that it is available for analysis.</li>
<li>Reporting: Being able to prove compliance on the spot if audited and present evidence that controls are in place for protecting data.</li>
<li>Monitoring and alerting: Have systems in place such as auto-alerting, to help administrators constantly monitor access and usage of data. Administrators are warned of problems immediately and can rapidly address them. These systems should also extend to the log data itself –- there must be proof that log data is being collected and stored.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>What does this actually mean for web application developers?</h3>
<p>It is considerably more expensive and more time-consuming to recover from a security incident than to take preventative measures ahead of time. If you follow the guidelines below, you will go along way to securing you application in line with the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> regulations. Many of the measures apply to general application security, but since <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> is all about security, they are worth mentioning.</p>
<p>Server-level Security:</p>
<ul>
<li>Separate web- and database-servers on to different physical machines.</li>
<li>Secure the web- and database-servers with traditional techniques. Only authorised accounts should have the capabilities to run tasks on the machine. That means not giving admin-rights to the user account.</li>
<li>Keep servers up-to-date with the latest patches and software releases.</li>
<li>Minimise the number of services running on the server. This means limiting the services to only those required for the web- or database-servers to function.</li>
<li>Secure information in transit between servers. This may mean physically securing the network to prevent evesdropping via encryption or obfuscating the data amongst innocuous &#8216;noise&#8217;.</li>
<li>Secure the database server behind a firewall.</li>
</ul>
<p>Application-level Security:</p>
<ul>
<li>Separate ColdFusion, the webserver and database server user accounts. They should never be under the same system account.</li>
<li>Create a database user specifically for your ColdFusion datasource and restrict it to only the activities required for the application. The user should not have database-owner rights, access to databases not relating to the application or access to the system tables.</li>
<li>Revoke privileges in the ColdFusion datasource definition to prevent the <abbr title="Structured Query Language">SQL</abbr> commands <code>CREATE</code>, <code>DROP</code>, <code>GRANT</code>, <code>REVOKE</code> and <code>ALTER</code>.</li>
<li>General settings in the ColdFusion Administrator:
<ul>
<li>Check the <em>Disable access to internal ColdFusion Java components</em> option.</li>
<li>Check the <em>Enable Global Script Protection</em> option.</li>
<li>Add a <em>Missing Template Handler</em>.</li>
<li>Add a <em>Site-wide Error Handler</em>.</li>
<li>Reduce the <em>Maximum size of post data</em> from 100<abbr title="megabytes">MB</abbr>.</li>
<li>Enable <em>Timeout Requests</em>, and set to 60 seconds or less.</li>
<li>Disable <em>Robust Exception Handling</em> on production servers.</li>
</ul>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Web Application-level Security:</p>
<ul>
<li>Use secure HTTP to transfer data and/or when logged into &#8216;administration&#8217; secutions of your web application.</li>
<li>Timeout sessions after 15 minutes and on browser close.</li>
<li>Provide multi-level login processes. For example, lock the application after 3 failed attempts for a period of 10 minutes.</li>
<li>Do not identify whether the username or password are incorrect, simply notify the user that their login failed and that they must try again.</li>
<li>Encrypt passwords stored in the database with a standard such as <a href="http://en.wikipedia.org/wiki/SHA_hash_functions" title="Wikipedia: SHA cryptographic has function" target="_blank" rel="nofollow">SHA-256</a> or &#8216;stronger&#8217;.</li>
<li>Use <a href="http://en.wikipedia.org/wiki/Captcha" title="Wikipedia: CAPTCHA" target="_blank" rel="nofollow">CAPTCHA</a>s (textual and aural) to prevent automated robots hacking into your application.</li>
<li>Run regular penetration tests on your application to identify potential problems.</li>
<li>Encrypt credit card information held in the database or other storage mechanism. Only store credit card data in line with the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> regulations.</li>
</ul>
<p>Code-level Security:</p>
<ul>
<li>Application.cfc &#8211; Set the <code>scriptProtect</code> Application variable to <code>true</code> to enable application-wide cross-site script protection.
</li>
<li>CFQueryParam &#8211; This tag, importantly, verifies the data type of a query parameter and, for <abbr title="Relational Database Management Systems">RDBMS</abbr>s that support bind variables, enables ColdFusion to use bind variables in the <acronym title="Structured Query Language">SQL</acronym> statement. Bind variable usage enhances performance when executing a <code>cfquery</code> statement multiple times. There are limitations to the use of the <code>cfqueryparam</code> tag. In ColdFusion 7 for example, you cannot use them in queries using the <code>cachedWithin</code> attribute. Similarly, they cannot be used in <code>ORDER BY</code> clauses, although the use of conditional logic should resolve the need for order by variables.
</li>
<li>Functions &#8211; As a rule of thumb, validate <em>all</em> the data being passed into a query prior to it being used. ColdFusion MX 7 saw the introduction of the <code>isValid()</code> function. This function tests whether a value meets a validation or data type rule and can be used to replace a large number of type-specific functions such as <code>isArray()</code>, <code>isBinary()</code>, <code>isBoolean()</code>, <code>isDate()</code>, <code>isNumeric()</code> and <code>isSimpleValue()</code> etc.
</li>
<li>Stored Procedures &#8211; I often favour the use of stored procedures over standard queries. Not only do they add an additional level of performance, they provide an additional level of security; ColdFusion does not do any raw processing of queries in the web code, it simply passes variables down the wire to the database server.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Conclusion</h3>
<p>The goal of the <abbr title="Payment Card Industry">PCI</abbr> Data Security Standard is to protect cardholder data that is processed, stored or transmitted by merchants. The security controls and processes required by <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> are vital for protecting cardholder account data, including the <abbr title="primary account number">PAN</abbr> &#8211; the primary account number printed on the front of a payment card. Merchants and any other service providers involved with payment card processing must never store sensitive authentication data after authorisation. This includes sensitive data that is printed on a card, or stored on a card’s magnetic stripe or chip &#8211; and personal identification numbers entered by the cardholder.</p>
<p>By following the points made above, you will go a long way to meeting the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> guidelines, whilst also securing your infrastructure and applications in a more general sense.</p>
<p><strong>Caveat:</strong> The views and comments written in this article are provided as a guideline. I hold no responsibility for the security of your applications and data based upon the information provided.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe&#039;s LiveCycle Powered by Amazon&#039;s Cloud</title>
		<link>http://www.simonwhatley.co.uk/adobes-livecycle-powered-by-amazons-cloud</link>
		<comments>http://www.simonwhatley.co.uk/adobes-livecycle-powered-by-amazons-cloud#comments</comments>
		<pubDate>Wed, 14 Jan 2009 12:07:00 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Adobe ColdFusion]]></category>
		<category><![CDATA[Adobe LiveCycle]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[chief rival]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[content services]]></category>
		<category><![CDATA[correspondence management]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[elastic cloud computing]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[infrastructure web services platform]]></category>
		<category><![CDATA[installation of LiveCycle ES Solution Components]]></category>
		<category><![CDATA[Internet-based information technology services]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[LiveCycle Enterprise Suite]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[process management]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[recent technology trends]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[server software product]]></category>
		<category><![CDATA[simple storage service]]></category>
		<category><![CDATA[technology infrastructure]]></category>
		<category><![CDATA[term cloud computing]]></category>
		<category><![CDATA[utility computing]]></category>
		<category><![CDATA[Web Browser]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1757</guid>
		<description><![CDATA[Adobe recently announced, in conjunction with Amazon, that they would bring LiveCycle to Amazon’s Elastic Compute Cloud (EC2).]]></description>
			<content:encoded><![CDATA[<p>Adobe recently announced, in conjunction with Amazon, that they would bring LiveCycle to Amazon&#8217;s Elastic Compute Cloud (<abbr title="Elastic Compute Cloud">EC2</abbr>). To quote Adobe:</p>
<blockquote><p>
Adobe is now offering developers subscribed to the Adobe Enterprise Developer Program access to their own virtual instance of LiveCycle ES through LiveCycle ES Developer Express. LiveCycle ES Developer Express provides a pre-configured, virtualized installation of LiveCycle ES Solution Components in a self-contained development environment. LiveCycle ES Developer Express is hosted on the Amazon Elastic Compute Cloud (Amazon EC2). AEDP members can test, build, store and develop their applications in a cloud-base environment where all LiveCycle ES applications are pre-configured and running. The Adobe Enterprise Developer Program will offer a minimum of 10 hours of runtime per month, with additional hours to be available separately.</p></blockquote>
<h3>What is cloud computing and why is it important?</h3>
<p>The term cloud computing, as used by some commentators, refers to the use of scalable, real-time, Internet-based information technology services and resources. This somewhat nebulous concept incorporates software as a service (<abbr title="software as a servic">SaaS</abbr>), utility computing, <a href="http://en.wikipedia.org/wiki/Web_2.0" title="Wikipedia: Web 2.0" target="_blank" rel="nofollow">Web 2.0</a> and other recent technology trends. The common theme stresses reliance on the Internet for satisfying the computing needs of users, without them needing knowledge of, expertise with, or control over the technology infrastructure that supports them. An often-quoted example is <a href="http://www.google.com/apps/intl/en/business/index.html" title="Google Apps" target="_blank" rel="nofollow">Google Apps</a>, which provides common business applications online that are accessed from a web browser, while the software and data are stored on Google servers.</p>
<p>The cloud element of cloud computing derives from a metaphor used for the Internet, from the way it is often depicted in computer network diagrams, and is an abstraction for the complex infrastructure it conceals.</p>
<h3>How do Adobe and Amazon fit into the equation?</h3>
<p>Adobe and Amazon have similar goals. They both want to gain more share of the enterprise market. Amazon needs to convince the enterprise that its version of the cloud is capable of supporting the demands of enterprise applications. On the other hand Adobe wants to convince the developers who already use <abbr title="Amazon Web Services">AWS</abbr> that LiveCycle is the platform of choice for the enterprise.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>What is Adobe LiveCycle?</h3>
<p><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/logo_adobe_livecycle1.jpg" alt="Adobe LiveCycle" title="Adobe LiveCycle" width="102" height="105" class="alignleft size-full wp-image-1769" />Adobe&#8217;s <a href="http://www.adobe.com/products/livecycle/" title="Adobe LiveCycle" target="_blank" rel="nofollow">LiveCycle Enterprise Suite</a> is a <abbr title="Java 2 Enterprise Edition">J2EE</abbr>-based server software product used to build applications that automate a broad range of business processes for enterprises and government agencies.</p>
<p>LiveCycle combines technologies for data capture, information assurance, document output, content services, and process management to deliver solutions such as account opening, services and benefits enrollment, correspondence management, request for proposal processes, and other manual based workflows.</p>
<h3>What are Amazon Webservices?</h3>
<p><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/logo_aws.gif" alt="Amazon Webservices Logo" title="Amazon Webservices Logo" width="164" height="60" class="alignright size-full wp-image-1762" />Since early 2006, <a href="http://aws.amazon.com" title="Amazon Web Services" target="_blank" rel="nofollow">Amazon Web Services</a> (<abbr title="Amazon Web Services">AWS</abbr>) has provided companies of all sizes with an infrastructure web services platform in <a href="http://en.wikipedia.org/wiki/Cloud_computing" title="Wikipedia: Cloud Computing" target="_blank" rel="nofollow">the cloud</a>. With <abbr title="Amazon Web Services">AWS</abbr> you can requisition compute power, storage, and other services–gaining access to a suite of elastic <abbr title="Information Technology">IT</abbr> infrastructure services as your business demands them. With <abbr title="Amazon Web Services">AWS</abbr> you have the flexibility to choose whichever development platform or programming model makes the most sense for the problems you’re trying to solve. You pay only for what you use, with no up-front expenses or long-term commitments, making <abbr title="Amazon Web Services">AWS</abbr> a cost-effective way to deliver applications to customers and clients.</p>
<h3>How do they fit together?</h3>
<p>Essentially, Adobe has put a Red Hat <a href="http://www.jboss.org" title="JBoss" target="_blank" rel="nofollow">JBoss</a> <abbr title="Java 2 Enterprise Edition">J2EE</abbr> stack on <abbr title="Amazon Web Services">AWS</abbr> and deployed LiveCycle on the stack. Adobe state that this platform is purely for prototyping, developing and testing applications, rather than production environments, but that is likely to change.</p>
<h3>The future</h3>
<p>Deploying LiveCycle on <abbr title="Amazon Web Services">AWS</abbr> has wider implications, not only for Adobe products. By setting up a J2EE stack on <abbr title="Amazon Web Services">AWS</abbr> it makes it possible to deploy any Java-based application; yes that does mean one developed in Adobe&#8217;s ColdFusion or indeed its chief rival, Railo.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/adobes-livecycle-powered-by-amazons-cloud/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

