Created
September 1, 2019 15:15
-
-
Save oe7drt/3ca5f567b8382df744a597985d3c6756 to your computer and use it in GitHub Desktop.
Convert camera videos into x264 mpeg files
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
#!/bin/bash | |
# for i in *.MP4; do ffmpeg -i $i -vcodec libx264 -crf 21 -an out/$i && mv $i $i.done; done | |
c=0 | |
d=$(date +%Y%m%d) | |
if [ ! -d "done/$d" ]; then | |
mkdir "done/$d" | |
fi | |
if [ ! -d "out/$d" ]; then | |
mkdir "out/$d" | |
fi | |
for file in *.MP4; do | |
echo -en "Converting file '$file'..." | |
ffmpeg -i "$file" -vcodec libx264 -crf 21 -an "out/$d/$file" && mv "$file" "done/$d/$file" | |
echo -en " done. Moved file '$file' to 'done/$d/$file'.\n" | |
echo -en "Converted file to: 'out/$d/$file'\n" | |
(( ++c )) | |
done | |
echo -en "\nFinished. Converted $c files.\n" | |
# vim: set syntax=sh ft=sh ts=2 sw=2 tw=0 et : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment