I was looking for some freeware to join two .mp4 files together (because VirtualDub would not do it) and I stumbled across a handy command line option.
Open a command prompt and type something similar to this:
copy /b "C:\File.mp4" + "C:\File1.mp4" CombinedFile.mp4
This is great and simple option – and no installation required!
Didn’t work but thanks for the effort
WORKS LIKE A CHARM………!!!!!!!!!
All we need to do is :
Open the command as an administrator.
Then open the folder via command where the files (you want to join) are present.
After which, run the command :
copy /b “filename.mp4” + “filename.mp4” + “filename.mp4” Result.mp4
Thanks a lot …. it really works… and it did a magic…..stay blessed….. Saeed
I guess that proves Charms don’t work since the files are appended into one larger file BUT when playing the larger .mp4 file with both VLC and Windows Media Player the video stops playing at the end of the FIRST file to be concatenated. What good is that? I want it to continue playing to the end of the last file concatenated. That was the whole purpose of this excersize.
Is there any way to automate this process? I have nineteen folders each with 110 mp4 files to concatenate. The folders contain names like 20100420_1.mp4, 20100420_2.mp4, 20100420_3.mp4….etc
You can imagine how long and tiring it could take to type all 2090 files!
Hi Sean, this should work for you:
copy /b *.mp4 CombinedFile.mp4
This didn’t work for me. It only copied the first into the result. (The combined file still has the filesize of both combined though for some reason. It just only plays up to the end of the first one.)
I’m assuming that both files are the same resolution? I haven’t used this technique a whole lot – but I have not had any issues with it.
Just tested myself. This trick only works on transport stream files, like MTS, that have been cut by a camera for file size purposes. MP4 files include a header that has index information, which includes the total runtime of the video. When you use the “copy xxx.xxx /b” command, the OS will blindly stitch the first bits of the 2nd video to the last bits of the first, without changing any data (just running the 1111s and 0000s together). What that means is when you play your new “combined” video, the player/editor first reads the header and gets the index information for only the first file in the series, since it was the first data added. The indexes for the 2nd, 3rd, and so on videos are buried improperly in the binary data in the middle of the new file, and useless.
Interesting to know – thanks very much! š
That command only works for .mpg files that have audio built into the video stream.
For containers such as .avi & .mp4 you have to use a video editing tool in Windows or in Linux you can use Mencoder “mencoder file1.avi file2.avi -ovc copy -oac copy -o newfile.avi”.
Not sure if that works for mp4.
Oh yeah – the copy command for mpg must be same resolution, size and frames per second.
Didn’t work with me, just the result file have total size of separated files but when play it, it is only the first file š¦
Thanks for the effort
Looks like the files you joined were not compatible Mohamed …
I too tried this with several mp4 files all identical spec and and origin etc. I ended up with a file the size of all the sum parts but as with others only plays the first added file. Any ideas?
Fastest way to do this is to convert them to MPG using HandBrake then concatenate, then reconvert them to MP4 using Handbrake if you need MP4. So hence, I left them all separate š
Best Solution Ever š Is there a command to convert mp4 to mpg and back also using cmd?
Hi Guys,
I tried to do this, but it keeps telling me “access denied” whenever I try and enter the file path.
What’s the exact command I should enter? If you don’t mind please just copy/paste exactly what command you used.
Thanks
Hi Solomon, the command is just what was posted – only the file names need to be changes. I have found that it doesn’t work for all files that I try to join however.
Thanks alot for letting us know the simple command for video file merger
Excellent!, that’s how things should work! (wishful thinking š )
Thanks
it says it worked except it’s kind of useless when you can’t find any evidence of the combined file anywhere on your machine.
If both files were in C:\ then the output file should be there too …
I used .mpg video files with same resolution and it worked perfectly.
Kudos to everyone for sharing.
I tried to connect two files but only managed to copy one file. What did I do wrong?
Are both files the same resolution?
Guys.. I guess most of you are looking for this!
https://www.techwalla.com/articles/how-to-use-vlc-to-combine-two-clips
Actually none of the methods here work. The windows command line for combining the files combines them but the index only plays the first file when you replay the video. The VLC method referenced here worked but the audio and video were out of sync and only got worse as the video length increases. After about 2 minutes it is unusable and looks like an old Japanese Godzilla movie. I am ashamed and dismayed that using a windows machine it could possibly be so difficult to do the simple task of combining video clips. I also tried Handbrake. It combined them but the video was just a black screen.
For the love of God does anyone know how to combine multiple .mp4 files on a Windows machine?
This method does not work for mp4 files, since they possess header/footer data about the clip, you’ll end up with a concatenated file the size of the combined files, but most video players will only play the first clip.
One scriptable, lightweight solution without re-encoding the files is using FFMPEG (https://www.ffmpeg.org). The batch script below parses the folder of the batch script and concatenates them appropriately:
(for %%i in (*.mp4) do @echo file ‘%%i’) > mylist.txt
“C:\ffmpeg\bin\ffmpeg.exe” -f concat -safe 0 -i mylist.txt -c copy “Output.mp4”
For the script, you’ll probably have to adjust the smart quotes to their “dumb” quote counterparts.
Really works like a charm. Thanks
Try Joyoshare Video Joiner. It is easier to use than the Windows command line. And also, it can help to join multiple MP4 files together without quality loss.