Using HandbrakeCLI 0.9.9 (MacOS X Yosemite) to compress and rotate a video file

Posted: April 18, 2015 in General Computing
Tags: , ,



Below example rotates video clockwise – use –rotate=”7″ to rotate counterclockwise.

handbrakeCLI -i inputfile.mp4 -f mp4 -e x264 -b 800 -w 568 -a 1 -E faac -B 96 -x level=4.0:ref=5:weightp=1:subq=2:mixed-refs=0:trellis=0:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10 -v --rotate="4" --start-at duration:150 --stop-at duration:300 -o outputfile.mp4



To convert say all *.mp4 files in current directory to an already existing “out” directory (assuming in a bash shell);

for i in *.mp4;do handbrakeCLI -i $i -f mp4 -e x264 -b 800 -w 568 -a 1 -E faac -B 96 -x level=4.0:ref=5:weightp=1:subq=2:mixed-refs=0:trellis=0:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10 -v --rotate="4" --start-at duration:150 --stop-at duration:300 -o out/$i;done



Note: “start at” indicates actual time or frame to start encoding and “stop at” indicates how many seconds or how many frames (from “start at”) to encode.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s