Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active March 6, 2023 21:06
  • Star 11 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zulhfreelancer/4090ebb1393fe358e839f64bc54c1949 to your computer and use it in GitHub Desktop.
How to compress video using Handbrake CLI?

Step 1

Download HandBrake CLI for your OS here.

Step 2

cd into the folder where you have the HandBrakeCLI file and run this inside it:

./HandBrakeCLI -i /path/to/input.mov -o /path/to/output.mp4 -e x264 -q 28 -r 15 -B 64 -X 1280 -O

Step 3

Done!

Reference:

http://thanhsiang.org/faqing/node/196


Result

root@ubuntu:/handbrake_test# ls -l --block-size=M
total 1118M
-rw-r--r-- 1 root root 631M Jan  7 22:00 input.mp4
-rw-r--r-- 1 root root 488M Jan  7 23:14 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment