Skip to content

Instantly share code, notes, and snippets.

@tairov
Created February 4, 2023 13:49
Show Gist options
  • Save tairov/56abbadf69cdd3e7f098c3192f5de579 to your computer and use it in GitHub Desktop.
Save tairov/56abbadf69cdd3e7f098c3192f5de579 to your computer and use it in GitHub Desktop.
# 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