Forum Archive Home -> Video Conversion -> Simple way to join mts files with stream copy (no recoding)?
Simple way to join mts files with stream copy (no recoding)? | ||||
| MJ Peg posted 2009 Sep 25 04:38 | ||||
| (a follow-on from http://forum.videohelp.com/topic373493.html )
I'd like to join a load of mts files easily, so that I can load a long sequence into VirtualDub and apply deshake in one easy (long!) hit without having to process each clip individually. I'll split back into clips in the editor later. Is there a way to do this IN FILE NAME ORDER? :D TsRemux only works on one file at a time as far as I can see, so I don't know why it was suggested in another thread. TsMuxeR works with multiple files but only takes one file at a time for selection, either by drag-n-drop or its own File Open dialog. If it allowed multiple selection I'd be all set, but alas, no. TSSplitter did join to a huge file of joined clips (and can be sorted into name order!) but it isn't 100% successful. MPC player only plays the first clip. VLC can access the whole thing but glitches. VideoPad loads the whole thing, but VirtualDub only loads the first clip's worth. Is there a joining utility that will do what I need? And incidentally (if there's a way that works but not in the right order) is there a Windows way to drag and drop a number of files in sorted order or are we stuck with the off-the-disk order that Windows uses? Thanks 8) | ||||
| MJ Peg posted 2009 Sep 25 05:06 | ||||
| And MTSFileJoiner ( sites.google.com/site/mtsfilejoiner/Home ) almost worked... it's in order and VirtualDub plays the whole file... but it gets upset at the joins and freezes playback, then catches up - losing footage in the meantime while it was out of synch. | ||||
| creamyhorror posted 2009 Sep 25 07:10 | ||||
| Since you're processing it in VirtualDub, you can just write an AVS script that joins all the sources, then load that in Vdub.
If it's not too many files, you can do something like
An alternative is the SegmentedDirectShowSource function, which auto-reads filenames in the form filename.xx.ext. | ||||
| MJ Peg posted 2009 Sep 25 08:29 | ||||
| Thanks, but I really don't want to fadge about with scripts - if it's not point-n-click simple then the current state of video software is a sorely lamentable mess! :)
Having said that, if I really don't get a solution soon then I might just have to look into this script malarkey ... *sigh* | ||||
| MJ Peg posted 2009 Sep 25 11:17 | ||||
| OK OK I have warmed to the idea of using scripting...
.. is there a utility anywhere I could use that would generate the right script (in filename order) if I drag-n-dropped a bunch of files onto it? Is http://software.itstime.nl/freeware/avisynthbatchscripter/ the way to go? Thanks | ||||
| creamyhorror posted 2009 Sep 25 13:48 | ||||
| It's just exactly those lines I quoted for you. Install Avisynth, copy-paste that into a text file, replace the filenames with the correct ones, save as .AVS and you're set to load that into VirtualDub. Give that a try before you fadge around with a batch scripting program (which may be a good idea, but this particular script is so simple anyway.) | ||||
| poisondeathray posted 2009 Sep 25 14:37 | ||||
| Another option is to use multiavchd.
Just pretend you are authoring a disk and take the joined .mts file in the streams folder as your import into vdub or whatever application It works for proper AVCHD camcorder clips, but IIRC, you are using AVCHD lite with the frame dupes, so I don't know if it will work for you | ||||
| creamyhorror posted 2009 Sep 26 01:10 | ||||
| MTS Joiner, a frontend for tsmuxer. | ||||
| MJ Peg posted 2009 Sep 26 06:31 | ||||
| c.h. thanks, but I go out and shoot a ton of clips (often 60+) and then make a video slideshow sort of thing from it all... messing about with 100s of filenames in a script would be more than I could bear, so some sort of drag-n-drop widget is required :)
MTS Joiner -> tsmuxer looks good, presuming the tsmuxer output would be more successful than tssplitter's attempt - is that only as part of vob2mpg or is there a standalone version? Alternatively, I shall look into scripts, as they're not quite as scary as I thought, having had a quick look at the wiki. I would need either : 1) a script to use something to join mts files together for a single deshake session in VirtualDub 2) or a script to make VirtualDub deshake a batch of files in one go on its own, creating multiple deshaken AVI files, one per MTS No idea if 2) is possible, but that would be ideal to save me splitting up one large file again in the editor. Cheers | ||||
| MJ Peg posted 2009 Sep 28 09:12 | ||||
| While waiting to see if Vob2mpg Pro will be great, I'm still keen to have a totally free scripted solution that I can recommend to people on the AVCHD Lite group.
I've googled and surfed and read wikis and FAQ-ed myself until my eyes bled but I'm still none the wiser! Is there a forum anywhere likely to be able to help with 1) or 2) on the previous comment? It could take an age to become self-sufficient on scripting and I just want the one simple task... please don't make me learn tons of stuff I don't want to know just to hammer home one pesky nail... ! thanks | ||||
| MJ Peg posted 2009 Sep 28 09:38 | ||||
OK I've installed the prog and written an AVS script file with 3 clips, and it loads OK (slowly!) but I get 6 icons appearing in the sys tray : an FFDSHOW icon and 2 HAALI icons for EACH clip, so I'm worried that 100 clips might blow a fuse :wink: And it's still not exactly drag-n-drop :( | ||||
| MJ Peg posted 2009 Sep 28 10:15 | ||||
| Just tried a scipt with 4 files... it seems to all work, but the final deshaked result plays back at 2x speed despite me treating it the same as I do for individual MTS files, and it glitches, freezes, and repeats bits around the clip joins!
I'd rather use approach 2) if possible - automate VirtualDub in a hands-off way so that I can drag-n-drop a bunch of files onto something and let it do its thing... and come back some time later to find a bunch of deshaked AVIs waiting for me. Can such a thing (with a 2 pass filter) be done....? | ||||
| poisondeathray posted 2009 Sep 28 10:20 | ||||
| Did you try multiavchd? Even if it doesn't work for avchd lite properly, the author is very dilligent and will probably fix/update it if feedback is given.
I wrote about avchd lite in another thread. Directshowsource will not work properly show the frame repeats, only ffmpegsource2 works properly http://forum.videohelp.com/topic372515.html#2001159 If it joins properly, with multiavchd, you can use ffmpegsource2 to index the 1 big clip without dupes. Otherwise you will have to specify the joining in the script. Even if it joins properly, you will still get the frame repeats, unless you use ffmpegsource2 (or until decoders & splitters have been updated) | ||||
| MJ Peg posted 2009 Sep 28 10:56 | ||||
| Thanks... How would multiavchd help, if it is all about producing discs with "simple menu structure" etc...?
ffmpegsource2 looks promising, I've downloaded from http://code.google.com/p/ffmpegsource/ and put it into the plugins folder, and this script has loaded, with proper 25 fps frame rate too :) FFMpegSource2("00634.MTS")++\ FFMpegSource2("00635.MTS")++\ FFMpegSource2("00636.MTS")++\ FFMpegSource2("00637.MTS") It's deshaking right now, without tons of icons in the sys tray, so it's looking hopeful - I'll comment shortly whether it's turned out well! Cheers | ||||
| MJ Peg posted 2009 Sep 28 11:01 | ||||
| Correct speed, perfect joins... 100% brilliant....
... but no sound! :) | ||||
| poisondeathray posted 2009 Sep 28 11:03 | ||||
I answered that in an earlier post above, you probably missed it. You take the joined transport stream from the folder as input. It will make 1 big .mts or .mt2s for you, upto ~4GB then split them (depending on the settings used). But this is easier than specifying ffmpegsource2()++ffmpegsource2() a few times... because you would only have to use ffmpegsource2() once Also if you wanted audio joined and passed thru in the script, you have to use atrack=-1 ffmpegsource2("0001.mts",atrack=-1) ++ ffmpegsource2("0002.mts",atrack=-1) ++ etc... | ||||
| MJ Peg posted 2009 Sep 28 11:38 | ||||
| I see, yes.. thanks - but I think I've got something usable now, with the atrack=-1 bit, cheers
I've made a batch file I can use : deshake.bat
Luckily the FOR command automatically sorts into filename order, so all I'll have to do is create a sub directory for the clips I want, copy/move in them in, and run the batch file... then drag-n-drop the avs file onto VirtualDub and set the deshake running. It will need a nudge to set pass 2 going, and another to save, but that's fair enough for now. So that's the One Big File approach sorted - I'd still love to know if the Many Deshaken Files Set Running Come Back Later approach can be done :) Very many thanks :jump: | ||||
| MJ Peg posted 2009 Sep 28 11:40 | ||||
| ah.. spoke too soon... the audio is out of sync after deshaking!!
Is there an easy way to delay the audio by 1200ms? :) | ||||
| poisondeathray posted 2009 Sep 28 11:43 | ||||
| In avisynth,
FFMpegSource2()++FFMpegSource2()++.... DelayAudio(1.2) I would always preview your script e.g. in a mediaplayer first, before wasting time deshaking or encoding etc... or are you saying the script was fine, and only desync after deshaking? | ||||
| poisondeathray posted 2009 Sep 28 11:47 | ||||
| Some camcorders don't have "flush ends". What I mean is the audio starts a bit later than the video
vvvv _aaaa And some programs will join it like that instead of padding the video, or removing the audio silence, so you get an accumulated desync. If your video is like this, you can use "joints" (great name by donald graft btw...I wonder what he does in his free time :) ) http://forum.doom9.org/showthread.php?t=149441 or process joining through eac3to to get rid of the audio gaps If it were up to me, I would try multiavchd first, then use ffmpegsource2() on the joined .mts file | ||||
| MJ Peg posted 2009 Sep 28 11:53 | ||||
| No, it's not happy with 49 MTS files! It falls over with an error ...
Avisynth Open Failure: FFAudioSource: Audio track contains no audio frames (FFMS2.avsi, line 38 ) and my avs file/path and last line number, no matter whether I delete a few from the end or middle, or near the start because there are only 3 of the .ffindex files created, for the first 3 clips. Dang. It's too much for it :( | ||||
| MJ Peg posted 2009 Sep 28 11:55 | ||||
Excellent, thanks... yes it played fine in VirtualDub at first, it's only the deshake that un-syncs the audio - hence the need to delay first to compensate :) I'll add an echo DelayAudio(1.2) >> test.avs to my batch, for small runs! | ||||
| poisondeathray posted 2009 Sep 28 12:02 | ||||
| That is weird. Deshaker shouldn't affect the AV sync
Can you add info() to the script and just open it to see what the fps line says? Sometimes ffmpegsource2() will get the fps incorrect and you just have to add a line to correct it. This was the case in the other thread I mentioned above for AVCHD lite AssumeFPS(30000,1001) | ||||
| MJ Peg posted 2009 Sep 28 12:32 | ||||
| Deshaker adds a notice at the start of the deshaken clip explaining the 30 frames audio delay, and that all seems to work, thanks.
It is 25fps from 25-in-50 AVCHD Lite from an FZ38 camera... Info() says 25.000 (1000000/40000) Well, it doesn't take much to break it... 7 clips is the most I've managed so far! From 629 to 635 works, but if I add 636 it breaks. Yet there's nothing wrong with clip 636, because a 3 liner version with just 629,636 & 635 does work. Cheers | ||||
| poisondeathray posted 2009 Sep 28 12:38 | ||||
| ok right, you are using that mode for deshaker, that explains the delay
Ooops, I neglected to see you are in the UK, so 25 fps is correct, so no need to do anything Not sure why some work and some don't. It could be overhang / flush end theory I mentioned above. What is wrong with the 629->636 join exactly? i.e. where does it "break"? | ||||
| MJ Peg posted 2009 Sep 28 12:42 | ||||
It fails to load at all in VirtualDub - with the error message I wrote in my comment of 17:53
Something blows its brains out... Heaven knows what! :( | ||||
| MJ Peg posted 2009 Sep 29 10:19 | ||||
| I had a look at multiAVCHD and I'm a bit wary. 20MB for a convertor prog?! And the site says :
:shock: all builds expire few weeks after being issued and can be used after you execute multiUPDATE :shock: may cease to operate at any time without warning :shock: if multiAVCHD employs donateware program or becomes payware ... I don't like the sound of that. If people want to share their programming efforts with the world (I would if I could) that's fine and I'm grateful, but not if they &*$% about like that. I don't have any faith in progs that where they could pull the plug at any moment. Why should I waste my time and diskspace on something I can't have reasonable faith in? :-x | ||||
| MJ Peg posted 2009 Sep 30 11:26 | ||||
| FWIW I've been trying to script individual deshaking, with help here http://forums.virtualdub.org/index.php?act=ST&f=5&t=17772 but it's getting silly now! :) | ||||
| johns0 posted 2009 Sep 30 13:02 | ||||
| I've been using multiavchd for the last year and even donated to the author and would buy it if it became payware,any programmer has the rightful option to quit supporting any software or start charging for it and since its beta its being updated all the time and the author just want to support the newest version out instead of people wanting fixes for editions that are 6 months old so its easier to expire them. | ||||
| multiAVCHD posted 2009 Oct 01 03:39 | ||||
| Thanks for the explanation and the support, johns0!
Plus... I know that it will never become payware :) @MJ Peg: multiAVCHD is not a convertor program. | ||||
| MJ Peg posted 2009 Oct 01 04:50 | ||||
| Hi multiAVCHD, thanks for replying to my concerns.
With all due respect, if I give something away I don't usually say "Enjoy it but I might want it back or reserve the right to break it!" Is it really a problem to let people have full unrestricted use of something you're giving them? Genuinely curious about your policy.. no offence intended... best wishes etc :) | ||||
| multiAVCHD posted 2009 Oct 01 06:33 | ||||
| All builds are fully working and not restricted in any way... They expire to help me with all bugfixes and to move forward. Even if a build 'expires' user can always change the clock of his PC and use the tool for years if he wants. There are users which use builds which should've expired in april/may 2009 (although I never encourage anyone to do so).
That's about it... multiAVCHD will never turn into payware... and I doubt it will ever become donateware... I just have no time to deal with such things. No offence taken :) so if you find it useful - use it. | ||||
| MJ Peg posted 2009 Oct 01 07:29 | ||||
| Thanks
I have found a way to batch convert AVCHD Lite files into deshaken AVIs, using two batch files, one of which generates another scheduler batch file, and a VB script file to coordinate new command windows :) Even then it sometime fails to load an AVS script containing "FFMpegSource2(", so the deshake batch looks for the log file after pass 1 and arranges a whole new attempt if it's not there. Very annoyingly complex, but worth it... I won't have to split up one long file now in the editor. Cheers |
Login/Register to our forum to be able to post here.
