<?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>Andrew Gormley &#187; Coding</title>
	<atom:link href="http://andrewgormley.com/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewgormley.com</link>
	<description>Andrew Gormley is a Philadelphia-based Front End Developer who has been known to have higher standards for his CSS than for his friends.</description>
	<lastBuildDate>Thu, 26 Aug 2010 13:08:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Realign Step 2: Establishing a Voice</title>
		<link>http://andrewgormley.com/2010/realign-step-2-establishing-a-voice/</link>
		<comments>http://andrewgormley.com/2010/realign-step-2-establishing-a-voice/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:42:12 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Realign]]></category>

		<guid isPermaLink="false">http://andrewgormley.com/?p=976</guid>
		<description><![CDATA[Now that I know my visitors and their capabilities, it's time to dive into what they come to my site to see and then begin to build my messaging and branding around that.]]></description>
			<content:encoded><![CDATA[<p>Now that I know my visitors and their capabilities, it&#8217;s time to dive into what they come to my site to see and then begin to build my messaging and branding around that.<br />
<span id="more-976"></span></p>
<h3>What Are You Doing Here?</h3>
<p>Well, more often than not you&#8217;re looking at technology-based articles or screencasts. One of my most popular posts, with several hundred unique visitors is the <a href="http://andrewgormley.com/2009/google-sync-vs-mobileme/">Google Sync vs. MobileMe</a> article and its ensuing <a href="http://andrewgormley.com/2009/google-sync-follow-up/">follow-up</a>. The screencasts, especially ones that teach web or Photoshop-related topics, regularly receive a good number of visits as well. This is a good thing, because these are definitely the paths I&#8217;d like to pursue when moving forward with this blog. There are only 4 pages on the site: About, Portfolio, Archives, and Contact. About and Portfolio get the most views, despite not being updated since the site has gone live. Archives seems like a huge gateway for people to find what they need, though I believe the ability to sort this page by certain criteria (popularity, # of comments, etc) would be a massive usability improvement.</p>
<h3>Trimming the Fat, the Message, and more&#8230;</h3>
<p>Taking a bird&#8217;s eye view of the site, it&#8217;s definitely geared towards technology; both physical things like electronics as well as intangibles like code and video. There&#8217;s a bias towards Apple, for sure, but not in an anti-Windows way. Occasionally I&#8217;ll post personal (life) things, reviews, and little bits of fun Photoshoppery. So, thematically, it&#8217;s all over the place. I think the first thing I&#8217;d like to do is narrow my focus down a bit to a few key points. I really like the way Tumblr handles this, where everything falls into 7 categories:</p>
<ul>
<li>Text</li>
<li>Photo</li>
<li>Quote</li>
<li>Link</li>
<li>Chat</li>
<li>Audio</li>
<li>Video</li>
</ul>
<p>Taking that a step further is a company like Panic, whose blog uses different treatments depending on what category a post falls into. Observe: <a href="http://www.panic.com/blog/">http://www.panic.com/blog/</a></p>
<p>So I think my new site will have a small number of vague primary categories (as opposed to my current, very specific 30+) and then pertinent subcategories for people who want more granular control over their browsing experience. Another option would be to keep the vague primary categories and then fill in the gaps with tags or Wordpress 3.0&#8217;s new taxonomy system. All of this will be covered in a later step, for sure.</p>
<p>The homepage will no longer be simply just the blog; a years worth of data has proven that&#8217;s the best way to increase the bounce rate well above average. I intend to create a page that briefly tells people who I am, perhaps showcases some recent work, and then gives a few samples of things from other areas of the site.﻿</p>
<p>In a nutshell, here is how I would describe myself:</p>
<blockquote><p>I&#8217;m a web designer by trade, passionate about cutting edge technologies and semantic markup. I love utilizing video not only in the form of screencasts to teach but also in personal or corporate projects as a means of communication or just having fun. I work with all types of clients, big and small, and love discovering great new things to share with the community.</p></blockquote>
<p>I have to make sure I build my brand around that core message, which shouldn&#8217;t be too hard since I practice what I&#8217;m preaching.</p>
<h3>What Am I Found For?</h3>
<p>Most of the terms I&#8217;m found for correlate to what I discussed in the first paragraph: apple vs google, mobileme vs google sync, etc. I also get a lot of traffic from &#8220;How To&#8230;&#8221; searches in regards to web development on Mac. A surprising number of people also Google my full name to get to the site. Not sure if they&#8217;re looking for one of the other Andrew Gormleys out there in the world, but it&#8217;s hard to imagine as the people who find me via that search term tend to stay on the site for an average of 5-6 minutes. In this regard, I think I&#8217;ll just keep doing what I&#8217;m doing, but start to trim the fat and work on more concise post titles for easier <a href="http://www.alistapart.com/articles/findabilityorphan/">findability</a>.</p>
<h3>Summing It Up</h3>
<p>I now have a really good understanding of my audience and what it is I&#8217;d like to say from a messaging point of view. Fortunately these two things are very similar in nature so it&#8217;s not a matter of sacrificing one or the other, but simply making the two more cohesive.</p>
<h3>The Next Step</h3>
<p>In the next installment, I&#8217;ll actually start diving in concept art and mapping out ideas for the new site. This is where I think things will start to get really interesting, so stay tuned as I continue on my journey to a great new site.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewgormley.com/2010/realign-step-2-establishing-a-voice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realign Step 1: Finding the Audience</title>
		<link>http://andrewgormley.com/2010/realign-step-1-finding-the-audience/</link>
		<comments>http://andrewgormley.com/2010/realign-step-1-finding-the-audience/#comments</comments>
		<pubDate>Thu, 06 May 2010 18:10:27 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Realign]]></category>

		<guid isPermaLink="false">http://andrewgormley.com/?p=967</guid>
		<description><![CDATA[As promised, here is the first of a multi-part series that goes through the process of realigning my site not only to better address my target audience, but to also tackle issues that I&#8217;ve noticed or had to work around since the initial launch (over a year and a half ago). These principals could be [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, here is the first of a multi-part series that goes through the process of realigning my site not only to better address my target audience, but to also tackle issues that I&#8217;ve noticed or had to work around since the initial launch (over a year and a half ago). These principals could be applied to any type of site you work on, albeit corporate, personal, or otherwise. I hope the method and information you find here proves useful.<span id="more-967"></span></p>
<h3>Preface</h3>
<p>It would probably help if you read Cameron Moll&#8217;s most excellent article <a href="http://www.alistapart.com/articles/redesignrealign/">Good Designers Redesign, Great Designers Realign</a> on <a href="http://www.alistapart.com/">A List Apart</a> before continuing with this or any other article in the series.</p>
<h3>Establishing The Audience</h3>
<p>The first thing I always do in situations where a realign is in order is check Google Analytics as well as my server log files (in this case, via Urchin) to get an idea of what people are up to when they come to my site. I decided to also check the main RSS feed to see if people are consuming content that way, since that&#8217;s usually how I like to manage my information intake.</p>
<p>Using the window of time April 5th, 2009 to April 5th, 2010, here are the a few points that I&#8217;ve gleaned:</p>
<ul>
<li>Average unique visitors per day: 52</li>
<li>Average pageviews per day: 137</li>
<li>Average bounce rate: 72.2%</li>
<li>Average time spent on site: 00:01:54</li>
<li>Average pages per visit: 2.34</li>
<li>Current number of RSS subscribers: 230</li>
<li>Average number of RSS subscribes: 137</li>
</ul>
<p>Sadly, that was more traffic than I expected to be receiving on a day-to-day basis due to my sporadic updating and varying types of content. The bounce rate is definitely something that needs to be addressed, as 72% is pretty terrible any way you present it. More often than not bounce rate is tied to usability issues: unclear navigation, display issues, and much more can all factor in to bounce rate. I like that there are actually RSS subscribers, even though it was difficult information for me to ascertain. I may end up implementing FeedBurner for the RSS feed simply as a way of more easily tracking who has subscribed to the site.</p>
<p>Next up, I want to see what my user&#8217;s capabilities are. This includes everything from their web browser to screen resolution to operating system. The numbers were pretty much on par with what I thought they&#8217;d be:</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Realign Step 1.001.png" src="http://andrewgormley.com/wp-content/uploads/2010/05/Realign-Step-1.001.png" border="0" alt="Realign Step 1.001.png" width="516" height="387" /></p>
<p>Then I decided to break down the top three browsers into their respective version numbers to gain a little more insight into who&#8217;s been checking in:</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Realign Step 1.002.png" src="http://andrewgormley.com/wp-content/uploads/2010/05/Realign-Step-1.002.png" border="0" alt="Realign Step 1.002.png" width="516" height="387" /></p>
<p>The site is optimized for all but two browser versions featured above: IE 5.5 and 6. It&#8217;s almost mind boggling to think that anyone in 2009 or 2010 has used Internet Explorer 5.5 &#8211; those folks are outliers and won&#8217;t be considered as part of my target audience. I&#8217;ve also already made it clear that IE6 isn&#8217;t supported on any current or future incarnations of my site. Currently, users of those browsers can still view my site content; moving forward with the new design they&#8217;ll be presented with a polite splash page encouraging them to get with the program.</p>
<p>What was really surprising were the amount of visitors using the latest version of Safari. The 23% of users running version 3 were from April 2009 to roughly July 2009 (Safari 4 was released in June). In the past 6 months, nearly 96% of all Safari visitors are running the most current build. I suppose that&#8217;s the benefit of proactively pushing out updates to your users (Microsoft, take note!).</p>
<p>Here are a few of the other stats worth noting:</p>
<ul>
<li>Operating systems were split pretty evenly between Mac and Windows (both roughly 46%). Some surprises in the OS list include: PlayStation 3, PlayStation Portable, and Blackberry</li>
<li>Most common screen resolution is 1280&#215;800. Smallest screen resolution (not including mobile) was 1024&#215;768.</li>
</ul>
<h3>To Sum It All Up</h3>
<p>My everyday visitor is running a recent version of Firefox or the most current version of Safari on a Mac or Windows PC with an average resolution of 1280&#215;800, making it safe to assume they&#8217;re using a laptop. If they don&#8217;t leave immediately from the homepage, they tend to browse at least 2 pages of the site, spending roughly 1 minute on each page.</p>
<h3>Moving Forward</h3>
<p>In my next entry, I&#8217;ll start to address the goals of the site and what messaging (if any) I&#8217;d like to change to better convey what it is I offer. This will likely also touch on a bit of branding as well, though the only visuals we&#8217;ll be working with will most likely be graphs. Look for that article coming soon.</p>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://andrewgormley.com/2010/realign-step-1-finding-the-audience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Web Development on the Cheap</title>
		<link>http://andrewgormley.com/2010/mac-web-development-on-the-cheap/</link>
		<comments>http://andrewgormley.com/2010/mac-web-development-on-the-cheap/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 14:54:18 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://andrewgormley.com/?p=927</guid>
		<description><![CDATA[As you (hopefully) know, I'm a web developer by trade. Whenever possible, I try to take time to help other aspiring designers and developers get their feet wet when they make the switch to Macs. There's a refreshing amount of excellent software for Mac that will allow you to dive headlong into web development with a minimal investment on your part. Here's a list of what I consider the essential software that you can get for free or inexpensively, as well as a few paid alternatives.]]></description>
			<content:encoded><![CDATA[<p>As you (hopefully) know, I&#8217;m a web developer by trade. Whenever possible, I try to take time to help other aspiring designers and developers get their feet wet when they make the switch to Macs. There&#8217;s a refreshing amount of excellent software for Mac that will allow you to dive headlong into web development with a minimal investment on your part. Here&#8217;s a list of what I consider the essential software that you can get for free or inexpensively, as well as a few paid alternatives.</p>
<p><span id="more-927"></span></p>
<p class="bigger">The Foundation: Text Editors</p>
<p>There are a veritable plethora of text editors for Mac and nearly everyone you ask uses a different one they&#8217;re fanatical about.  This speaks volumes of the quality and diversity of the software available, but in the end it really comes down to your personal preference.</p>
<p><a href="http://textwrangler.com/products/textwrangler/"><img class="alignright size-full wp-image-934" title="Textwrangler" src="http://andrewgormley.com/wp-content/uploads/2010/03/tw.png" alt="" width="128" height="128" /></a></p>
<p>The best way to describe <a href="http://textwrangler.com/products/textwrangler/" target="_blank">TextWrangler</a> from Bare Bones Software is to say that it feels like TextEdit on steroids. You can use it as a simple text editor for sorting out content, but it also supports syntax highlighting for over 30 programming languages, one of the most robust find-and-replace actions of any text editor out there, and the ability to open and save files via its built-in FTP browser.</p>
<p>Though no longer under active development, <a href="http://smultron.sourceforge.net/" target="_blank">Smultron</a> is another free text editor that feels decidedly more Mac-like in its appearance. It utilizes an always-open sidebar similar to iTunes where you&#8217;ll view small (but resizable) thumbnails of all your open documents.  Some extra niceties that Smultron has over TextWrangler is the ability to edit in full screen mode, view code in split view, as well as a pretty nifty snippets manager for quick access to frequently-used code.</p>
<p><a href="http://www.macromates.com"><img class="alignleft size-full wp-image-938" title="TextMate" src="http://andrewgormley.com/wp-content/uploads/2010/03/tm.png" alt="" width="128" height="128" /></a>You can&#8217;t talk about Mac text editors without a very vocal show of support for <a href="http://macromates.com/" target="_blank">Textmate</a>. It&#8217;s easily one of my most used applications and for very good reason: it&#8217;s literally packed with features and functionality, some of which can&#8217;t be found anywhere else. The web development features that are particularly useful include a built-in code preview (using Webkit), inline W3C validation for all of the HTML-ers, code snippets, and bundles, which can be written freely by anyone and add even more functionality to the editor. Textmate isn&#8217;t free, but for all it does, the $55 price tag is a steal.</p>
<p class="bigger">Moving and Shaking: FTP</p>
<p><a href="http://cyberduck.ch"><img class="alignright size-full wp-image-940" title="Cyberduck" src="http://andrewgormley.com/wp-content/uploads/2010/03/cyberduck.png" alt="" width="128" height="128" /></a>The clear winner for free FTP program (and possibly coolest icon) on the Mac goes to <a href="http://cyberduck.ch/" target="_blank">Cyberduck</a>. It supports multiple protocols including: FTP, SFTP, WebDAV (MobileMe), Amazon S3, and even Rackspace Cloud Server access. It has excellent OS-wide integration and, perhaps more important, plays well with most text editors.  You can right click on a remote file from within Cyberduck and edit it with your favorite text editor, then once you save it Cyberduck automagically uploads the file back to the remote server with no intervention needed on your part.</p>
<p>The guys over at Panic know great design, which is why it should come as no surprise that <a href="http://panic.com/transmit/" target="_blank">Transmit</a> is one of the best looking and most functional FTP clients on the Mac.  One of its killer features is the ability to create droplets: think of them as mini-Transmits that allow you to upload files without even opening the program. Additionally, it supports nearly every protocol you can think of and sports advanced editing of a variety of files remotely (most notably images). All of this packed into an elegant, intuitive UI makes Transmit the best $29.95 you&#8217;ll ever spend.</p>
<p><a class="thickbox" href="http://andrewgormley.com/wp-content/uploads/2010/03/flow-screenshot.png"><img class="alignright size-medium wp-image-944" title="Flow Screenshot" src="http://andrewgormley.com/wp-content/uploads/2010/03/flow-screenshot-300x224.png" alt="" width="300" height="224" /></a>A relative newcomer to the Mac is <a href="http://extendmac.com/flow/" target="_blank">Flow</a>, a robust FTP program that was a big part of the last MacHeist and has been gaining more and more momentum. When you launch Flow, you&#8217;ll immediately notice it breaks away from the standard FTP interface for something that&#8217;s considerably more Finder-esque.  Compound that with some advanced features not found in many other Mac FTP programs like multiple connections for simultaneous file uploads, right clicking to copy remote URLs, and bulletproof QuickLook integration and you have yourself one fine file transferrer. $25 and it could be yours.</p>
<p class="bigger">Save the Environment</p>
<p><img class="alignright size-full wp-image-950" title="MAMP" src="http://andrewgormley.com/wp-content/uploads/2010/03/mamp.png" alt="" width="128" height="128" />As far as I&#8217;m concerned, the only testing environment you need to set up on your Mac is <a href="http://www.mamp.info/en/mamp/index.html" target="_blank">MAMP</a>, which stands for Macintosh, Apache, MySQL, and PHP. The latest version clocks in at a hair over 200MB.  It&#8217;s self-contained and can live anywhere on your hard drive, essentially making it the ideal portable development environment. All of your webpages are viewable in the htdocs folder contained within the MAMP directory and can be accessed, by default, simply by visiting http://localhost:8888 while MAMP is running. Get MAMP absolutely free now and start your rapid development.</p>
<p class="bigger">Test Your Code, Not Your Patience</p>
<p>The bane of any web developers existence is Internet Explorer and while we might not like it, it needs to be accounted for. Boot Camp is a good idea in theory, but would severely break your workflow should you have to reboot every time you made a change. That&#8217;s where virtualization comes in: boot up Windows (or any other OS, really) from within OS X for rapid testing and debugging.</p>
<p>Sun&#8217;s <a href="http://www.virtualbox.org/" target="_blank">VirtualBox</a> has come a long way over the years and in many respects can stand toe-to-toe with the paid virtualization clients out there. It fully supports multiple versions of Windows all the way back to 2000, many distros of Linux, and even BSD variants. It&#8217;s fast, intuitive, and gets the job done while leaving your wallet intact.</p>
<div id="attachment_947" class="wp-caption aligncenter" style="width: 310px"><a class="thickbox" href="http://andrewgormley.com/wp-content/uploads/2010/03/abstraction.png"><img class="size-medium wp-image-947 " title="abstraction" src="http://andrewgormley.com/wp-content/uploads/2010/03/abstraction-300x215.png" alt="" width="300" height="215" /></a><p class="wp-caption-text">Holy layer of abstraction, Batman!</p></div>
<p>I won&#8217;t get into the <a href="http://www.parallels.com/" target="_blank">Parallels</a> vs <a href="http://www.vmware.com/products/fusion/" target="_blank">VMware Fusion</a> speed debates (<a href="http://andrewgormley.com/2008/parallels-vs-vmware/" target="_blank">though I already have</a>) because with each new version released one becomes faster than the other.  Priced identically at $79.99, these programs offer incredible speeds, loads of configuration options for power users, and enhanced graphics capabilities (for when you take a break from coding for a quick frag-fest). You can sometimes get Parallels at a discounted rate if you follow software sales like MacHeist or MacUpdate Promo (actually happening right now, including Parallels!), so some users opt to wait for that and save a bit of green. Beyond minor aesthetic details, each of the programs behaves similarly and in the end should cut your Windows testing time down significantly.</p>
<p class="bigger">That&#8217;s All, Folks</p>
<p>Hopefully with all of the aforementioned tools you&#8217;ll be able to quickly and effortlessly jump into Mac web development while keeping your bank account at a respectable level.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewgormley.com/2010/mac-web-development-on-the-cheap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Video: First YouTube, Now Vimeo</title>
		<link>http://andrewgormley.com/2010/html5-video-first-youtube-now-vimeo/</link>
		<comments>http://andrewgormley.com/2010/html5-video-first-youtube-now-vimeo/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 15:04:25 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://andrewgormley.com/?p=867</guid>
		<description><![CDATA[After getting a lot of (offline) comments and questions about my foray in HTML5 video, it seems like the rest of the online world is also making tremendous leaps away from Flash and towards this slick new method of serving files.]]></description>
			<content:encoded><![CDATA[<p>After getting a lot of (offline) comments and questions about <a title="HTML5 Video: Cooking With Fire" href="http://andrewgormley.com/2009/html5-video-cooking-with-fire/">my foray in HTML5 video</a>, it seems like the rest of the online world is also making <a title="YouTube Adds Support For HTML5 Video" href="http://www.youtube.com/html5" target="_blank">tremendous</a> <a title="Vimeo Begins HTML5 Video Beta" href="http://www.vimeo.com/blog:268" target="_blank">leaps</a> away from Flash and towards this slick new method of serving files.</p>
<p>What does this mean for most people?  In a word, nothing&#8230; yet (ok, that was two words).  The fact of the matter is that until we have full browser support for the H.264 video codec, which is currently only available in Webkit-based browsers like Google Chrome and Safari, this seamless and superior technology will never be experienced by the majority.</p>
<p>I don&#8217;t anticipate Internet Explorer ever fully supporting the video standard or the code to actually implement it (c&#8217;mon, 8 versions in and they&#8217;re just now figuring out how to render web pages correctly), but for this to be anything close to a victory over Flash, Firefox needs to get with the friggin program.  While it&#8217;s true that Firefox does support the code to get it working, the videos need to be encoded using Theora as opposed to H.264—which, in short, requires two versions of the same file, doubling the necessary server space.  You can see how this would be a problem for a company like YouTube, whose server farms are probably running at max capacity with a ridiculous 12,000 videos views <strong><em>per second.</em></strong></p>
<p>So, while I personally think it&#8217;s great that those of us who opt for Webkit browsers will have an overall better user experience, not to mention that videos from both YouTube and Vimeo are now accessible to mobile platforms without the need for Flash, I would love to see this technology rolled out to the populace as a whole, which will require a <a href="http://www.mozilla.com/en-US/firefox/firefox.html">massive amount of feature requests</a> and <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">a miracle</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewgormley.com/2010/html5-video-first-youtube-now-vimeo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Video: Cooking With Fire</title>
		<link>http://andrewgormley.com/2009/html5-video-cooking-with-fire/</link>
		<comments>http://andrewgormley.com/2009/html5-video-cooking-with-fire/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 19:16:49 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://andrewgormley.com/?p=785</guid>
		<description><![CDATA[I recently had the good fortune of working on a small project that lent itself to some experimentation with newer technologies.  The goal was to create a simple landing page with some light graphics, pictures, and a video.  I had the option to let it live inside the existing ecosphere of the site (using PHP to include site-wide JS and CSS) or opt for a leaner, more agile output. I took the latter route as it was something I've done a lot of reading on and eventually wanted to do with my site for either screencasts, general portfolio work, or both. I dove headlong into HTML 5 and was pleasantly surprised by the results.  I now present you with the process, the pitfalls, and other considerations.]]></description>
			<content:encoded><![CDATA[<p>I recently had the good fortune of working on a small project that lent itself to some experimentation with newer technologies.  The goal was to create a simple landing page with some light graphics, pictures, and a video.  I had the option to let it live inside the existing ecosphere of the site (using PHP to include site-wide JS and CSS) or opt for a leaner, more agile output. I took the latter route as it was something I&#8217;ve done a lot of reading on and eventually wanted to do with my site for either screencasts, general portfolio work, or both. I dove headlong into HTML 5 and was pleasantly surprised by the results.  I now present you with the process, the pitfalls, and other considerations.</p>
<p><span id="more-785"></span></p>
<p class="bigger">First Things First</p>
<p>Obviously the first thing you&#8217;ll need is a high quality source file. (Note: any file will do, but encoding from the original, lossless source always yields best results).  In my case, I was working with an HD video file that I just finished editing in Final Cut and exported using Compressor.  If you&#8217;re exporting from an editing suite and not intending to serve up an HD version of your video, then exporting a standard DV file will work. If you&#8217;re taking the video directly from a video camera like a Flip Mino, Kodak Zi8, or even your phone, then chances are your videos are already compatible.</p>
<p class="bigger">A Brief and Incomplete History of Video Codecs and Containers</p>
<p>Working with video can get overwhelming very quickly if you&#8217;re unfamiliar with the terminology or concepts, so here&#8217;s a quick breakdown of video as well as the two types we&#8217;ll be dealing with: MP4 and Ogg.</p>
<p>It&#8217;s safe to assume that if you download videos from the internet, you&#8217;ve encountered a few of the more common extensions: MOV, MPG, AVI and unfortunately WMV. Those files are known as video containers. Think of a video container as you would a ZIP file: an all-in-one package that contains the content you&#8217;re really after.  In the case of video containers, the files within are known as streams or tracks and represent a variety of things including video, audio, subtitles, and more.</p>
<p>Ogg is a free, open-standard container format supported natively by Firefox 3.5+, Google Chrome, Opera and most distributions of Linux. You can also watch Ogg content on OS X or Windows easily enough by installing the appropriate codecs. For our purposes, we&#8217;ll be dealing with the OGV container, which is specific to video.  Within the OGV container, we&#8217;ll have two tracks: the Ogg Video track known as &#8220;Theora&#8221; and the Ogg Audio track known as &#8220;Vorbis&#8221;. Ogg file formats are on their way to becoming the standard way that Wikipedia delivers audio and video information, in hope of establishing this patent-free codec as the &lt;video&gt; standard.</p>
<p>MP4 is the container format of choice for Apple and most mobile platforms and is supported natively by Safari (Webkit), Flash video players, the iPhone, some Android phones, and also Google Chrome.  Within the MP4 files we&#8217;ll be working with, we&#8217;ll again have two tracks: &#8220;H.264&#8243; for video and &#8220;AAC&#8221; for audio. H.264, like Theora, is a video codec, but the comparisons end there. H.264 offers a plethora of options and features that are a result of it&#8217;s evolution over many years.  If you&#8217;ve ever watched a trailer on Apple&#8217;s site, a BluRay movie, and HD video on YouTube, or downloaded a movie/television show through iTunes, then you&#8217;ve encountered H.264 in one of it&#8217;s many profiles. H.264 profiles are the key to its versatility, as different profiles best serve different mediums. The Baseline H.264 profile is supported on the iPhone and some Android phones, while the Advanced Profile is used by BluRay discs for the ultimate in video quality.</p>
<p class="bigger">So, to recap:</p>
<p><strong>Ogg</strong></p>
<ul>
<li>Ogg is supported natively by Firefox 3.5+, Google Chrome, Opera, and most Linux distros</li>
<li>Ogv is the container we&#8217;ll be working with</li>
<li>The video track within an ogv container is known as &#8220;Theora&#8221;</li>
<li>The audio track within an ogv container is known as &#8220;Vorbis&#8221;</li>
</ul>
<p><strong>MP4</strong></p>
<ul>
<li>MP4 is supported natively by Safari, Google Chrome, iPhone OS, Android OS, OS X, and Flash video players</li>
<li>MP4 is also the name of the container we&#8217;ll be working with</li>
<li>The video track within our mp4 container is known as &#8220;H.264&#8243;</li>
<li>The audio track within our mp4 container is known as &#8220;AAC&#8221;</li>
</ul>
<p class="bigger">Acquiring the Encoders</p>
<p>I&#8217;ll preface by saying that I had a hell of a time finding a reliable GUI-based Theora encoder. The <a title="XIPH OGG Quicktime Components" href="http://www.xiph.org/quicktime/" target="_blank">Quicktime plugin</a> was buggy and didn&#8217;t always output files as expected, even resulting in a few crashes. <a title="Firefogg Video Encoder" href="http://firefogg.org/" target="_blank">Firefogg</a>, a highly recommended Firefox extension, simply did not work for me while dedicated encoding programs that I looked into, particularly Episode and Sorenson Squeeze, were both absent of the Theora codec entirely. This left me with the command line alternative: <a title="ffmpeg2theora" href="http://v2v.cc/~j/ffmpeg2theora/" target="_blank">ffmpeg2theora</a>.  For those of you not comfortable working in the command line, fear not, as the calls to output a Theora video file are quick and easy. For exporting the H.264 video, I used the free (and incredibly nifty) <a title="Handbrake Video Encoder" href="http://handbrake.fr/" target="_blank">Handbrake</a>, which is available for Windows, OS X, and Linux.</p>
<p class="bigger">You Down With Ogg?</p>
<p><a class="thickbox" href="http://andrewgormley.com/wp-content/uploads/2009/12/terminal.png"><img class="alignright size-medium wp-image-797" title="OS X Terminal" src="http://andrewgormley.com/wp-content/uploads/2009/12/terminal-300x187.png" alt="OS X Terminal" width="300" height="187" /></a>After installing ffmpeg2theora, you&#8217;ll have to open either your terminal (OS X/Linux) or command prompt (Windows). From there, you can type &#8220;ffmpeg2theora &#8211;help&#8221; to get your bearings or just base your settings off of mine. After playing with a few variations of settings, the ideal preset for my project came out to look like this:</p>
<p>ffmpeg2theora &#8211;videoquality 6 &#8211;audioquality 4 &#8211;max_size 416&#215;232 &#8211;optimize InputFile.mov</p>
<ul>
<li>videoquality X — where X can be any number from 0 to 10</li>
<li>audioquality X — where X can be any number from -2 to 10</li>
<li>max_size tells the encoder what the output size should be. If removed, input and output source size will be the same.</li>
<li>optimize adds some time to the encode process, but gives you the best possible balance of quality and file size</li>
<li>InputFile.mov can be almost any type of video container.  A shortcut to inputting it is to simply drag and drop the file into your Terminal/Command Prompt after writing out the above settings</li>
</ul>
<p>My uncompressed input file was 106MB at a resolution of 1280&#215;720.  Using these settings the file size came down to just a fraction above 16MB.  I easily could&#8217;ve gone lower than that, but didn&#8217;t want any visible video degradation and anything below 20MB seemed like a reasonable streaming video size.</p>
<p class="bigger">H.264 U</p>
<p><a class="thickbox" href="http://andrewgormley.com/wp-content/uploads/2009/12/handbrake.png"><img class="alignright size-medium wp-image-798" title="Handbrake GUI" src="http://andrewgormley.com/wp-content/uploads/2009/12/handbrake-300x252.png" alt="Handbrake GUI" width="300" height="252" /></a>Encoding with Handbrake should be much easier for the average person since there&#8217;s a nice, clean interface in which to work. After launching the program, select your input source and, from the Preset Drawer, select &#8220;iPhone and iPod Touch&#8221;. This setting isn&#8217;t specifically for these devices, but more a good starting point from a compatibility point of view. From the top down, choose these settings:</p>
<ul>
<li>Container: MP4</li>
<li>Make sure &#8220;Web Optimized&#8221; is checked</li>
<li>Video Codec: H.264</li>
<li>Framerate: Same as source</li>
<li>Constant Quality: This is (very loosely) akin to Theora&#8217;s 0-10 scale and can be tested by enabling live preview in Handbrake to view your settings live on the video before committing to a lengthy encode.  Power users could also simply specify a Target Size or Average Bitrate.</li>
<li>Under the &#8220;Audio&#8221; tab, make sure that the Samplerate is 44.1 as 48 is overkill for web video.</li>
<li>Click on the Picture Settings icon and then adjust the video to your desired size. You may also crop here if necessary.</li>
<li>Finally, before submitting the export, you can click on the Preview Window icon to get a live, 5-60 second preview of your video with the settings you&#8217;ve chosen applied.</li>
</ul>
<p>Going from the aforementioned uncompressed file I was able to get the MP4 down to 17Mb, which is a space savings of roughly 600% with relatively no visible pixel degradation or blurring.</p>
<p class="bigger">The Code To Get It Done</p>
<p>The HTML5 code to embed a video is super simple and very much akin to using the &lt;img&gt; tag:</p>
<p style="padding-left: 30px;">&lt;video src=&#8221;MyVideo.ogv&#8221;&gt;&lt;/video&gt;</p>
<p>You can take it a step further and add a width and a height, just like with images:</p>
<p style="padding-left: 30px;">&lt;video src=&#8221;MyVideo.ogv&#8221; width=&#8221;640&#8243; height=&#8221;480&#8243;&gt;&lt;/video&gt;</p>
<p>There are also a number of options you can add on to your video tag, they are: controls, autoplay, autobuffer. They&#8217;re all pretty self explanatory, and equally easy to implement. For example:</p>
<p style="padding-left: 30px;">&lt;video src=&#8221;MyVideo.ogv&#8221; width=&#8221;640&#8243; height=&#8221;480&#8243; controls autoplay&gt;&lt;/video&gt;</p>
<p>The above line tells the browser to use it&#8217;s native controls for video and autoplay as soon as the page is done loading. You could swap autoplay with autobuffer to have the video begin downloading right away and then have the user initiate playback using the native browser controls. The options aren&#8217;t endless, but they&#8217;re certainly nice to have.</p>
<p>The only thing remaining is specifying which video will work in which browser. Rather than wasting away precious bandwidth by loading two movies and letting the browser decide which one it can handle, all you have to do is use the &lt;source&gt; element of HTML5 to tell the browser which video to download.  The source element looks like this:</p>
<p>&lt;video width=&#8221;640&#8243; height=&#8221;480&#8243; controls&gt;</p>
<p><span style="padding-left: 30px;">&lt;source src=&#8221;MyVideo.ogv&#8221; type=&#8217;video/ogg; codecs=&#8221;theora, vorbis&#8221;&#8216;&gt;</span></p>
<p><span style="padding-left: 30px;">&lt;source src=&#8221;MyVideo.mp4&#8243; type=&#8217;video/mp4; codecs=&#8221;avc1.42E01E, mp4a.40.2&#8243;&#8216;&gt;</span></p>
<p>&lt;/video&gt;</p>
<p>So from that you can see that the video element no longer links to the file, but still contains the video attributes like width, height, autoplay, etc. Inside the video element we have two source elements that give us the path to the video as well as the video type, respectively.  Note that the type attribute is wrapped in single quotes, which is a little weird, but this is due to the fact that the codecs have to wrapped in quotation marks for this to work.</p>
<p class="bigger">Beware of the Mimes</p>
<p><img class="alignright size-medium wp-image-799" title="Sad Mime" src="http://andrewgormley.com/wp-content/uploads/2009/12/mime-240x300.jpg" alt="Sad Mime" width="240" height="300" />I ran into a hugely frustrating issue where my development server simply wasn&#8217;t playing the OGV video natively in Firefox or Chrome, yet when I tested my code locally everything worked perfectly. I tried different character encodings, files permissions, and much more before I figured out that it was a simple issue of the server not understanding what the hell an OGV file is in the first place.  There are two ways to remedy this issue:</p>
<ol>
<li>If you&#8217;re the server admin *and you know what you&#8217;re doing*, you can edit httpd.conf and add the following lines to cover all variations of OGG media (one per line, do no include commas): AddType video/ogg .ogm, AddType video/ogg .ogv, AddType video/ogg .ogg</li>
<li>If you&#8217;re not the server admin but have FTP access, create a file called &#8220;.htaccess&#8221; in your root directory and add the lines you see above in the same format.</li>
</ol>
<p>Note that the first method is a server-wide change whereas the second must be done on a domain-by-domain basis. Once I established my Mime types, it was smooth sailing.</p>
<p class="bigger">In Summary</p>
<p>HTML5 video is exactly what a lot of people have been waiting for and, beyond learning a little bit about video encoding, should be comfortable territory for any proficient HTML coder. The only obstacle at this point is Internet Explorer, which seems to have no intention of supporting either file type now or in future versions. Though it would be easy enough to write a Javascript workaround to fallback on YouTube in the event of IE, the native implementation and seamlessness are really what make the HTML5 video element shine. In the web development world, where working drafts take years to be approved and the inhabitants argue fruitlessly over the minutiae of doctypes or trailing slashes, HTML5 video feels like an evolutionary first step in the right direction: An open web that utilizes open source tech to solve usability conundrums.</p>
<p>You can view my finished page <a title="ARPRO Adventure 2009" href="http://www.arpro.com/adventure2009" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewgormley.com/2009/html5-video-cooking-with-fire/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
