• Organising media with Hazel - Part 1

    Let me get this out of the way straight away; I hate sorting media. It's a huge pain in the bum. Fortunately for you readers though, the only thing I hate worse than sorting media, is media disorder. I may <em>hate</em> sorting media, but I simply cannot sit by and do nothing when I see this in iTunes:
    <p style="text-align: center"><img class="size-full wp-image-8482 aligncenter" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-8.09.09-PM.png" alt="" width="157" height="156" /></p>
    <p style="text-align: center"><em>(Even taking this screenshot was grating.)</em></p>
    <p style="text-align: center"><em></em></p>
    I am a big fan of the way iTunes handles media. Lots of people hate it; and I can understand that. Above all else iTunes wants, needs,*<em>insists</em> on nice, orderly content. For people whose media collection is a bit haphazard, iTunes is a awash with grey music note boxes, and 'Unknown Artists' categories. It makes it hell to find what you want.

    In counterpoint though - and the other thing that iTunes does well; *it <em>rewards</em> the*diligent. Album artwork is gorgeous, TV shows can be sorted by season, music can be sorted by year &amp; genre. It's amazing!

    If there's one thing I want to be able to do with my media collection (other than watch it), is use it smartly. I want to be able to able to make a smart playlist that will load TV episodes on and off my iPhone &amp; iPad as I watch them. It want it all in one place, in one format. I want to be able to search. I want to be able to flip through TV show covers. I want iTunes to be able to tell me, "Hey buddy, you haven't watched the Sopranos for a while..." and have it be right!

    For those of you who have thought about this before, but given up because of the logistics*involved*getting this all done, I tell you -- it can be done. This is how.

    (Note: I used to convert TV shows to m4v, and then manually enter metadata about each show with*<a href="http://www.kerstetter.net/index.php/projects/software/metax" target="_blank">MetaX</a>. It was exact, but man, it took forever. I was wasting my life copying and pasting plot summaries from tv.com!)
    <h1>The Grand Plan</h1>
    So to get a good idea of where this tutorial is going, here's what I want to be able to do, all automatically. No user interaction needed at any step.

    <strong>Step 1: </strong>Receive Incoming Downloaded Video Files

    <strong>Step 2: </strong>Encode Video files into iTunes-friendly format

    <strong>Step 3:</strong> Rename Files

    <strong>Step 4: </strong>Tag files with metadata &amp; add artwork

    <strong>Step 5: </strong>Sort to folders &amp; Add to iTunes library

    Here's what I want the final outcome to look like:
    <p style="text-align: center"><img style="margin-left: auto;margin-right: auto" src="http://www.mactalk.com.au/wp-content/uploads/2010/08/Final-Result-in-iTunes.png" border="0" alt="Final Result in iTunes" width="590" height="374" /></p>
    ...and here's what it looks like from a file-management perspective.
    <p style="text-align: center"><img class="aligncenter" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-8.35.10-PM-e1280313792305.png" alt="Hazel Tutorial Pt 1 - Final Product " width="590" height="299" /></p>
    I have an external drive, which has a folder called*<em>TV Shows</em> on it. Within*TV Shows, there are*show sub-folders for shows (in this case*<em>Arrested Development</em>). Within a show folder, there are sub-folders for each season (<em>Season 1, Season 2</em> etc) and finally within those, the shows themselves. The shows are all encoded in h.264, and each episode is named with the format:

    <em>[Show Name] - S[Season Number]E[Episode Number].m4v</em>

    This is an important point which I will elaborate on later, but this kind of file/folder setup plays really well with XBMC-based media centre front-ends, like*<a href="http://www.plexapp.com/" target="_blank">Plex</a> or*<a href="http://www.boxee.tv/" target="_blank">Boxee</a>.

    <strong>Software needed: </strong>Hazel - US$21.95
    <p style="text-align: center"><img class="aligncenter size-full wp-image-8489" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Introducing-Hazel...png" alt="" width="412" height="259" /></p>
    One of my favourite tools on the Mac for organising media is a system preferences pane called*<a href="http://www.noodlesoft.com/hazel.php" target="_blank">Hazel</a>. What does Hazel do? In its own words:
    <blockquote>Hazel watches whatever folders you tell it to, automatically organizing your files according to the rules you create....Automatically put your music in your Music folder, movies in Movies. Keep your downloads off the desktop and put them where they are supposed to be.</blockquote>
    Sounds tame, but this is an insanely powerful tool. Once a file is dropped into the 'watch' folder/s of Hazel, it acts on the file according to a set of rules. Think of it like a folder action, but much more complex and customisable. Once you've installed Hazel, you will find it in System Preferences.
    <h1>Step 1: Receive Incoming Downloaded Video Files</h1>
    This is the first set of rules I set up to handle incoming files. Point Hazel at your downloads folder. Mine is called <em>Complete</em>. If you are awesome and you're using <a href="http://www.mactalk.com.au/2010/07/22/bittorrent-anywhere-with-transmission-draft/" target="_blank">Transmission</a>, you can actually set up a*separate*folder where completed downloads are moved to. This works really well with Hazel, because it never confuses completed files with incomplete files. We're going to set up a series of rules for this folder to follow.

    <img class="aligncenter size-full wp-image-8491" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-9.10.41-PM-e1280316000913.jpg" alt="Rules for incoming files" width="590" height="449" />

    Let's break these three rules down.
    <h2>Rule 1 -*<em>Run on sub-folders</em></h2>
    <img class="aligncenter size-full wp-image-8494" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-9.26.46-PM-e1280316471146.png" alt="" width="590" height="317" />

    Think of this rule as the folder inspector. It breaks down folders, examining the contents of any sub-folder that is within your download folder. All of the rest of the rules can then be run against any itens buried in folders. So if your download folder looks like this:

    <img style="margin-left: auto;margin-right: auto" src="http://www.mactalk.com.au/wp-content/uploads/2010/08/Download-folder.jpg" border="0" alt="Complete.jpg" width="519" height="399" />

    It will examine each one of those sub-folders, and extract the video files from each.

    It also only runs once on every folder, so that it doesn't bog down your system constantly re-examining folders that have already been actioned. I also added an action to change any folder acted upon turn blue - just as an easy visual cue to see folders that are done. I suppose you could say, I just blue myself.

    Note: It's very important that this is the <em>top rule. </em>It actions against all the rules below, so it has to go highest in the order within Hazel.
    <h2>Rule 2 -*<em>Move Music to iTunes</em></h2>
    <img class="aligncenter size-full wp-image-8495" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-9.32.07-PM-e1280316836563.png" alt="Rule: Add music to iTunes" width="590" height="269" />

    This is unrelated to video files, but this rule finds any mp3 file in your downloads folder, and moves it to a folder called '<em>Automatically Add to iTunes</em>' - you can find that folder in your iTunes Music folder.

    <img class="aligncenter size-full wp-image-8496" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/iTunes-Music-1.jpg" alt="Automatically add to iTunes" width="490" height="422" />

    This folder is kind of a hidden secret that appeared in iTunes 9. Any mp3 file that is added to it is automatically sorted in iTunes. Awesome!
    <h2>Rule 3 - <em>Convert avi to m4v</em></h2>
    <img class="aligncenter size-full wp-image-8499" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-9.50.11-PM-e1280317951663.png" alt="Rule: Convert avi to m4v" width="590" height="294" />

    This rule is designed to trigger an Automator workflow for any .avi file in your folder that will create an iTunes-friendly copy of the video, which leads nicely into...
    <h1>Step 2: Encode Video files into iTunes-friendly format</h1>
    Before we get into that though, we need to go back to our folder structure for a second...
    <p style="text-align: center"><img class="aligncenter" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-10.03.12-PM.jpg" alt="External HDD Structure" width="575" height="149" /></p>
    Create a folder called*<em>Encoded</em>. This is*where you should specify for your files to be saved to in your Automator workflow.

    Now before you're done, you need to create the Automator workflow first. Open up Automator.

    Here's a screenshot of the workflow you need to create.

    <a href="http://www.mactalk.com.au/wp-content/uploads/2010/07/Convert-.avi-to-AppleTV.jpg"><img class="aligncenter size-full wp-image-8500" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Convert-.avi-to-AppleTV-e1280318377687.jpg" alt="Convert .avi to AppleTV" width="590" height="371" /></a>
    <em>(click to enlarge)</em>

    For more information on creating this workflow, have a squiz at Matt's excellent article on*<a href="http://www.mactalk.com.au/2010/07/20/get-your-feet-wet-with-automator-2/">Getting Your Feet Wet With Automator</a>. It has all the basics for putting together a simple workflow like this, and it's a great read.

    This workflow basically exports a copy of the avi file into Apple TV format, and saves it in the*<em>Encoded</em> folder. It also gives it a Spotlight comment, so we know it's been encoded from our workflow. Just a heads-up, you will also need a copy of <a href="http://perian.org/" target="_blank">Perian</a> installed so that Automator can do this sucessfully with .avi files.

    Getting back to our rules...

    <img class="aligncenter size-full wp-image-8499" src="http://www.mactalk.com.au/wp-content/uploads/2010/07/Screen-shot-2010-07-28-at-9.50.11-PM-e1280317951663.png" alt="Rule: Convert avi to m4v" width="590" height="294" />

    Once you've created this Automator workflow, save it, and then link to it in your Hazel rule.

    The final bit of this rule is trashing the original avi file. I do this for space reasons, but I know lots of people keep both versions, so it's not entirely necessary.

    So now, every time you get a completed .avi file in this folder, it will detect it, and trigger an action to automatically create an iTunes friendly copy of it.
    <h1>Summing up</h1>
    This is the first step in a set of tutorials on sorting media automatically with Hazel. At the end of this tutorial you should be able to drop completed incoming files into a dowloads folder, and have all video files automatically encoded into AppleTV format.

    <img style="margin-left: auto;margin-right: auto" src="http://www.mactalk.com.au/wp-content/uploads/2010/08/SummingUp.jpg" border="0" alt="Summing Up" width="590" height="378" />
    <p style="text-align: center"><strong>Stay tuned for Part 2 tomorrow!</strong></p>
  • Dropdown

  • New Forum Posts

    Oldmacs

    IOS 5 backup to be saved in case I want to revert.

    My 3GS ran ios 6 better than ios 5 and my new 4 runs ios 6 very nicely. Friends have informed me that ios 6 improved performance on their iPhones 4's

    Oldmacs Yesterday, 11:39 PM Go to last post
    gehenna

    IOS 5 backup to be saved in case I want to revert.

    There is on my ipad...

    gehenna Yesterday, 11:12 PM Go to last post
    tonyberinson

    Mac OS X Mavericks

    Can anyone help?

    I have tried about 100 times and cant get past a screen telling me that my install wont work - can anyone help - or maybe

    tonyberinson Yesterday, 10:55 PM Go to last post
    djos

    Mac OS X Mavericks

    Did you even read the paragraph that states smb2 is the new default protocol?

    Not to mentions apples own document:

    http://images.apple.com/osx/preview/...y_Overview.pdf

    djos Yesterday, 10:38 PM Go to last post
    audax2

    Problems with invisible files with the prefix .SM.gul.

    Thanks for your help, Bennyling. All went well

    audax2 Yesterday, 10:30 PM Go to last post
    swoffa

    IOS 5 backup to be saved in case I want to revert.

    Is there supposed to be a photo there gehenna?

    swoffa Yesterday, 10:20 PM Go to last post
    paronga

    Mac OS X Mavericks

    Please revisit that post. The promoted comment:

    paronga Yesterday, 10:18 PM Go to last post
    kyte

    Preparing iphone 3G for new owner

    In settings (I forget where) theres an option to reset the phone to factory (deleting all the apps, info etc into the bargain). However... I would restore

    kyte Yesterday, 10:17 PM Go to last post
    djos

    iPhone backup - backup encountered an error

    Lol thanks ill give that a go.

    djos Yesterday, 09:56 PM Go to last post
    Mac Monk

    iPhone backup - backup encountered an error

    Here's the solution, forget all the crap you're reading on the other forums including the apple support forum:-

    1/ Go to Photos in iTunes,

    Mac Monk Yesterday, 09:24 PM Go to last post