Created
April 8, 2022 03:05
-
-
Save Kouni/316beb13bbbafb4b51076d924792c297 to your computer and use it in GitHub Desktop.
Convert mov to mp4
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
| #!/usr/bin/env bash | |
| # find . -type f -name "*.mov" -exec ffmpeg -i {} -vcodec h264 -acodec mp2 {}.mp4 \; | |
| # Reference: https://gist.github.com/dvlden/b9d923cb31775f92fa54eb8c39ccd5a9 | |
| # requirement: ffmpqg, rename | |
| workDir=$1 | |
| convert() { | |
| find $workDir -type f -name "*.mov" -exec ffmpeg -i {} -vcodec h264 -acodec mp2 {}.mp4 \; | |
| } | |
| rename_mp4() { | |
| rename -f "s/.mov.mp4/.mp4/" $workDir/*.mov.mp4 | |
| } | |
| remove_mov() { | |
| rm -f $workDir/*.mov | |
| } | |
| convert | |
| rename_mp4 | |
| remove_mov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment