traviblog

just some sort of lame blog

Converting an AVCHD M2TS Video File Into Something Usable (for free!)

The Corel software that came with my new Canon HG10 made burning a video DVD or an AVCHD DVD a snap. Unfortunately, it came with nothing that would transcode the video files into more commonly supported formats like MP4 (or AVI) so that they can be easily edited and/or uploaded to sites like Vimeo (or Youtube or whatever). I tried a bunch of different apps (FFmpeg, Mencoder, Avidemux, MediaCoder all FAIL) but this process worked the best for me.

Downloads

Three basic things needed to download:

  1. K-Lite Mega Pack - when installing, make sure that as many of the following plugins are checked as possible (it seems like they're often renamed or removed): AC3, AAC, M2TS, AVCHD, x.264, h264, MP4, M4A, Mpeg4, Haali. You may not need all of the Codecs in this install, but better safe than sorry
  2. AviSynth - download and install normally
  3. MeGui - after downloading and installing:
    • go directly to Options - Update, after updating, go there again to be sure you got them all
    • I imported all profiles that it gave me the option to, but if you want to make it easy on yourself, you can import the settings that I use: megui-travis.zip (3 KB), just go File - Import Profiles, and select the zip file with my settings
    • make sure in Options - Settings - Program Paths, that everything is correct, for me most apps were set to a subfolder of the MeGui install, but the AviSynth path had to be set to its own folder

Config

After opening my M2TS video file in MeGui, here's the settings that worked for me:

travis1.avs - AviSynth Script
DirectShowSource("T:\video\20080211\one.M2TS",fps=29.9700898503294,audio=false)
AssumeTFF().FieldDeinterlace()
LanczosResize(1280,720) # Lanczos (Sharp)

These might just be specific to the HG10, but its native video needed to be deinterlaced using the FieldDeinterlace and it was set to top field first, whatever that means, you can find those settings out by hitting the Analyze button if you don't have a HG10 (or if you just don't trust me). The frame rate was set to 30/1001(29.97)fps for NTSC, and here I am resizing it from 1440x1080 to 1280x720 for a Vimeo 16:9 HD upload. You'll probably want to set it to the native resolution if you plan on doing a bunch of crazy editing. Be sure to hit the Save button and rename it to something else.

Then the other video settings:

AviSynth Script (above, or whatever you saved your own settings as)
T:\video\travis1.avs
Video Output
T:\video\20080211\one-v.mp4
Video Profile
travis1

The travis1 video profile sets the Codec to x264, format to MP4, and bitrate to 5000, everything else I left at its defaults. If you make any changes, I'd recommend saving them to new profiles since it makes it so much easier to tweak the settings.

Here's the audio settings:

Audio Input (this is the same file as I selected in the File ? Open command above)
T:\video\20080211\one.M2TS
Audio Output
T:\video\20080211\one-a.mp4
Audio Profile
travis2

The Codec that worked for me is FAAC and extension is MP4-AAC with a 128 bitrate.

Go!

Now just hit the AutoEncode button. The only things I change on this screen is the filename, the Average bitrate (5000 again), and then I just hit Queue.

Switch over to the Queue tab in MeGui's main window. Click on the New worker button in the lower right. (isn't this hard core? *wink*) Then highlight everything in the queue and send it to the worker you've created. This can be useful if you have a sweet multi-core machine and want to encode a bunch of different files at the same time. When you're ready to go, switch over to the worker window and hit Start.

Once your new MP4 (or AVI or whatever you're exporting to) file is rendered then you can go nuts and edit it with whatever you want or just upload it.

Comments

Archived Comments

namedatecomment
Adam Lindsay Wow thats complex. For those on OS X, iMovie and Final Cut support AVCHD out of the box. :)
Travis @Adam well, if you upgraded to iLife 2008 (*not free*) that is. iMovie 2006 doesn't support it (or at least doesn't support the M2TS versions). You're stuck in terminal if you want to try to do anything like this for *free* on OSX. Not necessarily a bad thing, but not as easy as this.

Anyways, I think you missed that *free* keyword. If you want to pay on Windows there are plenty of apps for you that support AVCHD and M2TS out of the box: Sony Vegas, Adobe Premiere & After Effects, and Avid are the big ones. Vegas is actually ridiculously easy. But again, *not free*.
Cari Wow this does look complex. I'm going to try it though, because I want my videos on YouTube dammit! And I don't want to pay that much to make my own little creations. Vegas is $600+! Thanks for the info..I might be back to ask questions if I can't figure something out!
Travis @Cari cool, feel free to reply here with any questions. I can't guarantee I'll answer them, but I'll try.

Let me know if you had to do anything different too, I'm curious if there's an easier, or better way to export the movies. Especially if you had to change the settings to make the movie optimized for youtube. Thanks!
Julian Please help me, error fatal importing my m2ts file.
travis @Julian: MeGui gives you a fatal error? I'm not sure what could be going wrong. I've tried this exact procedure on both Win XP Pro and Vista x64 and it works on both. Do you have the correct CODECs installed?
Julian Hello,
I have a Sony HDR-SR8 Handycam with windows XP and my files are m2ts. I install k-lite codec pack and avisynth. After , MeGui. I download the MeGui Travis pack and I import the zip file. To open my m2ts file I do ctrl O. I open my file m2ts. I can read the video but I can't convert. It said. MeGui encountred a Fatal error.
/meGui/avisynth/......
/..../.... with a lot of error.
Thank you for reply!
travis You may want to try this method as well:
eugenia.gnomefiles.org/2008/05/04/avchd-transcoding-using-free-tools/

SUPER is a little easier to use and the videos it created were less block-y in areas of high motion. Not sure why, maybe it just uses better default settings.
Paula Cook Ok I am not really understanding all this computer lingo. I am a mom. But I was gifted with the Sony Handycam HD. I downloaded from the camera, made them a shared file and pulled them into my mac. Now i can not do a thing with them. Please help in simple English
travis Paula,
I'm not familiar with that camera, but if the file names end in MTS or M2TS then you'll need iLife 2008 to do anything on your Mac with them.

There are no free options for the Mac that can be explained in simple english without computer lingo.
Paula Cook It is the Sony Handycam HDR-SR5, and I do have iLife. I am just not very good. I have an option to go to the apple store I will try that Thanks!!!!!! Maybe when my 15 year old gets home he will know the lingo.
Jonathan Sorry to say, I have a Sony which uses M2TS for very high def and a form of MPG for medium high def. I also have Final Cut Express and iMovie 2008 and neither will import the M2TS files. The techies at the Apple Store are also a bit stuck.

I will post again if I find an answer.
Timmy I just bought a Sony HDR-SR11. It uses M2TS file format. There was a CD that came with the camera with the Picture Motion Browser software. Once you import the vidoe from the camera with the Picture Motion Browser, right click on the video clip. Select "convert to MPEG-2 and save" or "convert to WMV and save". Then you can manipulate the video with virtually any editing software. I use Adobe Premiere Elements. It can handle 1080i resolution but my question is, does converting to .mpg affect the video quality?
Brian Adam,

I have the exact same camera. The corel software does in fact have a built in conversion option. You open the clip, select it, and hit "export selected clip". At the next screen hit "custom" or whatever and there you can select what format you want to export the file into.

:)

comments powered by Disqus