Skip to content

Instantly share code, notes, and snippets.

@gregawoods
Last active September 26, 2015 17:08
Show Gist options
  • Save gregawoods/1130845 to your computer and use it in GitHub Desktop.
Save gregawoods/1130845 to your computer and use it in GitHub Desktop.
Encode the contents of a directory using Handbrake while wishing my media server was a Mac
:: Handbrake.bat
:: A batch script for losers
:: Set handbrake_exec to the location where your handbrake is installed
:: Set handbrake_preset to the desired preset (https://trac.handbrake.fr/wiki/BuiltInPresets)
:: Set source_dir to the folder containing the videos you wish to encode
:: Set output_dir to the destination where encoded videos should be saved
set handbrake_exec="C:\Program Files\Handbrake\HandBrakeCLI.exe"
set handbrake_preset="AppleTV 3"
set source_dir="C:\"
set output_dir="C:\Encoded"
cd /d %source_dir%
for %%f in ("*") do %handbrake_exec% --preset %handbrake_preset% -i "%%f" -o "%output_dir%\%%f.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment