FFMPEG Command to Split Video into Multiple Parts & Segments in Terminal
32 views
Jun 3, 2025
ffmpeg -i input.mp4 -c copy -map 0 -segment_time 30 -f segment part_%03d.mp4
View Video Transcript
0:00
uh hello guys welcome to this video i'll
0:03
in this video I'll show you how to split
0:05
a long video into short parts into
0:09
smaller segments inside ffmpg right in
0:12
the terminal itself so now let's suppose
0:14
I taking a very simple example here we
0:16
have a simple video file present 1.mpp4
0:20
if I try to open this
0:22
file it's a 2 minute video show you how
0:26
to fix this so now if you want to split
0:28
this video into multiple parts shorter
0:31
form of videos let's suppose 30 second
0:33
video part so if you want to divide this
0:36
video split this video uh inside ffmppg
0:39
there is a simple command that you can
0:41
execute come to the command line just
0:43
write here ffmpg- i and then here you
0:46
need to provide the input file name
0:48
which is
0:49
1.mpp4 the file is present in the same
0:51
directory and then there is this command
0:54
here dash
0:57
copy dash
0:59
map
1:01
zero and then the segment time dash
1:05
segment time so very simple syntax uh
1:10
first of all we are providing the input
1:11
file here by this - i flag fmpg-
1:16
i1.mpp4 then this -
1:19
ccopy-map0ero it is essentially we are
1:22
not re-encoding the video the encoding
1:25
is not done so this will be a little bit
1:27
faster that's why we are writing here -
1:29
ccopy map zero and then this is dash
1:33
segment time so here we need to specify
1:36
how much time each video takes so here
1:40
we will provide 30 seconds so each video
1:42
will be divided into 30 secondond parts
1:46
and then we just need to say
1:49
-ashf and
1:51
then segment once again we need to write
1:54
and then the output files so dynamically
1:58
we will be creating it so we will say
2:02
part and then we will put this dynamic
2:05
variable underscore uh percentage sign
2:09
03
2:12
d.mpp4 so just pause the video just
2:15
write this command right here this is
2:17
your output file name so here we are
2:20
embedding this dynamic
2:22
variable percentage 03d is MP4 so if I
2:27
execute this command just
2:30
see these parts are automatically
2:33
created this is your first part second
2:36
part third part fourth part fifth part
2:39
so depending upon the length of the
2:41
video this command will automatically
2:43
split your input video into multiple
2:45
parts right here of 30 seconds so it
2:50
will calculate how many parts are
2:52
necessary depending upon the length of
2:54
the video so if I now open this you will
2:57
now see this will uh hello be the first
2:59
30 seconds right here you will
3:02
see this is again the next part if you
3:05
haven't installed it if you if you
3:08
haven't installed it then you should if
3:11
you haven't
3:14
installed and here all the executables
3:17
are located i simply copy this loop so
3:21
this splitting is very much needed if
3:24
you have a very long video if you want
3:26
to create some short little highlights
3:28
this command is very useful and uh you
3:31
can just uh control how much time each
3:34
video takes inside this command i've
3:36
given this command in the description of
3:37
this video so right here dash segment
3:41
time if you want each video to take 10
3:43
seconds so just replace here 10 and then
3:47
you will see automatically all these
3:49
parts will be created this first second
3:51
third fourth now the parts will be
3:53
larger 12 videos are created right here
3:56
each video taking 10 10 seconds so this
3:59
is a really nice feature uh because
4:02
splitting is very much needed if you
4:04
have a very long video just need to
4:07
divide it into multiple short parts so
4:09
this is actually the way by which we can
4:12
do this inside ffmppg write in the
4:14
terminal itself so this was the command
4:17
and thank you very much for watching
4:18
this video and also check out my website
4:21
freemediatools.com which contains
4:24
thousands of tools
#Multimedia Software
#Software