3

I have a need to join .ts video files. I know of http://www.ffprojects.net/tssplitter/ which works very well, but as far as I can tell it is GUI only.

I need to be able to do this from the command line in Windows. Are there any solutions out there that can handle this?

bradvido
  • 165

3 Answers3

8

I would simply use the command line. Navigate to the folder with all *.ts-files to be concatenated and then run the...

copy /b *.ts output-file.ts

...command, which takes all *.ts-files in the current directory and concatenates them to a resulting file called output-file.ts. The command might run for several minutes, so don't worry, you can grab a cup of coffee now ;)

(as the *.ts-format - "Transport Stream" - is a streaming format, it is possible to easily just "add one file after another" without damaging the data inside)


source: http://tomyeah.com/howto-join-multiple-ts-files/

mozzbozz
  • 183
4

ffmpeg for windows

ffmpeg.exe -i concat:file1.ts^|file2.ts^|file3.ts -vcodec copy -acodec copy -f vob combined.mpg
h0tw1r3
  • 1,914
1

You can merge the files with copy /b *.ts output-file.ts as mozzbozz suggest.

However, keep in mind if the filenames are not using leading zeros (1.ts, 2.ts ... 9.ts, 10.ts ... 99.ts, 100.ts ...), the copy command will use alphabetic lexical order to concatenate the files resulting in wrong order and output-file.ts will be glitching back and forth (1.ts, 10.ts, 100.ts, 2.ts, 20.ts, ... 9.ts ... 99.ts, 999.ts).

Filename alphabetical lexical order must match the natural order of video clips. This is fixed by using leading zeros:

for %i in (?.ts) do ren %i 000%i
for %i in (??.ts) do ren %i 00%i
for %i in (???.ts) do ren %i 0%i
copy /b ????.ts output-file.ts