Sunday, February 12, 2017

Join AVCHD.mts files without re-encoding into one m2ts-file

Camera

Canon LEGRIA HFR16


Goal

Join all the separate recordings from your memory card ("00001.MTS, 00002.MTS....") into one result file without re-encoding into another format so there won't be any deterioration of quality. 


I have been using all kinds of software to do this, but there is always something I didn't like. Mostly the time it would consume. 



The following 6 steps do the trick for me: 


  1. Copy all the *.MTS files you want to combine into a folder. 
  2. Open terminal screen (CTRL + T)
  3. Execute at the prompt:

    cd /path 2 the folder with all the mts files/  (enter)

    ls >> combine.txt
  4. Open an editor (I use Gedit) and replace all the newline characters (\n) with |
    (turn off wrap around too)
  5. now insert the following at the beginning of the text:

    ffmpeg -i "

    and add the next line at the end of the text:

    " -c copy filename.m2ts

    save the file if you want to keep it for later use.
  6. copy the whole text and paste it in the terminal screen, and execute.
    (sample with 10 mts files, but I've done it with 100+ files too without a problem)
    It should look like this:

    ffmpeg -i "concat:00000.MTS|00001.MTS|00002.MTS|00003.MTS|00004.MTS|00005.MTS|00006.MTS|00007.MTS|00008.MTS|00009.MTS|00010.MTS" -c copy filename.m2ts


Hope this helps.

1 comment:

  1. Hi Mario, thanks for you method. Did you try this one? http://avchdvideos.blogspot.com/p/creating-batch-file.html

    Best regards, Eduardo Diaz

    ReplyDelete

Please be courteous, even if you do not share the same view.