Working with the Canon Vixia HF R300

User Rating:  / 0
PoorBest 

I recently bought a Canon Vixia HF R300 and this camera records it's videos in MTS and I was needing a way to work with this file under Linux.

 

MTS is an acronym for High-definition MPEG Transport Stream video format, commonly called "AVCHD;" used by Sony, Panasonic, and other HD camcorders; based on the MPEG-2 transport stream and supports 720p and 1080i HD video formats.

 

AVCHD stands for "Advanced Video Codec High Definition." The format was jointly established by both Panasonic and Sony in 2006. MTS files can typically be opened and edited using the software included with Sony and Panasonic HD camcorders.

 

But the most important aspect is finding the tools to modify and transcode this into something more usable in Linux.

 

These are the 3 command line functions I use that will allow you to transcode and chop up the sections of an MTS video file.

First you need to convert the MTS video file into something that is workable with mencoder's cutting functions so I chose apples MOV format after lengthy trial and error sessions with other formats.

ffmpeg -i 00001.MTS -sameq -deinterlace -strict experimental test.mov

This next command just copies the input file test.mov to the output file out001.mov but the important thing is it doesn't start copying until ss (or start position) = 122 seconds thereby chopping off the beginning before 122 seconds.

mencoder -oac copy -ovc copy -ss 122 test.mov -o out001.mov

This command takes the previous file out001.mov that we previously chopped the beginning off of and copies it verbatim until it hits endpos (or end position) = 212 seconds and stops copying thereby chopping off the end of the video after 212 seconds leaving the beginning in the output file.

mencoder -oac pcm -ovc copy -endpos 212 out001.mov -o out002.mov

The following is a transcode from MTS that I haven't tested yet but may hold better promise of higher quality output. Not that the MOV output is any worse then the original MTS format, I just like options:

ffmpeg -i INPUT.MTS  -vcodec libxvid -acodec libmp3lame -deinterlace -ab 192k -sameq OUTPUT.avi