How to Replace & Remove Video Original Audio with New Audio & Loop It with FFMPEG in Terminal
30 views
Jun 3, 2025
Command Used in the video: ffmpeg -i video.mp4 -stream__loop -1 -i audio.wav -map 0:v -map 1:a -c:v copy -shortest output.mp4
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
remove the audio from your video and
0:07
replace it with a new
0:10
audio and we will loop through if the
0:12
audio length is shorter than the video
0:15
So this is a very complex fmpp command
0:19
but it's very easy to learn So it will
0:21
basically do a lot of good things So we
0:24
have a simple video file Let me play it
0:27
So this is welcome variable created can
0:31
see you can see it's a original video
0:33
right here with my original voice here
0:36
So what I command
0:37
f what this ffmpg command will do it
0:41
will remove this audio from this video
0:43
mpg
0:44
just first of all it will remove this
0:47
audio and it will replace this with this
0:50
beep sound you will
0:54
see So it's a 1second beep sound MP3
0:57
file If you see we have this beep in the
1:00
same directory and we will first of all
1:03
remove this audio and then replace this
1:06
inside entirety with this beep sound So
1:10
just open command line in the directory
1:13
where all these assets are present and
1:15
simply type here f ofmppg and then dash
1:18
i to provide the input file name So
1:21
input file name is 2.mpp4
1:24
MP34 So after that we simply say dash
1:29
stream and dash
1:32
stream
1:34
underscore So here we just need to write
1:36
underscore loop
1:39
dash loop and then dash
1:44
1 and dash dash i And here we need to
1:48
loop through this uh new audio If you
1:51
see this is the name of the audio file
1:53
So we simply say beep do
1:57
mp3 and after that we just need to map
2:00
to the entire video So we use this map
2:02
filter dash map after that zero colon
2:08
v So this is after that we simply write
2:11
dash map 1 dot 1 a So just pause the
2:19
video and just write whatever whatever
2:21
I'm writing right here underscore a
2:24
after that we need to simply copy the
2:26
encoding settings For doing that we
2:28
simply say dash c colon v So this will
2:31
copy the encoding settings and here we
2:35
simply write copy and dash
2:41
shortest So it will take short amount of
2:43
time and then the output file name So
2:46
we'll say replaced dot
2:50
mp4 So what this is command is doing
2:53
guys we providing the input file then we
2:56
are removing the original audio and
2:58
replacing it with this new audio and we
3:01
are looping through and we are copying
3:04
the encoding settings and then this is
3:07
your output file name So if I press the
3:09
enter key and you will see it will
3:11
process this uh input video file and it
3:14
will create a new video file right here
3:16
and if I try to open this you will see
3:19
the audio is
3:25
removed So you can as you can see the
3:28
audio which was there in this video is
3:31
completely removed and it has been
3:33
replaced by a new audio This can be any
3:37
music file as well You can replace it
3:40
with any music which will appear for
3:43
copyright issues I'm not I'm just using
3:46
this beep sound So you can just have any
3:48
MP3 file You can replace it with any new
3:52
uh MP3 file that you
3:55
recorded So this I've given this command
3:58
in the description of this video So
4:01
just execute this and it will do this it
4:05
will remove the original audio and
4:06
replace it by with uh whatever MP3 file
4:10
that you want to use to the entirety of
4:12
the video So this was a tutorial in fmpp
4:16
which will save you a lot of time
4:18
because uh many a times you want to
4:21
replace audio inside your video for some
4:25
reason So this command will in that
4:27
situation will be very useful So I've
4:30
given this command in the description of
4:32
this video and also check out my website
4:35
freemediatools.com
4:36
uh which contains thousands of tools
4:38
regarding audio video and image
#Multimedia Software
#Software
#TV & Video