Skip to content

Instantly share code, notes, and snippets.

@harivemula
Created May 16, 2021 05:26
Show Gist options
  • Save harivemula/c2810c0cf4e2bf2ade2f6ae1dfa896d4 to your computer and use it in GitHub Desktop.
Save harivemula/c2810c0cf4e2bf2ade2f6ae1dfa896d4 to your computer and use it in GitHub Desktop.
Convert mov files to mp4 in a directory using ffmpeg in mac
## zsh
brew install ffmpeg
## If you have any spaces in file name, run below command to replace
#
for FILE in *.mov; do mv "$FILE" `echo $FILE | tr ' ' '_'` ; done
## If you are running from a different directory, you may use ${FILE:t:r} to just keep the filename without path and extension
for FILE in *.mov; do echo $FILE; ffmpeg -i ${FILE} -vcodec h264 ${FILE:r}.mp4; echo -----; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment