[FFmpeg-user] Concat MTS problems

Anatoly anatoly at kazanfieldhockey.ru
Sun Feb 12 00:42:07 EET 2023


On Sat, 11 Feb 2023 20:56:44 +0300
Alexander Gribanov <sunrisecoder at gmail.com> wrote:

> Hello!
> 
> I have a camera which splits long recordings into files 2 Gb size...
> 
> How to concat them properly via ffmpeg?
> 
> I make text file files.txt like this:
> file '2022-12-30_00002.MTS'
> file '2022-12-30_00003.MTS'
> file '2022-12-30_00004.MTS'
> file '2022-12-30_00005.MTS'
> 
> And then use the following command:
> ffmpeg -f concat -safe 0 -i files.txt -c copy output.mts
> 
> The problem is that it doesn't stitch them seamlessly, but instead I
> feel like 1-2 seconds audio and video gap or so by playing
> concatenated video in MPC-HC...
> 
> Is there any way to check, is it a concatenation problem or the files
> from the camera are broken?
> 
> Thank You very much in advance :)
I think that in case of MTS format this may be not 100% correct,
but may work for some uses:
 cat 2022-12-30_* > output.mts (on *nix)
But because you obviously on Windows, then probably:
 type 2022-12-30_* > output.mts ('type' is a windows command)
(not sure 'type' is bug free reading large files, note 'cat for
windows' exist too somewhere):
Also may try 'avidemux' http://www.avidemux.org
(File->open, File->Append)
Also, surfing the net, one day I came across this:
https://www.avdshare.com/join-mts-files
But I just bookmarked it and never downloaded/tested, so be aware of
possible malware-like features e.t.c.


More information about the ffmpeg-user mailing list