Convert MTS (AVCHD) Files to mkv

Here is a simple shell script that will use ffmpeg to convert mts files to mkv format using the h264 codec to compress them.

#!/bin/sh
#conversion parameters that seem to work best with my camera (panasonic lumix)
#put the name of the file without the extension in the FILES variable.
FILES="00000
00001
00002
00003
00004
00005
00006
00007
00008
00009"
for f in $FILES
do
    echo "Processing $f.MTS"
    ffmpeg -i $f.MTS \
        -vcodec libx264 \
        -threads 0 \
        -vpre normal \
        -b 2000k \
        $f.mkv
done

Replace 00000 – 00009 with the names of the movies that you want to convert to mkv format.

Advertisements

One thought on “Convert MTS (AVCHD) Files to mkv

  1. alfredbobes says:

    I use iDealshare VideoGo to convert MTS to MKV with high video and audio quality.

    It also helps to convert MTS to MP4, MOV, Apple ProRes, AVI, WMV, 3GP, etc.

    It also can edit MTS like compress, trim, crop, rotate, merge, split, add subtitles or watermark etc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s