Batch convert script from multiple machines

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
w33d5
Posts: 6
Joined: Wed Dec 01, 2010 2:03 am

Batch convert script from multiple machines

Post by w33d5 »

Using Barakaspeed's script from here
http://forum.handbrake.fr/viewtopic.php ... ipt#p86759

I was encoding massive amounts of .mov and .avi but if i ran the script on the same drive from multiple machines handbrake would crash (most likely because it couldn't find the file or it was locked)

With a little tweaking i was able to get all of the machines encoding on the same drive (recursively) see below... Big ups barakaspeed!

- not that it matters but the same drive is mounted to W: on all the machines (i really wish i could throw another into the mix!)

Code: Select all


@ECHO off

SET WorkingPath=%CD%
SET FileExt=*.mov   ::PICK YOUR POISON!
SET PathToHandbrake=C:\Program Files (x86)\Handbrake\HandBrakeCLI.exe
SET HandbrakeArgs=-f mp4 -X 624 --loose-anamorphic  -e x264 -q 20 -a 1,1 -E faac,ac3 -6 dpl2,auto -R 48,Auto -B 160,auto -D 0.0,0.0 -x cabac=0:ref=2:me=umh:bframes=0:8x8dct=0:trellis=0:subq=6:weightb=0 -v 1

FOR /R "%WorkingPath%" %%a IN (%FileExt%) DO (
	IF EXIST %%a (
		REN "%%~dpa%%~nxa" "%%~nxa.processing"  ::TAKE FILE OUT OF QUEUE
		"%PathToHandbrake%" -i "%%~dpa%%~nxa.processing" -o "%%~dpa%%~na.m4v" %HandbrakeArgs%  ::ENCODE FILE
		REN "%%~dpa%%~nxa.processing" "%%~nxa.delete" ::RENAME FILE FOR LATER DELETION
		)
	)

PAUSE
w33d5
Posts: 6
Joined: Wed Dec 01, 2010 2:03 am

Re: Batch convert script from multiple machines

Post by w33d5 »

can somebody please translate to mac shell so that i can also throw two macbook pros at this over gig-E??
Dalton63841
Posts: 20
Joined: Tue Jan 11, 2011 9:54 pm

Re: Batch convert script from multiple machines

Post by Dalton63841 »

I fixed some kinks in the Mac version of this script on the other thread, and now I thought I would come here and bring up a strange occurence for me. When I use this script, it won't work.

However if I change the "REN" command to being spelled out "RENAME" then it works perfectly. Im on Windows 7 32-bit, using the script to encode vids on a Samba share.
Post Reply