Created
September 3, 2015 14:43
-
-
Save mmacedo/5b01d88fee3d02610164 to your computer and use it in GitHub Desktop.
Compact porn stash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set max_width 320 | |
set input_folder ~/Videos | |
set output_folder ~/compressed | |
function downsample | |
set file $argv[1] | |
set input $input_folder/$file | |
set output $output_folder/$file | |
rm $output | |
avconv -i $input -vf "scale=$max_width:trunc(ow/a*1/2)*2" $output | |
end | |
mkdir -p $output_folder | |
for video_path in $input_folder/* | |
set file (basename $video_path) | |
downsample $file | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment