Combine MP4 files using FFMPEG on Windows (without re-encoding)

Combine MP4 files using FFMPEG on Windows (without re-encoding)


Hi In this video, I will show how to combine MP4 files to a single file without re-encoding using FFMPEG on Windows 10. In this example, I have MP4 files from a digital camera and I want to combine these MP4 to a file. Let’s start download FFMPEG by open web browser to this URL. Select ‘Builds’ tab. Scroll down and click ‘Download’ on static type. Then, open the downloaded folder. You see the file is in 7zip format so you have to extract it with a program, like 7zip, or WinRAR. After that, open the extracted folder and open ‘bin’ folder. You will see FFMPEG.exe which is a program that I will use to combine MP4 files. In this example, I will copy the file to MP4 folder. Next, right-click Window icon at bottom left and select ‘Command Prompt’. On Command Prompt window, change path to the folder where you keep MP4 files. Then, you have to create a text file which has a list of files that you want to combine by type this command and press ‘Enter’. You will get the file – mylist.txt in the folder. This file has a list of all MP4 files on this folder. After that, type this command to begin combine the files using FFMPEG and press ‘Enter’. The process should be fast because it’s just concatenate the files, not re-encoding. If there is no error message, you will get the file – output.mp4 as a result in the folder. So that’s it for this video. If you have any question or suggestion, please post below. If you like, please subscribe. Thank you for watching. Goodbye.

87 thoughts on “Combine MP4 files using FFMPEG on Windows (without re-encoding)

  • one small bug in the text file, or at least there was for me, I'm using the most recent windows build from ffmpeg directly, the filename should be output surrounded by ' not " otherwise you will always get an error that the file is either unsafe or unsuable

  • dear youtuber ,i reaaly liked your video and i request you to make one on dividing file in chunks on ffmpeg ,

    my aim :
    1000mb file ,= 200 x 5 files
    process each file on distributed servers and recombine them …

    please make video on that plzz

  • ทำไม่ได้ครับ มันบอกว่า Unsafe file name จะแก้ยังไงครับ

  • help i did everything and it says [concat @ 0000000000472400] Unsafe file name 'movie Prt 1.mp4'
    mylist.txt: Operation not permitted NVM IF YOUR FILE HAS SPACES IN THE NAME IT WOULD NOT WORK DELETE THE SPACES!!

  • It worked, thanks man I didn't want to expend hours rendering my videos and this has been tremendously helpful for me, I wish you good luck.

  • I have watched severals videos, but all they do is, put some ffmpeg commands, the file name. But they didn't mention about file stored in another location, I have to go to that location first, like cd to that location for windows. thanks. Now I know how to start.

  • Amazing video and instructions. Thank you! Be sure to keep your file names short and simple for best results. Also run command as admin. Cheers!

  • Thank you very much for this video. This tip is [email protected]$#ing awesome. Do you know is it possible to merge a list of video files as you did in this video but also add the music to the output in one command. Thanks again!!

  • Awesome! It works well. I checked file details and it changed my video from 24 frames per second to 23. And the bitrate from 190kbps to 189. But still is awesome. Thanks Bro 😀

  • I've been struggling to figure out how to use ffmpeg, since typical file-joining software doesn't always work well. I've read other instructions but this was the clearest step-by-step guide to what to type in the command line and it worked perfectly. Thanks!

  • Can anyone help me how to get the command prompt address to the folder containing the videos???? In Windows 10 it shows the address in words…..

  • CAN ANYONE HELP PLEASE???
    I am trying to combine 90 small mp4 files.
    I got all the steps right and obtained the text file in the folder.
    However,when I run the command " ffmpeg -f concat -i mylist.txt -c copy output.mp4 " to combine the files, I get the below error message (note :1Border crossing into Israel – Allenby bridge.mp4 is the name of my first file)

    [concat @ 0000021481a7a280] Unsafe file name '1Border crossing into Israel – Allenby bridge.mp4'
    mylist.txt: Operation not permitted

    Please I am not at all a tech savvy guy and for me to get here itself was a big achievement but I just want to accomplish this task.
    Any help is much appreaciated

  • Success!!!!! I did it!!!
    I guessed to remove the spaces in the file names.
    However, one last question….some mp4 vids have been shot in Portrait mode while others in Landscape mode. When I stitched the files together,the output file retains the entire movie in the mode of the first clip, so some videos play inverted.
    Is there anyway to retain the orientation of the screen during the combine????

  • This is brilliant – thank you! This is essential for the quick stitching of long GoPro videos where they get split into 4gb chunks.

  • This is a life saver!! Huge time savings compared to other methods when the file types are the same and all you want to do is stitch multiple clips together.

  • Maybe easier to use MPEG Streamclip by squared5? It's an old program (2008), but free and still works – no command lines, just open your mp4s together and export as MPEG.

  • Thank you! Works like a charm. This is the fastest solution I know to stitch a few mp4 recordings done by camera or smartphone. All pieces are the same size and encoding, so no conversion needed. No installation of any program – just run in the DOS windows and done!

  • My man, thank you so much. This is by far the easiest and most convenient method to join mp4 files that use the same codec. Great job sharing this with us!

  • wow, thank you. I was about to try to make a batch file manually, I didn't even know you could do a command line loop. 😉 ❤

  • can anyone help me with writing a batch file of this code. I did :
    for %%a in (*.mp4) do (

    ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4

    )

    but it didn't work. The error show :
    [concat @ 000000eb7710b180] Line 1: unknown keyword '24/7_Surveillance..mp4'

    FilesDirectoryList.txt: Invalid data found when processing input

  • Thank you! Thank you! Thank you! Thank you! I knew this could be done in Linux, but I am at work and recorded a Skype meeting to MP4 and working on a Windows laptop, so I did not have a Linux machine available. I was going to spin up a Linux VM to do this, but thanks to your video I just needed to follow your instructions and EASILY concatenated the video files! Saved me hours of time!

  • Any idea how to get rid of "Could not find tag for codec pcm_alaw in stream #1, codec not currently supported in container"?

  • I had my files as .mkv, so I changed things as follows:
    (for %i in (*.mkv) do @echo file '%i') > mylist.txt
    ffmpeg -f concat -safe 0 -i mylist.txt -map 0 -c copy output.mkv
    You use map 0 to carry over all the existing streams of the video files, otherwise only the highest quality audio/video/(and maybe sub) will be carried. But that first command was rly handy, goood to know.

  • Windows 10 Batch File/s:

    Put all of your video files of the same type in same folder along with ffmpeg, and two separate batch files with the following commands:

    1) Create File List:

    —————–

    (for %%i in (*.mp4) do @echo file '%%i') > mylist.txt

    pause

    2) Combine Video Clips:

    ——————–

    ffmpeg -f concat -i mylist.txt -c copy output.mp4

    pause

  • Great video man. Should've mentioned the note in your video by actually saying it too about different codecs though. And you don't need to copy over the ffmpeg.exe file, just use the full path to it like the following example.
    C:UsersYOURUSERNAMEDownloadsOROTHERFOLDERNAMEffmpeg-20190107-038d291-win64-staticbinffmpeg -f concat -i mylist.txt -c copy output.mp4

  • It worked! Thanks
    So the next person doenst have to type it in:
    (for %i in (*mp4) do @echo file '%i') > mylist.txt

    ffmpeg -f concat 0 -i mylist.txt -c copy output.mp4

    When I first tried "ffmpeg -f concat 0 -i mylist.txt -c copy output.mp4
    " it didnt work said "Requested output format 'concat' is not a suitable output format
    0: Invalid argument" so I changed it to
    "ffmpeg -f concat -safe 0 -i mylist.txt -map 0 -c copy output.mp4"
    based on https://www.youtube.com/user/Cerbyo comment

  • made a couple tweeks. 1 – created a batch file called "concat" and placed it in the bin directory. 2 – added the bin directory to the system paths. This way you dont need to copy the ffmpeg file into a directory. you just cd to the directory with the mp4 files, and type "concat" (batchfile name) and it will produce the output mp4. The batch file is below:

    (for %%i in (*.mp4) do @echo file '%%i') > ./mylist.txt
    ffmpeg -f concat -i ./mylist.txt -c copy ./output.mp4

    yes, I know the %'s are doubled – you need to do this to tell the batch file it's supposed to be a %. Call this file concat.bat and place it in the bin file of the ffmpeg.

    adding a path to the system path is fairly straightforward – and a simple google search will turn up directions

  • I have taken a videoa. I created a second video1 by replacing the audio in videoa with new audio. Now when i try to combaine this video1 with another video2, when video1 is playing every thing is fine. but when the video2 is playing, the audio in it is lost and the duration of the video portion in video 2 is doubled.
    My original video1 is of duration 55 seconds the second video is of duration 2:33 seconds when i concatenated the resultant video is 6,58 minutes
    I am using the command
    ffmpeg -f concat -i inputs.txt -c copy output.mp4
    in inputs.txt i have give
    file 'file1.mp4'
    file 'file2.mp4'
    But the concatenated file size remained the sum of the original file sizes in MB.

  • how do i replace the left audio channel of an video file with a custom audio file into the left channel of that video?

  • note if you're having issues try a different output format. I shot on an a7sii and had to use .mov rather than .mp4

  • Got error in FFMPEG: Cannot map stream #0:2 – Unsupported type. If you want unsupported types ignored instead of failing, please use the -ignore_unknown
    option. added -ignore_unknown to the second string of command and it worked. I have non-standard frame rate (60) and non standard frame size from gopro 7 filming in narrow.

  • I have a .ts video file and a .ts audio file. I want to merge them together, but I cannot rename them the same on the same folder. Can you help me?

  • Sadly this didn't work for me. Just for testing and to make sure my two files were the same I tried joining the exact same file with itself. Of course I gave the duplicate file a different name (GP1.mp4 and GP11.mp4). No dice. Still didn't work. I'll keep looking for a solution.

  • Good tutorial, one thing to note is to quickly open CMD to a folder you want.. you can type in the URL of windows explorer "cmd" when you are currently inside the folder you want to open it from.

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2019 Geted Tabs Online. All rights reserved.