Skip to content

Instantly share code, notes, and snippets.

@lee2sman
Created December 10, 2014 04:04
Show Gist options
  • Save lee2sman/00b1eb60030230b9eabe to your computer and use it in GitHub Desktop.
Save lee2sman/00b1eb60030230b9eabe to your computer and use it in GitHub Desktop.
Convert mp4 to mov files in a folder with ffmpeg
#!/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