Skip to content

Instantly share code, notes, and snippets.

@mmacedo
Created September 3, 2015 14:43
Show Gist options
  • Save mmacedo/5b01d88fee3d02610164 to your computer and use it in GitHub Desktop.
Save mmacedo/5b01d88fee3d02610164 to your computer and use it in GitHub Desktop.
Compact porn stash
#!/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