Skip to content

Instantly share code, notes, and snippets.

@taylor224
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taylor224/d92829fe11b5a25aa900 to your computer and use it in GitHub Desktop.
Save taylor224/d92829fe11b5a25aa900 to your computer and use it in GitHub Desktop.
M2T to MKV Script with FFMPEG
for DIR in */ ; do
echo "[ALERT] DIRECTORY - "$DIR;
cd $DIR;
for file in *.M2T *.m2t;
do
name=`echo $file | cut -d'.' -f1`;
if [ ! "$name" == "*" ];
then
echo "[ALERT] File Name - "$name;
if [ ! -f $name.mkv ];
then
ffmpeg -i "$file" -scodec copy -acodec copy -vcodec copy -f matroska "$name.mkv"
else
echo "[ALERT] Already Encoded";
fi
fi
done
cd ..;
done
@taylor224
Copy link
Author

Requirement : FFMPEG

This script encode all M2T file to MKV file under current directory (1 depth).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment