Created
May 19, 2020 18:13
-
-
Save serboox/44d6c0b75f1538912b62ab6e74d8b4bf to your computer and use it in GitHub Desktop.
Compress all *.mp4 files in the folder. Using FFmpeg.
This file contains hidden or 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 bash | |
set +x | |
for file in *.mp4; do | |
if [[ $file == *'_new'* ]]; then | |
echo "----Pass file: ${file}----" | |
continue | |
fi | |
filename="${file%.*}" | |
ffmpeg -n -i "${file}" -vcodec h264 -crf 19 -filter:v fps=fps=15 -acodec aac \ | |
"${filename}_new.mp4" | |
if [ $? == 0 ]; then | |
mv "${file}" ~/.local/share/Trash/files/ | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment