Automating broadcatching and .avi conversion

Discussion in 'Apple TV and Home Theater' started by kmacduff, Jan 5, 2009.

  1. kmacduff macrumors newbie

    Joined:
    Aug 7, 2007
    #1
    Hello all,

    Looking for some help in automating this workflow.
    We got rid of the tv and cable over a year ago and I have been using TVshows and Transmission to get some favorites like Dexter and am happy with the results watching the downloaded content on one or the other of the macbooks. My wife has just convinced me that getting a tv would be good so we could watch them together. So I have just purchased the Apple TV and a new LCD.
    The thing I like about TVshows and Transmission is the automated way it basically tivos my content for me. I want to continue this automation by scripting some folder actions to get the content from the XVid .avi file to an M4V file optimized for the Apple TV.

    I really appreciated the various tutorials on ripping DVD collections (though I can’t seem to make them work for .avi files) and they have helped me narrow down tool choice and methodology. I have managed to get part of the way there but am having some difficulty in the steps.

    First, I have TVShows set to subscribe to some of my favorites and it(for those who don't already know)automatically watches RSS feeds for matching episodes and then triggers Transmission to start downloading when it sees a match. In one of the other forums someone mentioned that TVShows might not be maintained anymore, so I have also set up Automatic which does basically the same thing.

    Second, I have Transmission set to keep incomplete files in the downloads folder and then when it has finished, it moves the completed file to a folder on my desktop named jobqueues/tivo. I incorporated these jobqueues scripts in order to address a problem I was having in not being able to properly process groups of files. The Jobqueues scripts help to take a bunch of files and process them one by one. This script sends one file at a time to a processing folder and then when it finishes is supposed to put it in a completed folder or an error folder depending on result of processing. The processing script re-encodes the .avi file using presets optimized for the AppleTV with HandbrakeCLI. This script was modified from an original on the Handbrake forums site(search for 'Broadcatching' in their forums) because that one did not quite work for me. After encoding the completed file goes to another jobqueue folder at which point it is in M4v format, ready to add to itunes. I have not yet set up this scripting to add the files to itunes but I think that should be easier. I would also set up the completed folders to trash any file put into them so they clean up after themselves.
    Challenges along the way:
    The Jobqueue script will put a file dropped into the ~/desktop/jobqueues/tivo folder into the ~/desktop/jobqueues/tivo/tivo_queue folder and will put all other files dropped there at the same time into the ~/desktop/jobqueues/tivo/tivo_queue /waiting folder so the queuing seems to be working, but once it puts the file into the ~/desktop/jobqueues/tivo/tivo_queue folder it does not start processing on its own. Strangely I have to go to the file and rename it by highlighting the name and deleting a letter or putting in a letter or ‘.’ (I discovered this because I thought the error was to do with the file having an underscore in its’ title) once I do that, it processes and then sends the completed file to the next folder for action.
    So I need to fix this part so that it starts on its own.
    The processing via handbrake used to quit all the time until I read somewhere that second audio tracks were the cause and so I adjusted my HandBrakeCLI settings so they only had one audio track. I tested it with a file that I know made the GUI version crash so that works well now.
    The problem with the processing script is that it gets to the processing step(once I rename the file and get it to start) and processes, but it never gets past that part so that the file gets placed in the completed folder once it is done. I have to manually move the file into the completed folder and then it pulls the next one out of the waiting folder. Once again at this point I have to rename it to get it to start.
    So there definitely seems to be something wrong with my handbrake processing part of the script that is not allowing it to move on.
    Well that’s a start, if anyone can help I would appreciate it. I hope this might be helpful to some of the people who were posting on the automating DVD backup posts. Seems like a lot of people want to do this same thing.

    I am attaching the original Jobqueues scripts as well as my adjusted version of the jobqueue script and the jobprocess script.
     
  2. refulgentis macrumors regular

    Joined:
    May 14, 2006
    #2

Share This Page