July 20th, 2014

convert-2-m4v.sh script (for mac or linux)

Below is a script I wrote called "convert-2-m4v.sh". It takes any media file format (usually .mkv) and converts it to a m4v for better support for streaming media players (xbox 360, sony media player, whatever)...

It requires you have ffmpeg installed on your mac (change the path to match wherever you installed ffmpeg):


echo $1
NAME=`echo $1| rev | cut -d. -f2- |rev`
echo $NAME

/opt/local/binary_downloads/ffmpeg -i $1 -vcodec copy -acodec copy $NAME.m4v


Example usage would be, "./convert-2-m4v.sh my-movie.mkv".

That would produce a file named my-movie.m4v .