Merging files doesn't work - apparently

0

I have 2 .AVI files - one 625 MB (duration 1:02:45) and the other 925 MB (duration 1:32:12). I wish to combine the files into one .AVI file. In a command window I issue the command:

copy /b *.avi combined.avi

combined.avi results with a size of 1.51 GB (which is correct) but the duration is shown as 1:02:45 and, of course, when I try to play the combined.avi, it finishes at 1:02:45.

Can anyone explain why I am not receiving a correctly merged file?

Paul Richards

Posted 2015-04-08T00:20:08.303

Reputation: 3

2This is probably due to the metadata in the first .avi file. It tells the player what codec etc to use and how long the video is I think. – Devan – 2015-04-08T00:30:08.797

I would try to run copy /b second.avi + first.avi combined.avi see if this gets the opposite effect. (shows 1:32:12 duration) btw which version of windows are you using? – Devan – 2015-04-08T00:36:26.917

Devan:Thanks. WIndows 7. Re running second + first gives 1:32:12. Are you saying that I can't successfully merge the files? – Paul Richards – 2015-04-08T00:59:55.860

No but I'm saying that you may need to strip out the metadata before the copy so it will create it while doing the copy Refer to this post for removing metadata

– Devan – 2015-04-08T01:04:43.337

I stripped out the metadata but the combined file is only 1:02:45 (using 1 + 2) – Paul Richards – 2015-04-08T01:17:36.500

Sorry about that. So looking at this it looks as though part of the avi standard includes a RIFF header section on the file that specifies the length of the video much like i was suggesting before. But this will not be able to be stripped out with the instructions I provided. I think you are going to be stuck with using a video converter simliar to FFmpeg.

– Devan – 2015-04-08T01:44:30.240

Devan: thanks for you help. I found Karan's solution (below) provided the answer. – Paul Richards – 2015-04-08T02:17:34.703

Answers

1

Devan mentioned in the comments above why you can't simply merge two AVIs using the copy command. However re-encoding shouldn't be required if both files match in terms of audio and video codecs used, resolution and so on.

Use AviDemux or VirtualDub to open the first AVI and then use File > Append for the second.

Ensure you have Copy selected for both Audio and Video in AviDemux's main window (along with AVI as the Format):

enter image description here

Similarly if you're using VirtualDub ensure you have Direct Stream Copy selected under both the Audio and Video menus.

Karan

Posted 2015-04-08T00:20:08.303

Reputation: 51 857

Karan: many thanks. AviDemux has provided the solution that I wanted. – Paul Richards – 2015-04-08T02:16:42.057

@PaulRichards: You're welcome! – Karan – 2015-04-08T02:43:30.083