Is this workflow possible? Video conversion with Handbrake

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi all - hoping someone may be able to help me here.

The basic idea is to automatically convert, tag, and add to itunes all of my TV and movie files. It's running smoothly, with the exception of the order of operations, so to speak.

My problem:
Hazel seems to take a snapshot of the folder as-is and uses that snapshot until it's processed all of the contents of the folder. This creates an issue: If hazel is currently converting many Movies, and I add a TV show to the folder, it should finish the current movie and then process the TV show since it has a higher priority.

What I would like is for there to be 4 categories (prioritized in the following order):
New TV (New TV I want to convert and watch right away)
New Movies (New Movies I want to convert and watch right away)
Backlog TV (Old TV being converted for archival purposes)
Backlog Movies (Old Movies being converted for archival purposes)

I tried using multiple folders for this, but I would end up with multiple encodes running at the same time instead of a queue system. I am now trying to do them all in the same folder, using color labels to differentiate.

As a starting point (baby steps), I currently have 2 categories:
TV (blue Finder color label)
Movies (orange Finder color label)


Any ideas on a workflow or folder hierarchy that would work? I only ever want a single conversion happening at once.

Thanks!
Tim
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

This is a bit tricky. If you search the forums, I think people have come up with other ways to queue things up but another way to do this is something like the following:
Code: Select all
    If all are met for enclosing folder
        If none are met for any sub-file
            If <<whatever criteria you use to tell if something is a tv show>>


What that does is match if the file's enclosing folder does not have any tv shows (basically, this file does not have any sibling tv shows). If you have a bunch of different categories of stuff this can get hairy but hopefully you get the basic gist.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:This is a bit tricky. If you search the forums, I think people have come up with other ways to queue things up but another way to do this is something like the following:
Code: Select all
    If all are met for enclosing folder
        If none are met for any sub-file
            If <<whatever criteria you use to tell if something is a tv show>>


What that does is match if the file's enclosing folder does not have any tv shows (basically, this file does not have any sibling tv shows). If you have a bunch of different categories of stuff this can get hairy but hopefully you get the basic gist.



I'm starting to get the gist of it, and while it will work for 2 priority levels, I'm running into an issue on getting it to 4. Let me explain:

If my first rule is something like "If TV show, then convert it" and my second rule is (as above) "if there are no TV shows in here, then convert it"... This will work for 2 priority levels, since if it isn't a TV show, then the only choice left is movie.

But what about for 4 levels?

"If NEW TV, convert it"
"If there are no NEW TV shows in here, then convert it"
"If there are no NEW TV shows in here OR no NEW Movies, then convert it"
"If there are no NEW TV shows in here OR no NEW Movies OR Backlog TV Shows, then convert it"

My dilemma is, the first rule will match only NEW TV shows (GOOD). The second will match NEW Movies, Backlog TV Shows, Backlog Movies (BAD). The third will match Backlog TV and Backlog Movies (BAD). The fourth will match Backlog Movies (Good).

If the overall rule is testing the Enclosing folder, can I somehow test for the right priority of file for rules 2,3,4?

I can't simply use the following 4 times (switching the tests to exclude the remaining 3):

"If there are no NEW TV shows in here OR no NEW Movies OR Backlog TV Shows, then convert it"

It would simply never run any rule unless that file was the one and only type present...

I've circled around this a few times and still drawing a blank.

Any input is greatly appreciated.
-Tim
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

Isn't that what you want? I'm not sure where the problem is here. Did you try what you outlined?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Isn't that what you want? I'm not sure where the problem is here. Did you try what you outlined?


I did, but the issue is with the following:

"If NEW TV, convert it"
"If there are no NEW TV shows in here, then convert it"
"If there are no NEW TV shows in here OR no NEW Movies, then convert it"
"If there are no NEW TV shows in here OR no NEW Movies OR Backlog TV Shows, then convert it"

The first and 4th rules work as intended. The second and third do not. The first rule matches only new TV, and the 4th matches anything that isn't New TV New Movies or Backlog TV (Therefore, by exclusion, matching Backlog movies).

