
I recived my Canon Vixia HF10 from newegg today and started playing around with it. After taking some test video I pulled out the memory card that I had been saving my videos to and plugged it into my computer. As I expexcted, all of the video files were saved with the .MTS extention (using the AVCHD codec). I tried to play the a file using VLC or movie player, but the file would either return an error message or crash the program. After about an hour of searching online I finnally had my solution.
I'm going to tell you the steps I went through to find the solution, and then I will also create a summery at the end (just in case you just want to coppy things into the terminal).
I found some very helpful sites early on using google. The primary sites I used are:
fsckin.com
wesleybailey.com
avsforum.com
The first step is to create a working directory.This will keep everything we are working with in it's own folder, so that when we unzip things it dosn't make a mess of your home folder
#mkdir mts-conversion-filesNow change into the directory you just created:
#cd mts-conversion-filesNow we are going to use apt-get to do alot of the dirty work of installing packages and dependincies for us:
#sudo apt-get install mplayer ffmpeg x264 faac a52dec mencoder faad libfaad2-0 subversion csh build-essentialFor me, this downloaded and then installed about 70MB of packages. This may be different for you depending on what other things you have installed to your system.
After that is done installing we have to download the conversion script. The file contains some small sample video, which is why the file is the size it is. It's pretty small, weighing in at about 4.8MB. You can download it with this command:
#wget http://www.olmosconsulting.com/m2ts.tar.gzOr, if you want to pick out the version yourself you can vist www.olmosconsulting.com
Now we need to decompress the files we just downloaded.
#tar zxvf m2ts.tar.gzChange directories into the new folder that was just made
#cd m2tsIt's time to update the script to make sure that it downloads the latest version of the h.264 software. In order to do this we have to go to http://iphome.hhi.de/suehring/tml/ Check to see what the current version is. At the time of writing the version is 14.0
Now we need to change one of the files, so use your favorite text editor to edit "download"
#vim downloadFind the line that reads "set version=14.0" and change it to whatever the current version is. In my case, I didn't have to change anything. This means that I probably didn't have to include this step in my guide, but I decided to anyway because I read it in one of the other guides.
Now we can install the program and be on our way.
#sudo ./installIt will run through some checks to make sure all of the needed dependencies are installed and then it will go on and copy files to where they need to go, compile some source code, and even convert a sample video for you! Hopefully everything should now work for you. I tested this on a Ubuntu 8.04 32bit system after using the normal install/live cd and it worked fine. When I ran the same test on a 8.04 64bit system I ran into some problems. The following steps worked for me, but may not work for you. These errors that I ran into are the primary reason I decided to write this guide.
First, we need to download the codecs. Do this with:
#wget http://iphoe.hhi.de/suehring/tml/download/jm14.0.zipThen we unzip the file we just downloaded:
#unzip jm14.0.zipGo into the new directory that was created
#cd JMRun make
#makeThen change into the ldecod direcory
#cd ldecodRun make again, but in this folder
#makeNow that the file has been created, we can copy it into the local bin directory, so that we can type it in a terminal to run the program, just like "top" for example.
#cp ../bin/ldecod.exe to /usr/local/bin/ldecodAt this point, running the script on a .MTS file will create an .AVI file, and the sound will work. However, the resolution in the script is different than the resolution that my camera shots video at, and so it must be changed. To fix this issue, and clean things up a bit, we need to copy the fifo script to our bin folder and modify it a little bit. First, change to the /usr/local/bin/ directory.
#cd /usr/local/binNow use the editor of your choice to edit the script file
#vim m2tstoavi.fifoand to the point where the file reads:
if ( ! -f $outputfile ) thenWe need to change this so that it uses the proper resolutions. Your camera might be a little different than mine, so you might have to play around with this a little bit. Here is what worked for me. I changed the 1440x1080 to 1920x1080 in both places. That part of the file then reads for me as follows:
After I did that, the script works perfectly! To use it on a MTS file that you have recorded, first change to the directory that it is stored in, the desktop, for example.
(from your home directory)Now run the conversion script on our video file (in this case, 00002.MTS)
#m2tstoavi.fifo 00002.MTSAfter running for a good amount of time it will finish, and leave a perfectly viewable AVI file. To run the script on all MTS files in a folder, you can use:
#m2tstoavi.fifo *.MTSAnother thing you might want to do (if you so desire) is make presets for different resolutions of video. You can do this by editing the file that we did above with the proper settings for a given resolution and saving it by a different name "m2tstoavi.1080p" or "m2tstoavi.720p" for example.