Created
May 16, 2021 05:26
-
-
Save harivemula/c2810c0cf4e2bf2ade2f6ae1dfa896d4 to your computer and use it in GitHub Desktop.
Convert mov files to mp4 in a directory using ffmpeg in mac
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
## 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