Joining videos using the command line

command linevideovlc-media-player

I've had a little mishap with the external harddisk and I've had to restore some files.
Now I have a bunch of video fragments that I'd like to join up again.

I can play the fragments using VLC just fine.
So I went here: https://wiki.videolan.org/How_to_Merge_and_Transcode_Multiple_Videos/
and followed the instructions.

The commandline for joining 2 files with the same encoding is:

vlc c:\file1.avi file2.avi 
  --sout "#gather:std{access=file,mux=ts,dst=all.ts}" 
  --sout-keep

However nothing happens; an empty all.ts file gets created.

 Directory of C:\PROGRA~1\VideoLAN\VLC

all.ts
               1 File(s)              0 bytes
               0 Dir(s)  108,900,364,288 bytes free

How do I get vlc to actually create a file with data in it?

If I use the transcoding option:

vlc -vvv c:\dir24.avi\fil57.avi c:\dir24.avi\fil58.avi
  --sout-keep 
  --sout=#gather:transcode{vcodec=h264,vb=1024,scale=1,acodec=mp4a,ab=
192,channels=6}:standard{access=file,mux=ts,dst=out.mpg} 
  --sout-all

I get the following error:
enter image description here

How do I get vlc to join the two files?
Note that I do not know the actual encoding of the files.

Best Answer

I just needed to do this myself. Your unanswered question helped. Here's what I did:

vlc c:\file1.avi file2.avi 
  --sout "#gather:std{access=file,dst=newFile.avi}" 
  --sout-keep

The example on the VLC wiki page you linked is mux-ing .ps into .ts. I dropped the mux altogether as it wasn't needed in my case. Then pointed it to a destination (dst=) having proper file extension.

Related Question