Created
February 4, 2023 13:49
-
-
Save tairov/56abbadf69cdd3e7f098c3192f5de579 to your computer and use it in GitHub Desktop.
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
# ffmpeg -i "$1" -vcodec h264 -threads 10 "$2" | |
process_mov_files() { | |
{ | |
find . -name "*.mov" -print0 | while read -d $'\0' file | |
do | |
{ | |
NEW_NAME="$(echo "${file%.mov}" | sed 's/[ _]/-/g' | tr '[:upper:]' '[:lower:]')" | |
ffmpeg -i "$file" -vcodec h264 -threads 10 -f mp4 "${NEW_NAME}.mp4" | |
} < /dev/null | |
done | |
} | |
} | |
find . -name "*.mov" | |
echo "" | |
read -r -p "Are you sure to convert all mov files above? [y/N] " response | |
case "$response" in | |
[yY][eE][sS]|[yY]) | |
process_mov_files | |
;; | |
*) | |
echo "Exit" | |
;; | |
esac | |
echo "Finished processing" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment