Skip to content

Instantly share code, notes, and snippets.

@furkanacaryes
Last active October 25, 2019 12:37
Show Gist options
  • Save furkanacaryes/4053d38c91b15d3f7a85d8cd17d3c0ab to your computer and use it in GitHub Desktop.
Save furkanacaryes/4053d38c91b15d3f7a85d8cd17d3c0ab to your computer and use it in GitHub Desktop.
FFmpeg downsize mp4s in directory
source ~/.bash_profile
for VIDEO in $(ls *.mp4);
do
echo "Converting $VIDEO using ffmpeg with flag 'crf' set to 28 ..."
ffmpeg -i "$VIDEO" -color_primaries 1 -color_trc 1 -colorspace 1 -vcodec libx264 -crf 28 -loglevel -8 -hide_banner "${VIDEO/%.mp4/_compressed.mp4}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment