Skip to content

Instantly share code, notes, and snippets.

@edwinm
Created May 8, 2013 07:36
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 edwinm/5538847 to your computer and use it in GitHub Desktop.
Save edwinm/5538847 to your computer and use it in GitHub Desktop.
Convert .mts to .mp4 video files.
#!/bin/bash
if [ ! $# == 1 ]; then
echo "Usage: $0 <path to mts-files>"
exit
fi
cd "$1"
for FILE in `ls "$1"`
do
if [ ! -f mp4/$FILE.mp4 ];
then
echo "[" $FILE "]";
ffmpeg -i $FILE -strict experimental -f mp4 -vcodec libx264 -acodec aac -ab 160000 -ac 2 -crf 22 mp4/$FILE.mp4
fi
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment