• 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

    LCGuy

    I second Byrd and bartron - max out the RAM, stick in a fast, big HDD, and do a fresh install of Snow Leopard, and you'll be very happy with that machine.

    Shall I resurrect him? (iMac mid 2007)

    LCGuy Today, 11:09 PM Go to last post
    bennyling

    If you use Chrome, check out the extension called Page Monitor: https://chrome.google.com/webstore/d...enbfclihhmmfcd

    Get notified when a webpage changes?

    bennyling Today, 11:00 PM Go to last post
    bartron

    I'm with Byrd.

    Max out the RAM and stick with Snow Leopard and you'll have a pretty decent machine to see you though. Hard drive replacements

    Shall I resurrect him? (iMac mid 2007)

    bartron Today, 10:51 PM Go to last post
    decryption

    Nah, I haven't. A bit pricey just for stuffing around, but I know the developers (just in passing, nice guys on Twitter) and have heard nothing but good

    iPad for offroad 4x4 mapping

    decryption Today, 10:37 PM Go to last post
    Byrd

    I'd max the RAM (4Gb would do), and pick up a fast 1TB+ 7200RPM hard disk for it; not worth spending a huge deal on an SSD when it costs more than the

    Shall I resurrect him? (iMac mid 2007)

    Byrd Today, 09:38 PM Go to last post
    soulman

    That looks cool. Have you used this Anthony?

    iPad for offroad 4x4 mapping

    soulman Today, 09:10 PM Go to last post
    fulltimecasual

    Bummer. Well, if mine starts cracking, i'll let this thread know.

    New iPad Cases - What are ya buying?

    fulltimecasual Today, 08:17 PM Go to last post
    ETHERSPIN

    Hi guys,pinched for pennies (off work with illness) but my formerly lovely iMac is not coping with life at all!

    its a mid 2007 20 or 21 inch

    Shall I resurrect him? (iMac mid 2007)

    ETHERSPIN Today, 07:25 PM Go to last post
    soulman

    Hey Scott,

    I understand now and, yes, that makes sense if you can make it work. There are some good CIS systems apparently, but I can't

    Printing images

    soulman Today, 06:27 PM Go to last post
    cactus68

    Byrd hi,

    have tried all that
    I have iStat
    CPU fan 3600rpm 34'C
    Hard Drive 1350rpm 46'C
    Optical Drive 701rpm

    HDrive 4 a iMac late 2008

    cactus68 Today, 06:21 PM Go to last post