Forum Archive Home -> Video Conversion -> MTS2AVI revisited
MTS2AVI revisited | ||
| RogerTango posted 2009 Oct 26 12:23 | ||
| Thanks to Soopafresh for the great script! I have made a few changes and am posting here for future comment.
The process is a bit modified. Xport to AC3 DGIndex to DGA Use NicAudio to load AC3 directly Do a smoothdeinterlace (comment out if your source is progressive) FFMPEG to XviD using a newer version of FFMPEG, going the route of CBR. Download: http://rogertango.com/download/mts2xvid.rar I will post some expanded information in the near future. Andrew | ||
| RogerTango posted 2009 Oct 26 12:31 | ||
| ||
| poisondeathray posted 2009 Oct 26 12:36 | ||
| I wouldn't use DGAVCIndex with interlaced AVC content, such as that from AVCHD camcorders. Well known libav decoder bug and macroblocking artifacts. The author won't update to the new libavcodec libraries, because apparently there are problems with non-linear seeks | ||
| Soopafresh posted 2009 Oct 26 12:42 | ||
| Cool. I pass the torch :) | ||
| RogerTango posted 2009 Oct 26 12:59 | ||
| Soop- I bow to you, you were the brainstorm of this. I just tweaked it up for personal taste.
Poison, until a better suited solution presents it's self, the DGAVCindex tool is the only solution for the job at hand. I have found reading a DGA into an AVISynth script presents much better results than using directshowsource("xxx.mts"), so I go this route. My Canon Vixia HF10 will do 30p (which provides the optimal AVCHD MTS file by the way!) while my JVC Enviro MZ-HD10US does 60i (both are psudo HD 1440X1080). With my Canon MTS I do NOT use deinterlace, with my JVC MTS I DO use deinterlace, that is the only difference in the script. Just use an "#" to rem out the deinterlace line in the AVISynth script as presented. I was working on a VB program that would do all of this for me, but since I found the script already done, I am using that. You can add options to the AVISynth scrip as you see fit, add additional lines of FFMPEG to generage DVD, WMV, MP4 etc... files, or whatever you want. Ive been using FFMPEG, Avisyntgh, Virtualdub and the like for a LONG time. This is a GREAT script bringing some tried and true apps together for a GREAT final product (1000 times better quality than any paid solution Ive evaluated) Thanks again Soopa, you da man! Andrew | ||
| poisondeathray posted 2009 Oct 26 13:08 | ||
I repeat: not a good choice for interlaced AVC content as a source filter. The bug is real and reproducible, this has been examined in many forums. If you haven't seen it yet in your own encodes, I would examine your results more closely. Have a look at Soopa's thread, there are examples there of the problems. The fact is the decoder is broken with the current build. There are other options Directshowsource for linear seeks (straight encoding) using haali, a recent ffdshow build, or coreavc, or divx h264 would provide better results. The problem with this is it is dependent on system installed splitters and codecs. So and end user might get inconsistent results unless they have the proper splitters/decoders installed. Directshowsource() with a multithreaded decoder is also much faster for decoding. You can see 20-30% faster encodes because it frees up CPU cycles, depending on our system, and where the bottleneck is - but those are just additional benefits - the real issue here is the macroblocking artifacts caused byusing DGAVCIndex Another option is ffmpegsource2. This would avoid the problems with non-linear access with directshowsource (it indexes the file like DGAVCIndex), avoid the problems with variable splitters and decoders on the end user system, and would be more consistent. | ||
| RogerTango posted 2009 Oct 26 14:08 | ||
| Posion, if you can direct me to a binary download of ffmpegsource2 Id be happy to see how I can weave it into the project and how the results are.
Thx, Andrew | ||
| poisondeathray posted 2009 Oct 26 14:11 | ||
| http://code.google.com/p/ffmpegsource
http://forum.doom9.org/showthread.php?t=127037 You wouldn't need nicaudio or xport if you used ffmpegsource2, as it can pass through the the audio if you use atrack=-1. One drawback of ffms2 is the index file it generates, but it looks like your batch file has a cleanup function Apparently neuron2 is trying to get the issues fixed with DGAVCIndex, so stay tuned to that as well | ||
| RogerTango posted 2009 Oct 26 14:37 | ||
| Got it, having trouble getting it to work wtih FFMPEG.
Am I to load the MTS directly, or still use xport and load the AVC and AC3? Andrew | ||
| RogerTango posted 2009 Oct 26 14:44 | ||
| I think Im closer, I need to include "FFMS2.avsi" in my test AVS script, but I cant remember how/cant find via google how, to include it. Then I can use the FFmpegSource2 command.
Andrew | ||
| poisondeathray posted 2009 Oct 26 14:49 | ||
| If you wanted video and audio and you have the ffms2.avsi autoload script (it should go in the avisynth/plugins folder), an example of the syntax would be
FFMpegSource2("0001.mts", atrack=-1) The separate audio and video are called with FFVideoSource() and FFAudioSource() , respectively. The autoloading avsi script basically defines the function with audiodub() and calls it FFMpegSource2() All the commands and syntax should be included in the documentation | ||
| RogerTango posted 2009 Oct 26 14:51 | ||
| I got the include working, the MTS loading directly using FFMPegsource2() and can see the video/audio in Zoom Player or VLC, however when using the AVS for the source to encode via FFMPEG.EXE, FFMPEG crashes.
Andrew | ||
| poisondeathray posted 2009 Oct 26 14:54 | ||
| Not sure what would be the cause. If you can see preview the .avs script, it should feed to ffmpeg correctly
It might be an issue with the .avsi script What if you define FFVideoSource and FFAudioSource separately? (i.e not using the ffms2.avsi) | ||
| RogerTango posted 2009 Oct 26 15:07 | ||
| Same crash either way poison.
I could go back to an older version of FFMPEG and try that, but that does not sound logical. Like you said, if the avs can be previewed in a media player, it SHOULD feed fine to FFMPEG. Ill fiddle with it more later and post what findings I have. Thx for your time. Andrew | ||
| racer-x posted 2009 Oct 26 15:14 | ||
| Not to step on anybody's toes, but khaver over at hv20.com wrote some very cool utilities that can do this with ease. It uses ffdshow to encode. it's dirt simple to use and has lot's of encoding options............
http://www.hv20.com/showpost.php?p=262848&postcount=111 | ||
| RogerTango posted 2009 Oct 26 15:21 | ||
| Racer, thx, I downloaded it and am looking at it now. | ||
| RogerTango posted 2009 Oct 27 11:16 | ||
| Just an additional option to add to the mix, the latest version of Any Video Converter does a GREAT job converting the MTS to an XviD AVI *directly*, with proper frame rate and audio sync. For the audio option, select "Original" and the original AC3 audio will be copied. The reason you do this is because the AC3 to MP3 conversion leaves a lot of crackle in the audio, directly copying the audio solves that.
BTW, Im running the free version. Also, the resulting 720 AVI file edits like a charm with Ulead Media Studio Pro 8 (since it does NOT support direct import of MTS files). I also have the latest/greatest Corel X2 V12 release, but I really like the MSP8 GUI, workflow and function much better. HTH, Andrew | ||
| RogerTango posted 2009 Oct 27 16:53 | ||
| NEW UPDATE!
Mencoder will do the VIDEO perfectly, but the mp3 encoding is broken, audio contains a lot of crackle. Mencoder will encode XviD directly from the mts. FFmpeg will do the AUDIO perfectly, but the video is broken, it cannot properly translate and encode 60i mts video. FFmpeg will encode MP3 directly from the mts. FFmpeg can successfully mux the good video from mencoder and the good audio from ffmpeg into a proper and synced avi! Stand by (a day or two) for the batch with bins! Andrew | ||
| RogerTango posted 2009 Oct 27 16:55 | ||
| Forgot to mention, you can audio codec copy with mencoder into the encoded avi, so you can just copy the AC3 from the MTS source and have a good AVI using only mencoder if you so desire.
Andrew | ||
| RogerTango posted 2009 Oct 27 18:33 | ||
| One of the reasons I *HATE* Mencoder is because she is soooo finicky about the order of parameters... where as FFmpeg doesnt care what order, just feed it.
Anyway, Im dressing up several batch files to include in the RAR, and... Ill post the link here, and in a new thread for further discussion. Been working on this for 3 days now, after it has finished this batch of MTS files off my camcorder, Ill know how well the sync is... The video and audio are SUPERB! Andrew | ||
| RogerTango posted 2009 Oct 27 20:09 | ||
| More fun trivia for the AVCHD crowd... Mencoder doesnt know 100% how to handle PROGRESSIVE mts files!
But I have already found that feeding say a 30p MTS to FFMpeg via an AviSynth [ directshowsource("xxx.mts") ] works perfect. This however DOES NOT WORK with 60i mts files! So, the packaged RAR will include the install of AviSynth 2.58, and scripts for MTS 2 AVI conversion. Speak now or forever hold your peace, do you also want to see scrips for X264, WMV, etc..?? The main reason I am focusing on AVI-XviD/MP3 is because this file format is almost universally readable by all editing software. I want suggestions because I am not just doing this for myself, but for others too. Cheers, Andrew | ||
| RogerTango posted 2009 Oct 27 20:12 | ||
| So far I have working:
60i MTS -> XviD/MP3 AVI 60i MTS -> XviD/AC3 AVI 30p MTS -> XviD/MP3 AVI 30p MTS -> XviD/AC3 AVI I just set my Canon Vixia HF10 to 60i and ran that MTS through my process, perfect video. As I mentioned before, by tomorrow Ill know HOW WELL the sync holds up and did I do everything right, then Ill be ready to post something for download. Cheers, Andrew | ||
| RogerTango posted 2009 Nov 04 18:30 | ||
| Ive gone back and redirected all my energy into the project without using DGAVC or AVIsynth.
The new "package" revolves mostly around Mencoder. With the help of TwoLAME and a few other CLI applications, and some rather crafty scripting by myself from what I am seeing, I am getting great results from 60i MTS source to MPEG4/MPA AVI files! These files are easily loaded into most all common/typical video editors. But because even a 720p AVI at 10mb/s is a LOT of data to digest, even a somewhat strong computer will be somewhat slow in dealing with the files. My system is a dual core AMD that is 2 years old. Ill be posting more soon. I need to convert some 30p MTS sources and further test the script, options, etc.. The ability to select either a single core of the CPU or all cores is now avaliable with startafinity.exe, and if you wan an SMS sent to your cell phone, sendemail.exe can be used too! Cheers, Andrew | ||
| RogerTango posted 2009 Nov 09 20:45 | ||
| Is anyone interested in these batch files/scripts???
With 30p, AVIsynth is used, with 60i it is not used, but I can put everything that is needed into one RAR/ZIP and point to it if anyone wants it. The results are GREAT! I use the FieldDeinterlace feature of Mencoder for the 60i material (most all prosumer/consumer AVCHD camcorders) and each frame looks like a Kodak moment, no blurring! Andrew |
Login/Register to our forum to be able to post here.
