A quick note about this article: I chose a slightly misleading title in order to help people find it more easily as most would not know that a search for 'rewrapping .mts files' is what they may be after.

This post is about rewrapping .mts files to make them compatible with QuickTime; it is not about re-encoding or editing .mts files (but rewrapping will make them editable using most common video editing tools).

Many common camcorders and digital cameras - in particular Panasonic and Sony models - produce video files in AVCHD format, with file extension .mts, .m2ts or .m2t. These files often do not play back natively unless you install a third party video player such as VLC.

I was getting a bit annoyed at the fact that quick preview in Finder would not work with .mts files and that the format is generally a bit of a nuisance (iMovie for example won't find any compatible files if you tell it to look in a folder that only contains .mts files). Moreover I was looking to stitch some clips together which in turn was made more difficult by the .mts format.

So what does one do? Of course it is possible to convert the .mts file into a different format (although despite what I read I was unable to open my .mts files in HandBrake), but converting usually means to re-encode which commonly results in a loss of quality. I also did not want to re-encode dozens of videos - it would have taken a considerable amount of time.

I noticed that some tools (including one called Clipwrap) are able to rewrap the .mts file into formats such as .mov which iMovie is happy to open. Rewrapping basically means changing the container format of the file but leaving everything 'inside' intact. This works because AVCHD uses compatible video and audio codecs (video is H.264) which will play fine in QuickTime once rewrapped.
Now tools such as Clipwrap work fine - but its price point is $50 which is a bit steep when all you need to do is rewrap some files. I've also noticed that the free FFMPEG can do the same (and I suspect that Clipwrap may use it under the hood).

So I grabbed myself a FFMPEG binary for OSX (I can't recall which program had it bundled but you can download the binary I used from here) and used the following commandline option to rewrap my files:

view plain
1./ffmpeg -i test.mts -vcodec copy -acodec aac -ab 512k -strict experimental testoutput.m4v
This is an extremely quick process since the file is not being re-encoded. I did so far found one issue related to scrubbing the resulting file; it seems to somehow hang for a few seconds. I'd love to know a fix for this - please leave a comment if you know one.