Equivalent of an encode batch file

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
crashray
Posts: 5
Joined: Fri Apr 27, 2007 2:12 pm

Equivalent of an encode batch file

Post by crashray »

Hi,
I try to encode with my mac. On my pc, I have a good encode batch file here :

Code: Select all

echo #
echo ########### avs ###########
echo #

date /t
time /t
start /b /wait /belownormal /min "#" "D:\Al\VirtualDubMod\VirtualDubMod.exe" /s"test.jobs" /x


echo #
echo ########## avc 1 ##########
echo #

date /t
time /t
start /b /wait /belownormal "#" "D:\Al\x264\x264.exe" --keyint 250 --min-keyint 25 --scenecut 30 --bframes 2 --b-bias 0 --b-pyramid --ref 8 --filter -1:0 --bitrate 600 --qpmin 10 --qpmax 51 --qpstep 4 --ratetol 1.0 --vbv-maxrate 0 --ipratio 1.2 --pbratio 1.3 --chroma-qp-offset 0 --pass 1 --stats "avc.stats" --qcomp 0.60 --analyse all --direct temporal --weightb --me "hex" --merange 16 --subme 5 --b-rdo --mixed-refs --bime --8x8dct --threads 1 --trellis 2 --no-psnr --progress -o "1.mkv" "final.avs"

echo #
echo ########## avc 2 ##########
echo #

date /t
time /t
start /b /wait /belownormal "#" "D:\Al\x264\x264.exe" --keyint 250 --min-keyint 25 --scenecut 30 --bframes 2 --b-bias 0 --b-pyramid --ref 8 --filter -1:0 --bitrate 600 --qpmin 10 --qpmax 51 --qpstep 4 --ratetol 1.0 --vbv-maxrate 0 --ipratio 1.2 --pbratio 1.3 --chroma-qp-offset 0 --pass 3 --stats "avc.stats" --qcomp 0.60 --analyse all --direct temporal --weightb --me "umh" --merange 16 --subme 6 --b-rdo --mixed-refs --bime --8x8dct --threads 1 --trellis 2 --no-psnr --progress -o "test 600.mkv" "final.avs"

date /t
time /t
pause
How can i do something equivalent with the HandBrakeCLI ?

Thanks
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

You can't really--there's no AviSynth for Mac/Linux yet and HB doesn't have .mkv support yet.

Of course, you can do a "batch file" using a shell script, or just a long command line.

I'm not entirely sure what you're doing--it looks like you're doing a first pass and an n-th pass but never going back for the 2nd pass. And you're specifying a bunch of options you don't have to, because they're default values (like the keyint values of 250 and 25--so I hope you're transcoding PAL video).

The first command would look like this:

Code: Select all

./HandBrakeCLI -i DVD -o 1.mp4 -b 600 -e x264 -x keyint=250:min-keyint=25:scenecut=30:bframes=2:b-bias=0:b-pyramid:ref=8:filter=-1,0:qpmin=10:qpmax=51:qpstep=4:ratetol=1:vbv-maxrate=0:ipratio=1.2:pbratio=1.3:chroma-qp-offset=0:qcomp=0.60:analyse=all:direct=temporal:weightb:me=hex:merange=16:subme=5:b-rdo:mixed-refs:bime:8x8dct:threads=1:trellis=2:no-psnr:pass=1:stats=~/Documents/avc.stats
You can string command lines together by separating them with semi-colons instead of carriage returns.

Of course, if you this with a shell script, you could save yourself the trouble of writing everything out each time. Store all the bits that don't change between passes in variables.

You might also want to look at some of the queuing scripts people have posted in this forum.
crashray
Posts: 5
Joined: Fri Apr 27, 2007 2:12 pm

Post by crashray »

Thanks for your (quick) answer.
You can't really--there's no AviSynth for Mac/Linux yet and HB doesn't have .mkv support yet.
Doesn't Matter, i can mux after.
Of course, you can do a "batch file" using a shell script, or just a long command line.
I don't know how to do his on mac but i think it's easy.
I'm not entirely sure what you're doing--it looks like you're doing a first pass and an n-th pass but never going back for the 2nd pass. And you're specifying a bunch of options you don't have to, because they're default values (like the keyint values of 250 and 25--so I hope you're transcoding PAL video).
It's French DVD so PAL :D
The first command would look like this:
Code:

Code: Select all

./HandBrakeCLI -i DVD -o 1.mp4 -b 600 -e x264 -x keyint=250:min-keyint=25:scenecut=30:bframes=2:b-bias=0:b-pyramid:ref=8:filter=-1,0:qpmin=10:qpmax=51:qpstep=4:ratetol=1:vbv-maxrate=0:ipratio=1.2:pbratio=1.3:chroma-qp-offset=0:qcomp=0.60:analyse=all:direct=temporal:weightb:me=hex:merange=16:subme=5:b-rdo:mixed-refs:bime:8x8dct:threads=1:trellis=2:no-psnr:pass=1:stats=~/Documents/avc.stats
I will try this in my next encode.
You can string command lines together by separating them with semi-colons instead of carriage returns.
semi-colons=; ?
Of course, if you this with a shell script, you could save yourself the trouble of writing everything out each time. Store all the bits that don't change between passes in variables.
Just change the bitrate what i need.
You might also want to look at some of the queuing scripts people have posted in this forum.
In which section can i find this ?

Thanks :)
Post Reply