Page 1 of 1

Handbrake title scan

Posted: Thu Jun 15, 2017 8:14 pm
by locutus24
New person here trying to work with the Handbrake source code to alter the folder scan function. Was looking for information on whether it would be possible for me to alter the folder scan to go deeper, I have downloaded the source code, and been reading through it just having a hard time determining where the folder scan resides at. I have multiple folders that have been organized, and can't be condensed into one folder.

So because of the multiple folders just trying to find information about the folder scan, and whether it would be possible specify a single root folder with Handbrake parsing through either a txt file I created or just crawling through each directory. I would appreciate any assistance with where in the Handbrake source the primary folder scan function resides for me to look at.

Re: Handbrake title scan

Posted: Thu Jun 15, 2017 9:23 pm
by mduell
You haven't specified a platform...

Re: Handbrake title scan

Posted: Thu Jun 15, 2017 10:12 pm
by locutus24
Well working on Windows with CLI as I figured it would be easier to implement, but if Linux would make for an easier option I could work with that as well.
Initially from within Windows using the Handbrake CLI was going to write a script to feed to Handbrake, but not sure if that would be able to accomplish what I am after. I just haven't been able to find anything on Google or otherwise that explains how to do a multi-level folder scan because I see from the Handbrake GUI how you can add multiple titles to the Q I just don't know how best to get Handbrake to scan through multiple source folders.

Re: Handbrake title scan

Posted: Thu Jun 15, 2017 11:16 pm
by mduell
If you're using the CLI, you can just use a simple batch script to recurse, no need to modify HB.

Re: Handbrake title scan

Posted: Fri Jun 16, 2017 12:46 am
by JohnAStebbins
The code you are looking for is in libhb/batch.c. But if you are thinking on submitting a patch to extend it to dive into subdirectories, think it through carefully. I omitted that "feature" for a reason when I originally wrote batch processing. DVD and BD rips are directories. If you recurse into those directories, you are going to get a collection of individual vob and m2ts files as titles which is not what most people would want. Batching up multiple DVD and BD rips was not the intended purpose of batch.c and adding that capability has a lot of pit-falls (not to mention UI design issues).

My suggestion if you are going to try to submit back up stream is that you detect directories that appear to be DVD or BD and just skip them.

Re: Handbrake title scan

Posted: Fri Jun 16, 2017 3:57 pm
by locutus24
Well I certainly appreciate all the input, and will go back to square to give this more thought though it looks for now I will have to manually select each folder because recursion would seem to have more issues than it is worth. Perhaps a script will be the best way ahead for this when I find more time.

Not sure if there is a way to close this out, not looking for any additional input at this time.