• 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 hate sorting media, but I simply cannot sit by and do nothing when I see this in iTunes:


    (Even taking this screenshot was grating.)



    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,*insists 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 rewards the*diligent. Album artwork is gorgeous, TV shows can be sorted by season, music can be sorted by year & 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 & 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*MetaX. It was exact, but man, it took forever. I was wasting my life copying and pasting plot summaries from tv.com!)

    The Grand Plan


    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.

    Step 1: Receive Incoming Downloaded Video Files

    Step 2: Encode Video files into iTunes-friendly format

    Step 3: Rename Files

    Step 4: Tag files with metadata & add artwork

    Step 5: Sort to folders & Add to iTunes library

    Here's what I want the final outcome to look like:

    Final Result in iTunes


    ...and here's what it looks like from a file-management perspective.

    Hazel Tutorial Pt 1 - Final Product


    I have an external drive, which has a folder called*TV Shows on it. Within*TV Shows, there are*show sub-folders for shows (in this case*Arrested Development). Within a show folder, there are sub-folders for each season (Season 1, Season 2 etc) and finally within those, the shows themselves. The shows are all encoded in h.264, and each episode is named with the format:

    [Show Name] - S[Season Number]E[Episode Number].m4v

    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*Plex or*Boxee.

    Software needed: Hazel - US$21.95


    One of my favourite tools on the Mac for organising media is a system preferences pane called*Hazel. What does Hazel do? In its own words:
    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.

    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.

    Step 1: Receive Incoming Downloaded Video Files


    This is the first set of rules I set up to handle incoming files. Point Hazel at your downloads folder. Mine is called Complete. If you are awesome and you're using Transmission, 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.

    Rules for incoming files

    Let's break these three rules down.

    Rule 1 -*Run on sub-folders




    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:

    Complete.jpg

    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 top rule. It actions against all the rules below, so it has to go highest in the order within Hazel.

    Rule 2 -*Move Music to iTunes


    Rule: Add music to iTunes

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

    Automatically add to iTunes

    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!

    Rule 3 - Convert avi to m4v


    Rule: Convert avi to m4v

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

    Step 2: Encode Video files into iTunes-friendly format


    Before we get into that though, we need to go back to our folder structure for a second...

    External HDD Structure


    Create a folder called*Encoded. 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.

    Convert .avi to AppleTV
    (click to enlarge)

    For more information on creating this workflow, have a squiz at Matt's excellent article on*Getting Your Feet Wet With Automator. 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*Encoded 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 Perian installed so that Automator can do this sucessfully with .avi files.

    Getting back to our rules...

    Rule: Convert avi to m4v

    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.

    Summing up


    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.

    Summing Up

    Stay tuned for Part 2 tomorrow!

  • New Forum Posts

    dotnet

    The Air isn't going to be slow and annoying – but more expensive (compared to the 13" MBP). For the extra money you get SSD as standard and a better

    Air or Pro?..I know you've seen this a million times!

    dotnet Today, 02:33 AM Go to last post
    Arkhum_Eramak

    I've been working professionally in FCPX since it came out (I made it my personal challenge to persist with it for six months before reassessing whether

    Is it time to fully embrace the Mac and FCP?

    Arkhum_Eramak Today, 01:56 AM Go to last post
    grfxninja

    Nice pickup Steeley! Man you have some good eyes

    Mountain Lion Announcement!

    grfxninja Today, 12:46 AM Go to last post
    Xenophos

    That's pretty unequivocal.

    Microsoft Office for iPad

    Xenophos Today, 12:09 AM Go to last post
    Steeley

    This was published in tonight's The Daily: Bad day at the Office - WWW.THEDAILY.COM

    Microsoft Office for iPad

    Steeley Today, 12:03 AM Go to last post
    Zuko

    Hi there, I'm wanting to purchase my first macbook... But I don't know if I need an air or Pro?

    I really only surf the web and watch youtube

    Air or Pro?..I know you've seen this a million times!

    Zuko Yesterday, 11:28 PM Go to last post
    Steeley

    1. The rhythm of the text. 2. Working for years with a guy who scrawled instructions to me just like that.

    Mountain Lion Announcement!

    Steeley Yesterday, 11:03 PM Go to last post
    fulltimecasual

    It's a prefect time to start, FCPX has become quite stable, and if you've never memorised the keyboard shortcuts of FCP7, then i guess you wont know what

    Is it time to fully embrace the Mac and FCP?

    fulltimecasual Yesterday, 10:58 PM Go to last post
    Steeley

    I don't use mine like I did back in Leopard's heyday that's for sure. Right now I only have three things on it and they're strategically placed so that

    Post Your Dashboard

    Steeley Yesterday, 10:54 PM Go to last post
    cejay

    I just came back from a brief visit to the UK to see family, but I attempted to be a tourist and so visited a few places.

    Random Photography Thread Version IV

    cejay Yesterday, 10:35 PM Go to last post
    cejay

    I've bought a new Marantz SR5006 and am extremely happy with the result. Normally I'd always suggest that a good shop will do their best to provide a

    A/V receiver suggestions/advice

    cejay Yesterday, 10:33 PM Go to last post
    moto51

    Do people still use Dashboard frequently? personally I still use notes, 3 or 4 open usually and then the iStat widget for stats, as well as a widget called

    Post Your Dashboard

    moto51 Yesterday, 09:34 PM Go to last post
    moto51

    Holy $#!T Steeley, how did you pick that. Looking closely at that I can make out the words, a nice but very subtle touch.

    Mountain Lion Announcement!

    moto51 Yesterday, 09:24 PM Go to last post
    entropy

    Filth, Microsoft Works for years was light versions of word, excel and powerpoint all rolled into one, as I recall.

    I think it is obviously

    Microsoft Office for iPad

    entropy Yesterday, 09:18 PM Go to last post