Skip to content

Instantly share code, notes, and snippets.

@dularion
Last active April 17, 2018 02:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dularion/6237d651c385d2552916 to your computer and use it in GitHub Desktop.
Save dularion/6237d651c385d2552916 to your computer and use it in GitHub Desktop.
#!/bin/sh
#############################################
# Output file for HTML5 video #
# Requirements: #
# - handbrakecli #
# #
# usage: #
# ./html5VideoHandBrakeFolder.sh folder #
# #
#############################################
target_directory='converted'
for FILE in "$1"/*
do
file=`basename $FILE`
filename=${file%.*}
filepath=`dirname $FILE`
destination="$filepath/$target_directory"
if ! test -d "$destination"
then
mkdir $destination
fi
HandBrakeCLI -i $filepath/$file -o $destination/$filename.mp4 --encoder x264 --vb 900 --ab 128 --optimize
done
@stemid
Copy link

stemid commented Jan 15, 2017

I made a recursive parallel version to convert my own library. Maybe it helps someone until Streama can do server-side conversion.

@dularion
Copy link
Author

Great!! thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment