FFMPEG Command to Merge & Concatenate Multiple Videos into Single Video File in Terminal
225 views
Jun 3, 2025
Buy the full source code of application here:
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you how to
0:04
merge multiple videos into a single
0:07
video uh using uh
0:10
ffmppg library uh ffmppg is actually a
0:13
command line library where you can
0:15
actually manipulate uh videos process
0:18
them convert them from one format to
0:20
another so in this specific video I'll
0:22
talk about how to merge multiple videos
0:24
into a single video as you can see on my
0:27
screen right here we have four videos 1
0:30
2 3
0:31
4 so I will just write a simple command
0:35
in ffmppg in the command line to
0:37
actually concatenate all these videos
0:40
into a single videos so there is a
0:43
command here i have given the command in
0:46
the description of the video so now we
0:50
have these four videos first second
0:52
third
0:54
fourth and just go to the command prompt
0:57
and just write here
0:59
ffmpg - f and for this we will be using
1:03
the concat filter so so we simply write
1:07
ffmpg then we provide -ashf and we are
1:11
using concat fil uh filter in ffmppg and
1:15
then we provide dash i to provide the
1:17
input file so here we need to provide a
1:22
txt file here so filet txt so this file
1:26
we need to simply create in this uh
1:29
directory right here simply create this
1:31
file here which is
1:34
file so inside this filet
1:38
txt you will simply create this file
1:42
here so just create in notepad simply
1:46
write this format file 1
1:50
mp4 so this is actually the format here
1:54
so you need to concatenate all these
1:56
videos so you first of all write
1:58
1.mpp4 so
2:01
file space then the first video which is
2:04
1.mpp4 and then we go to the next line
2:07
we write the same file
2:09
2.mpp4 like this you will see that so
2:12
this is actually the format file
2:15
3.mpp4 file 4.mpp4 so we repeat this for
2:19
all the four files right here so
2:22
depending upon how many videos that you
2:24
have you simply create a notepad file
2:27
and just write file space 1.mpp4 file so
2:31
whatever is the name right here
2:33
alongside with the extension so this is
2:35
actually the format just create this
2:37
file save this and now we will use this
2:41
file right here as you can see we are
2:43
using it inside our command right here
2:48
ffmppg dash f concat and then we are
2:52
providing this file dash i
2:55
file.txt and after that we are simply
2:59
concatenating it so we don't need to uh
3:03
re re-encode the video so just to copy
3:07
the encoding se settings we simply
3:09
provide this option right here dash
3:12
copy so we are not re-encoding the video
3:15
so this will not take a lot of time and
3:18
then we just need to provide the output
3:20
file name so you can just give whatever
3:23
output file name that you want to give
3:24
here so in my case I just want to give
3:27
output.mpp4 so very simple command you
3:30
simply write fmpp
3:33
fconci file.txt txt we created already
3:36
this file here and then dash copy to
3:41
copy the encoding seconds and then the
3:42
output file name just press enter and
3:45
now you will see all the files you can
3:48
see the command is successfully executed
3:52
successfully
3:53
and the all the four files have been
3:56
concatenated into a merged into a single
4:00
output file right here so if I try to
4:02
open this you will see it is exactly 9
4:06
minutes 53 second you will see that
4:10
so let me turn on the volume as well so
4:13
that I show you it also contains volume
4:16
and just now open your environment with
4:18
FM see it will the C exe so you can see
4:23
we have all these four videos we
4:26
concatenated merged them into a single
4:28
output.mpp4 file right here
4:32
this is 2 minute this is again 2 minute
4:36
this is again 2
4:38
minute this is again 3 minutes so we
4:41
basically concatenated merged all these
4:44
four videos into a single so you can
4:47
actually get the full command i have
4:49
given this article of this stack
4:51
overflow.com where I get this command so
4:53
I have given this article in the
4:55
description of this video so you can
4:56
copy this command as well and just I
4:59
have shown you step by step in this
5:01
video we just need to create this file
5:03
here this is important just create a
5:05
file.txt and this is a format here file
5:09
space the first file name then file
5:12
space the second file name so if you
5:16
have thousands of videos you just uh
5:18
repeat this file space and then you can
5:22
actually
5:23
concatenate multiple videos into a
5:25
single video using this ffmpg command so
5:28
this was a tutorial guys uh thank you
5:30
very much for watching this so please
5:32
hit that like button subscribe the
5:34
channel and also check out my website
5:37
freemediattools.com which contains
5:39
thousands of tools regarding audio video
5:41
and image
#Multimedia Software
#Software