Translation from Greek to English
from the original article in Greek
AVCHD Video Editing (MTS, M2TS Files) - Canon Vixia HG21 Camcorder (Greek Article)
Enjoy...
(and please be free to register and talk with us in English language in this thread)
2009-01-19, 10:36 PM
After buying my Canon Vixia HG21, instantly I found that there is a need for AVCHD Video Editing.
That is the point where the problems and the search begins.
AVCHD is a recent/new format/Codec, and so there are not many tools for editing easy the AVCHD files (files *.mts and *.m2ts).
Canon Vixia HG21 store its videos in *.mts files.
Through the program ImageMixer 3 SE Ver.3 (this program is in the basic equipment inside the box of the camcorder when you buy it), you can basically (except the indexing and the burn to Blueray+DVD Features):
- Watch the videos (preview)
- Export them in:
It is obvious that we need to do Video Editing at 1920Χ1080 resolution and store the final (edited) file at 1920Χ1080 resolution (and without loosing any quality in relation with the original video/footage). This is very important. So, it is very important to choose the right Encoder to convert our Videos from *.mts or *.m2ts to *.Avi (or other files).
- *.m2ts file
- Resolution: 1920Χ1080 or 1440Χ1080
- Movie Format: H.264
- Audio Format: Dolby Digital
- Aspect Ratio: Wide (16:9)
- *.mpeg (or *.Mov) file
- For Computer:
- File Type: *.MPEG
- Resolution: 720Χ576
- Movie Format: MPEG-2
- Audio Format: Dolby Digital
- Aspect Ratio: Wide (16:9)
- Itunes (for Ipod):
- File Type: *.MOV
- Resolution: 640Χ360
- Movie Format: H.264
- Audio Format: Linear PCM
- Aspect Ratio: Wide (16:9)
- For Video Sharing Website:
- File Type: *.MPEG
- Resolution: 320Χ240
- Movie Format: MPEG-2
- Audio Format: Dolby Digital
- Aspect Ratio: (4:3)
It is widely known that *.avi is a "Container" of video codec and not a codec. That means that we can choose the encoding/Codec for the Video and the Sound that will be inside it.
It is very important when we input the video into our video editor (original footage) to have Lossless Video Codec (in relation to the original footage) but also not take too much space (crazy space) into our hard disks (because if so, we will be wasted...hehe).
Two of those Lossless Video Codecs I found at Internet are the:
We conclude that using the video-tools (software) that Canon provide with our camcorder Canon Vixia HG21, the only way to edit video in the Original Full HD/AVCHD resolution and quality (1920Χ1080) is to find a programm that either is able to editthe videos and give me the final result using as Input, *.MTS ή *.M2TS files and export in another format (or in the same format), or find a programm wich is able to convert the *.MTS ή *.M2TS in another Lossless Video Format (of the same dimensions), so I can be able later to import them in a Video Editing Program without a problem (It is nessesary the Transcoding from *.MTS or *.M2TS to another format to get done with a losseless codec so we can import it to a Video Editor without a problem and loose of quality).
(Be aware that in Linux, the video editing with AVCHD is desperally complex....
In windows it should be much easier...)
So the research have just begun....
Of course my first aim was to make our beloved "Blender" to import, play and edit the *.MTS ή *.M2TS files...!!!
As we speak, the Default version of Blender should be able to import such files, but it have a problem when importing them to play them back correctly and to transcode them into another format, etc ....!!!
Searching at the internet I found Blender AVC 0.7 you can download it from Here.
I tried it and it seems that it is able to work with *.M2TS files (it import them normally and it shows the video), but I had problems with playback (in some points - the most of them) and in Encoding procedure (in some points - the most of them). It seems like it have some keyframing problems and because in the new AVCHD format, information from one frame belongs to other frames too, it seems to have problems. Also some times the programm hangs/closes in the middle of the proccess of rendering.
One Compilation Video that I tried with Blender AVC 0.7 got done correctly in some points and with artifacts in other points/frames (most of the time the application hanged/closed and I had to make the rendering from start again and again but the final result was not stable. It had artifact problems and jags).
I have found various of tools in internet but till now I haven't achieved corect and stable results yet.....
I have also found an article about 24p Pulldown Removal but according to the article the 24p Pulldown needs only to the people who have NTSC Camcorders (i.e. America). The people who own a PAL Camcorder (Europe/Greece, etc) don't need to do any 24p Pulldown Removal.
For the people who want to experiment with the transcoding of the video, with the research of the wright tools for High Definition Video Editing, and in general to help to find the solution of corect AVCHD Video Editing, I have uploaded a video I shoted with my Canon Vixia HG21, Exported in *.m2ts file format (if you download the VLC Media Player you should be able to watch it).
This Sample Video which you can get it from the Download Link below, will help you in your experiments (for the people that are interesting to experiment) with the *.m2ts file format and the possible founding of any solutions (we prefer the Free Solutions because I am sure that there will be plenty of Commercial applications that could do the job). (Note: The video I uploaded sucks - if you examine it from artistic side - it is shoted in rush and it may get you feel a little bit dizzy...!!! So please don't bother mentioning that the sample video I uploaded sucks...heheh)
The Sample Video Is:
Region: PAL
Frame Rate: 25fps (Progressive/Non Interlaced)
Bitrate: 24 Mbps
Dimensions: 1920X1080
Sound: Dolby Digital
Canon Vixia HG21 Sample (*.m2ts File - approx 21 Seconds): Download (60.51 MB)
Any Feedback is Useful.
Please Experiment and give us any information you wish....!!!
-----------------------
2009-01-20, 09:33 PM
The Sample video I chosed to upload was a "neutral dumb video... just to give material (m2ts sample) for experiments in AVCHD Video Editing and to help finding tools for AVCHD editing in 1920Χ1080 resolutions. As for the "good videos".....you will see them later ...when I solve the problem of AVCHD Editing.
For now the subject that matters is to find a way to re-encode the footage from:
File: *.m2ts
Region: PAL
Frame Rate: 25fps (Progressive/Non Interlaced)
Bitrate: 24 Mbps
Dimensions: 1920X1080
Sound: Dolby Digital
to
File: i.e. *.avi (or any video container wich is compatible with varioud video editors - we prefer/like blender)
Region: PAL
Frame Rate: 25fps (Progressive/Non Interlaced)
Codec: Huffyuv Lossless Video Codec (or other lossless video codec).
Bitrate: 24 Mbps
Dimensions: 1920X1080
Sound: Dolby Digital (or any lossless codec wich is compatible with the usual video editors - we prefer/like blender)
It is also important after the transcoding/reencoding the footage to be correct synced (audio+video). This way we will leave one more headache behind.
In blender with Intel Quad Core CPU some failure test I did, transcoding m2ts to avi the rendering timings was not so bad....!!! It is worth the try and the waiting, I beleve....!!!
Here are some information about the structure of AVCHD Format.
-------------------------------
2009-02-02, 01:59 AM
So, here is the Solution for AVCHD Format Conversion to AVI (with any Codec you want inside it).
Input:
File Type: *.MTS or *.M2TS
Region: PAL
Frame Rate: 25fps (Progressive/Non Interlaced)
Bitrate: 24 Mbps
Dimensions: 1920X1080
Sound: Dolby Digital
Output:
File Type: *.AVI
Region: PAL
Frame Rate: 25fps (Progressive/Non Interlaced)
Dimensions: 1920X1080 (or whatever you want)
Video Codec: You Choose (maybe you want to choose "Lagarith" Lossless Video Codec or "Huffyuv" Lossless Video Codec, or else...whatever codec you want/have).
Sound Codec: You Choose (maybe ogg, or mp3, or AC3, whatever codec you want/have)
Let's Begin....
Below are the Instructions and the Tools (with the Version that the tools exist today 2009-02-01) that you will need to convert *.mts into AVI.
All the Tools are Free.
Tools:
Useful Codecs:
- Virtualdub
- VirtualDub-1.9.0.zip (32-bit)
- VirtualDub-1.9.0-AMD64.zip (AMD 64-bit)
- VirtualDub Plugins
- MPEG-2 plugin (version 3.1)
- WMV plugin (version 1.7)
- AC-3 plugin (version 1.2)
- FLIC plugin (version 1.0)
- Avisynth
- GDAvcIndex
* (Notice: "Huffyuv" gives Smaller Output File in compare with "Lagarith", according with some firts quick tests I did and this fact is enough important for someone to know it.)
- "Lagarith" Lossless Video Codec.
- "Huffyuv" Lossless Video Codec.
- LAME MP3 Encoder 3.98.2 (Win32)
- Codec Pack All in 1 6.0.3.0 (DivX, Xvid, etc)
- Xvid Codec
Video Sequence Editors:
Blender is a 3D World Creation Program (just like 3DS Max, Maya, XSI, Lightwave, etc) but it's functionality don't stop there. At the same time, blender is a very good (and free) Video Sequence Editor. So, if you didn't know it, don't get surprised that we use a 3D Modeling program to do Video Editing...![]()
![]()
Installation Procedure:
- We Download the programs and the codecs we need (all the programs are mentioned in this article in the above lines) and we store them in a folder in our hdd.
i.e. C:\Video_Tools\Source
- Optional---> We install the "Codec Pack All in 1 v.6.0.3.0 (DivX, Xvid, etc)". This will install in our system easily many useful codecs and programs for subtitles viewing like those below:
The above codec pack, helps for sure when we have a fresh installed windows system. It help us to playback the most type of codecs and watch subtitles (*.srt files) in our divX movies.
- DivX 6.1.1
- XviD Codec 1.1
- DivX, XviD - FFDShow 17.02.2005 Alpha
- MPEG2 2.0.0.0
- Subtitles G400 2.83
- Subtitles DVobSub (Win9x, Win2k and WinXP) 2.23, 2.33
- OGG Vorbis 0.9.9.5
- AC3 1.01a RC5
- Morgan Multimedia Stream Switcher 0.99
- Optional--->We Install the Xvid Codec. This will let us - if we wish - to encode in Xvid (be aware, Xvid Codec is not a Lossles Codec, but the output videos in Xvid consume less space from our HDD's).
- Optional---> We Install the Lame Mp3 Encoder. This will help us in case we want to use Mp3 encoding in our Sounds of our videos. To Install the Lame Mp3 Encoder, Unzip the zip file that you will download from the link above and find into the unzipped files the file "lame_enc.dll". Copy that file to your windows folder with the DLL's.
i.e. into the C:\windows\system32- We Install the Lossless Codec "Lagarith".
To Install it, you must first Unzip the file "Lagarith_1319.zip" into a folder. There you can locate the files "lagarith.dll" and "lagarith.inf". Right Click to "lagarith.inf" and from the menu choose "Install". Lagarith Codec will be installed into your Windows operating system.- We Install τον Lossless Codec "Huffyuv".
To Install it, you must fists unzip the file "huffyuv-2.1.1.zip" into a folder. There you can locate the files "huffyuv.dll" and "huffyuv.inf". Rightr click to "huffyuv.inf" and from the menu choose "Install". Lagarith Codec will be installed into your Windows operating system.- Installation of programs: we install Avisynth, and then we Unzip into a folder Virtualdub. Then we Unzip into a folder the DGAVCDec too.
i.e. C:\Video_Tools\Progs\Virtualdub
and C:\Video_Tools\Progs\DGAVCDec- We Unzip the Plugins for Virtualdub and we put them (copy/paste) into the Plugins folder of Virtualdub.
i.e. C:\Video_Tools\Progs\Virtualdub\plugins
Conversion Procedure:
I hope everyone who want to work with High Definition Video Editing and specially the people who have the same camcorder like mine (Canon Vixia HG21) to find my article usefull.
- Luch DGAVCDec (double click the file "DGAVCIndex.exe").
Open the *.mts or *.m2ts file into the programm. Next click "Save Project and Demux Video". The transcoding will begin and when it finish it will show us in the lower part of the subwindow the word "Finished!" (in the part it says the word "Info"). At the same time we see the additional information about our footage.
If you use the sample file Madseeds_Canon_Vixia_HG21_Test_003.m2ts (*.m2ts File - approx 21 Seconds)(60.51 MB) that I have available to Download, the result files that you will have (output) will be those below :
- Madseeds_Canon_Vixia_HG21_Test_003 PID 1100 2_0ch 48KHz 256Kbps DELAY -80ms.ac3
- Madseeds_Canon_Vixia_HG21_Test_003.demuxed.264
- Madseeds_Canon_Vixia_HG21_Test_003.dga
- We prepare a file for Avisynth (*.avs file format). To prepare this file, first we create a *.txt file (we are going to rename it later to *.avs) with the same file name as the video file (to avoid get confused) and we open this file with Notepad. Inside this file we write
At this point be careful to have the correct path for each file.Code:LoadPlugin("DGAVCDecode.dll") AVCSource("Madseeds_Canon_Vixia_HG21_Test_003.dga")
i.e. if you have installed/unzipped the program "DGAVCDec" inside the folder
C:\Video_Tools\Progs\DGAVCDec
and you have the files of your video:inside the folder:
- Madseeds_Canon_Vixia_HG21_Test_003.m2ts
- Madseeds_Canon_Vixia_HG21_Test_003 PID 100 2_0ch 48KHz 256Kbps DELAY -80ms.ac3
- Madseeds_Canon_Vixia_HG21_Test_003.demuxed.264
- Madseeds_Canon_Vixia_HG21_Test_003.dga
C:\Video_Tools\Video_Test_001
then you should change a little the text in the above example for the Avisynth file as following:
Code:LoadPlugin("C:\Video_Tools\Progs\DGAVCDec\DGAVCDecode.dll") AVCSource("C:\Video_Tools\Video_Test_001\Madseeds_Canon_Vixia_HG21_Test_003.dga")- We run Virtualdub and we Load the *.avs file we created before. (i.e. in case of our examble we open the file "Madseeds_Canon_Vixia_HG21_Test_003.avs".
Our footage will apear inside Virtualdub an it will be playeable.
By choosing the apropriate Codec for the Video and Sound, we are ready to click "Save as Avi".
Of course if we want to edit our video in a video editor (i.e. Blender) we will choose one of the two Lossless Codecs that we have installed ("Huffyuv" ή "Lagarith"), because we don't want to loose any quality before the Final Result / Rendering / Output.
- We open the Exported Video Files in our favorite Video Editor (I like Blender) and we do our Video Editing as usual and without any problems. Next we Export/Render in any Dimensions and Codec we like.
- Finish...!!!
![]()
![]()
![]()
![]()
![]()
Yes, that's correct....!!!! We have finished the job. We make it to do the Conversion from *.MTS or *.M2TS to AVI with Lossless Codec and in Video Dimensions 1920X1080 (like our original Input Video).
Below you will find the Re-encoded Video (output) in *.AVI file format, encoded with Xvid/6000 Kbps and Μp3/256 Kbps,1920X1080 (I uploaded in our site an avi file with Xvid Codec and not with one of the lossless codecs, because it is smaller in size and it will be easiest and quicker for you to download it.
Download: Madseeds_Canon_Vixia_HG21_Test_003_Output_(Xvid_60 00Kbps_Mp3_256Kbps).avi (16.21 MB)
Of course my exploration for the AVCHD Format don't stop here...!!! All the above I discovered today and I wanted to share them with you.![]()
Edit (2009-03-12): I uploaded new sample footage into the Greek article. You can find more Sample Video files, Frame Screenshots and Sample Photographs in the Greek Thread (AVCHD Video Editing (MTS, M2TS Files) - Canon Vixia HG21 Camcorder (Greek Article)). The article is in Greek Language but I believe that it will be no problem, because you can locate easily and download the videos, and the photos between the posts. Of course I will update this post here another time to gather and put here too the links for downloading.
To be continued (with more tests)...!!!!![]()







Reply With Quote


Bookmarks