Rule 2 matched new movies, and all backlog (TV and movie) and it seemed to process them (combined) in alphabetical order).

I hope that explains it better. The live queuing system (based on the rules you outlined) works perfect for 2 categories, but I hope I'm explaining clearly enough the issue I'm running into expanding it into 4 categories.

Thanks,
Tim
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

Ah, you need to re-order the rules. Really, you want the most specific rules first since the previous rules are a "subset" of the later ones as they stand right now.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Still no luck. Here's my setup to possibly help get to the bottom of this:
Blue: New TV
Orange: New Movie
Purple: Backlog TV
Yellow: Backlog Movie

Rules (reversed them to match the order you suggested, but no luck):
Conv Backlog Movies
Image

Conv Backlog TV
Image

Conv New Movie
Image

Conv New TV
Image

Here is the layout of the folder currently:
Image

And here is the preview result:
Image

I tried switching the "any" subfiles or folders to "all" subfiles or folders, and it matched the Blue TV show properly, but after it was finished (no more blue left) it matched every file to "Convert New Movie" and started to do them in alphabetical order.

Any ideas? Or am I chasing a wild dream here?
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

Actually, I did make a mistake. It should be "none for ALL subfiles". You should do that across all the rules. I'm not sure I understand how things would match "Convert new movie" unless you didn't change that one to use "all" instead of any like the first rule.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I changed the rules to

If all for enclosing folder
If none for all subfiles

And it is indeed matching every file to the new movie rule once the new TV (blue files) are processed.

I did a few tests and here's what I came up with:

If all 4 types are present, only blue files match the new TV rule and are processed
If only 3 types are present (new movie, backlog tv, backlog movie), all files match "new movie" rule
If only 2 types are present (backlog tv, backlog movie), all files match "backlog tv" rule
If only 1 type is present (backlog movie), all files match "backlog movie" rule


I think I found the issue but I'm drawing a blank on how to fix it:
The rules need a way to match the current file to a certain type - to say, for instance, "If no new TV is present AND this file is a new movie" then process. Right now we're simply testing the presence of the higher priority but not the type of the current file, therefore all files match.

Since the top of the rule is "If all are met for enclosing folder" is there a way to test the file itself?
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

Here's one thought on it, not sure if something like this can work within the structure of hazel, but I'll give it a shot over the weekend:

Example for Backlog Movies:
Code: Select all
If all of the following are met for the file being matched
    Color Label is orange
    If all of the following are met for its enclosing folder
        If none of the following are met for all subfiles
            Color label is Blue
            Color label is Orange
            Color label is Purple


Let me know what you think
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

Yes, you can move the enclosing folder stuff into a nested condition so that the top level matches the actual file. Let me know if your idea worked.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Yes, you can move the enclosing folder stuff into a nested condition so that the top level matches the actual file. Let me know if your idea worked.



No Dice. Hazel isn't letting the 2nd nested if statement (notated below) target all subfiles. The dropdown is only allowing me to choose "current file or folder" or "its enclosing folder". The any/all subfiles option is grayed out and not selectable.

Code: Select all
If all of the following are met for the file being matched
    Color Label is orange
    If all of the following are met for its enclosing folder
        If none of the following are met for all subfiles  <---- This one
            Color label is Blue
            Color label is Orange
            Color label is Purple



Thought we had it that time :/ Any ideas?
tj1627
 
Posts: 7
Joined: Fri Dec 07, 2012 9:30 am

Ah, I think I added some thing where I was trying to prevent people from nesting any/all subfile within another any/all subfile since that would just make things explode. I'll have to consider enabling it if nested under "enclosing folder".

In the meantime, you may need to resort to a script in the conditions to pull this off.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

what are your rules/script to add to handbrake queue? I finally have a good setup to process new shows and movies. However I am "bottlenecked" with Handbrake CLI as it only allows three concurrent encodes from this workflow http://forums.macrumors.com/showthread.php?t=805573

so I have setup New Shows and movies via HandBrakeCLI and MANUALLY add to HandBrake queue
elgallo
 
Posts: 17
Joined: Sat Apr 19, 2014 7:41 am


Return to Support