Advertisement
  1. Photo & Video
  2. Video
Photography

3 Free Ways to Join Spanned AVCHD Video Files into Continuous Clips on Windows

by
Difficulty:BeginnerLength:MediumLanguages:

AVCHD cameras are a marvel: they compress video into a small package in such a way that it looks great and the files are not too large. The problem is that the FAT32 file system the cameras use doesn't allow for massive files from long takes to be written to the cards.

To get around the file-size limitation, your camera breaks up long recordings into segments. This is called "spanning" the files. If you are using an advanced non-linear editor like Adobe Premiere Pro or Final Cut Pro you can usually import the spanned files and it will know that they are all part of one take. But what if you use something like HitFilm, the new kid on the block? Or what if you just want to merge the clips back together and re-encode them down to a lower bit rate?

In this tutorial, you'll learn about three free ways to merge spanned clips using Windows. Each of these methods can concatenate and combine spanned ACVHD files into a single continuous video clip.

Merge spanned MTS files into a single continuous file

Method 1: Command Prompt

Step 1: Launch CMD and Change Directory

Press the Windows key on the keyboard or click the Start button, type "cmd" and press Enter. This will launch the command prompt.

Windows Command Prompt

Next you need to change the directory to where your videos are located. You should leave the videos in their original file structure that came from the card. In the future if you use a different editing app, like Premiere, you can import them as one clip and you don't have to worry about joining them.

In my case, to change directory I will type "cd /d K:\Video\PRIVATE\AVCHD\BDMV\STREAM". You will type the location of your files.

Where my videos are located

This folder structure can be tricky to type for those of us who are key mashers. To make it easier on yourself, navigate to the folder where the files you want to join in your file manager. 

Where the new video files are in the finder

Click in the address bar, select the address, and press Ctrl+C to copy. Go back to CMD, right-click and choose Paste (you can't use Ctrl+V in CMD). Much easier than typing.

Step 2: Copy The Files

In CMD type "copy /b 00001.mts+00002.mts K:\Merged.mts" replacing the 00000.mts and 00001.mts with the names of your actual files. You can keep adding files to the list for how every many you have in the recording. Just put a "+" in between each file. The "K:\" directory is where I want the files to be copied and Merged.mts is the new files name. This last bit is important. If you don't select a new location and name the first file will be overwritten. Sad day.

Copy the files

Step 3: Make It So

Press the Enter key to execute. 

Success

Success!

Check that your file looks and sounds correct. It should be merged properly. I can't say for sure that this works with 100% of AVCHD files, because there are a few variables in audio and video compression between cameras. One thing to watch out for is strange file and folder structure names. For some reason I can't get CMD to copy the files to a directory with spaces in the name. Instead, I just copy the files to root drive and it works. The names of the files may cause an error too. I use files copied over from the camera card, so there isn't an issue. Long files names may be an issue. If so, just rename them to 1.mts, 2.mts. etc. That should work. 

I have tested this with my C100. The files import into HitFilm and Premiere Pro and play in both apps fine. They can also be transcoded. This is something you must do in HitFilm because it chokes and grinds to a halt with AVCHD files. Transcoding the merged files with AVANTI worked fine, although AVANTI did show some error messages. The transcoded video looked and sounded perfect in HitFilm and Premiere.

Method 2: tsMuxeR and eac3to

If the above method doesn't work, there is another option. This requires a few files and a bit of script modifying. Don't worry, it's super easy!

1. Download  and Unzip The Files

Download tsMuxeR and eac3to. They download as .zip files and need to be unzipped. No extra tools needed. Right-click and choose Extract for each one. Now you will have two folders: tsMuxeR_2.6.12 and eac3to331.

2. Move and Rename Folders

Create a working folder somewhere on your computer. This will be a folder where you copy your AVCHD clips to and join them. I have over 2600 folders in my Downloads folder, so I will create a folder somewhere else and name it AVCHD_JOIN. Move the two extracted folders to your AVCHD_JOIN folder. 

Rename the tsMuxeR_2.6.12 folder to tsMuxeR. Rename the eac3to331 folder to eac3to.

3. Copy AVCHD Files to Be Merged

Next, copy the AVCHD files you would like to merge to your AVCHD_JOIN folder. For this example I am going to use 00001.mts and 00002.mts. Your folder should look like this.

Select the files
I prefer to copy the files I want to merge to the AVCHD_JOIN folder rather than move them. This way I have a back up copy that I can use in Premiere or some other application that can read them properly. When I am done merging, I delete the .mts files in the AVCHD_JOIN folder. I still have those original files on a folder somewhere else.

4. Create a Batch File

Open up Notepad or similar text editor.

Go to http://avchdvideos.blogspot.com/p/creating-batch-file.html. Follow the instructions on that page. Enter the name of your merged file, drag your files into the box, and hit the Generate Code button.

Highlight all the code in the box, right-click and select Copy. Paste into Notepad. Next save this file in your AVCHD_JOIN folder and name the file "AVCHD.bat". You will need to set the "Save as type" to "All files (*.*)". 

ACVHDbat file

5. Run the .bat file

Double click the AVCHD.bat file. The CMD window launches and you will see some action and it may take a while, depending on the number of files and your hardware. Be patient.

This method leaves the video untouched (not re-encoded) but it does re-encode the audio to ac3, which is AAC at 448Kb/s. Re-encoding the audio is not optimal, but if this is the only method that works for you, it may not be a deal breaker.

Credit for this method goes to YouTuber drkk2020

Lehman Video Tool logo

Method 3. Lehmann Video Tool

There is a tool called Lehmann Video Tool (LVT) that is purpose-built for merging these AVCHD files. I have tries using this with some success. On my system, the process looks like it works but the app hangs at 94%. If I close the app and check the video that it merged, the video looks fine. Your mileage may vary, but it's worth a try.

LVT is (as of now, February 2016), an in-development beta program. If you need to merge AVCHD files regularly keep an eye on LVT. If your really need to merge AVCHD files all the time, consider testing and contributing feedback in the project forum.

LVT is, essentially, a wrapper for the process above. It installs eac3to331 and other tools and provides a helpful interface to manage everything.

To use LVT, install the program and launch it. Browse the file system to select the files to merge, select an output location, give the output file a name, and click Merge. Voila, that's it!

Other Methods

I have also seen users who are able to use to use tsMuxeR by itself to merge the files. In the tsMuxeR folder you will find a GUI version of the program. You can add a file and then add additional files with the Join button. Set your save destination, name the joined file, select .m2ts Muxer, and start. This didn't work for me but again, your mileage may vary. 

There are probably ways to do this for Mac and Linux too. I only have Windows machines in my stable, so I can only speak to those. Out of all of these methods, the first works best for my cameras and files. No re-encoding and it is fairly fast. 

Segmented AVCHD files are no fun, but ultimately the format has advantages that make it the go-to choice for many cameras and situations. Even if you are using a non-linear editor that can handle spanned video files, converting to a continuous file is probably safest for archival storage. Hopefully these methods will join up all your clips and consolidate things for you!

Advertisement
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.