Skip to content

Instantly share code, notes, and snippets.

@derpeter
Created October 14, 2017 01:50
Show Gist options
  • Save derpeter/2d1ff639076fd32f76b672ddb3e28e1e to your computer and use it in GitHub Desktop.
Save derpeter/2d1ff639076fd32f76b672ddb3e28e1e to your computer and use it in GitHub Desktop.
reencode all video files in an folder that a bigger than a configured value to save disk space
#!/bin/bash
MIN_SIZE=6G
IN_DIR=.
OUT_DIR=out
find $IN_DIR -maxdepth 1 -type f -size +$MIN_SIZE -exec ffmpeg -y -i {} -c:v libx264 -preset slow -tune film -profile:v high -level 4.2 -crf 23 -c:a copy -c:s copy $OUT_DIR/{} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment