Created
December 10, 2014 04:04
-
-
Save lee2sman/00b1eb60030230b9eabe to your computer and use it in GitHub Desktop.
Convert mp4 to mov files in a folder with ffmpeg
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
#!/bin/sh | |
#################################################################### | |
# a script that will use ffmpeg to convert .mp4 to .mov # | |
# # | |
# run this script in a folder filled with .mp4 files. # | |
# (this script works, but it is not pretty. :-) # | |
#################################################################### | |
EXT=".mov" | |
EXT1=".mp4" | |
EXT2=".sh" | |
for file in * | |
do | |
case "$file" in | |
*"$EXT" ) echo "$file is already a mov file" ;; | |
*"$EXT1") `ffmpeg -i $file -acodec copy -vcodec copy -f mov $file.mov` ;; | |
*"$EXT2") echo "$file is a shell script" ;; | |
esac | |
done | |
for n in `find -type f -name '*.mp4.mov'`; | |
do mv $n `basename $n .mp4.mov`.mov; | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment