---
title: 'FFMPEG Bulk Batch Processing Command to Convert Entire Directory of MP4 Videos to MP3 Files in CMD'
source: 'https://youtube.com/watch?v=up-2-HYNkd8'
video_id: 'up-2-HYNkd8'
date: 2026-06-14
duration_sec: 302
---

# FFMPEG Bulk Batch Processing Command to Convert Entire Directory of MP4 Videos to MP3 Files in CMD

> Source: [FFMPEG Bulk Batch Processing Command to Convert Entire Directory of MP4 Videos to MP3 Files in CMD](https://youtube.com/watch?v=up-2-HYNkd8)

## Summary

This video demonstrates a simple one-line command to batch convert all MP4 videos in a directory to MP3 files using FFmpeg on Windows. The script uses a for loop to process each video, extracting audio and saving it as an MP3 file in the same folder.

### Key Points

- **Introduction to batch processing** [0:00] — The video shows a script to process multiple videos at once, converting them to MP3.
- **Example directory with four MP4 videos** [0:37] — The presenter has four MP4 videos in a directory and will convert them all to MP3.
- **One-line command for Windows** [1:12] — The command is: for %i in (*.mp4) do ffmpeg -i "%i" "%~ni.mp3"
- **Explanation of the loop** [2:02] — The for loop iterates over all .mp4 files, using %i as a placeholder for each filename.
- **Execution and results** [3:20] — After running the command, four MP3 files are created in the same directory.
- **Reference article and cross-platform commands** [4:17] — The command works on Windows; the description includes a link to a Stack Overflow article with Linux/Mac commands.

### Conclusion

This simple FFmpeg batch command saves time when converting many videos to MP3, and the same approach can be adapted for other formats.

## Transcript

Uh hello guys uh welcome to this video.
So in this video I will show you a
ffmppg batch processing script or
command that you can actually run to
process multiple videos at a single
time. So if let's suppose if you have a
directory containing multiple videos
let's suppose it can contain either 10
videos or it can contain 100 videos as
well.
So using this ffmppg script or command
that I will show you, it will process
and convert all these videos into MP3.
So it will extract all the sound from
this videos and save it as a MP3 file.
So just go to your command line and as
you can see we have four videos present
in my directory. So this is first,
second, third, fourth. All these videos
are in MP4 format MP4. So what I will do
is that I will convert all these four
videos into MP3. So just go to the
directory wherever your videos are
present. So simply open the command line
right here. So I just open command line
in the directory where all the videos
are present. So once you open it, this
is actually a very simple oneline
command that you simply write here for
and then you write percentage
sign I. So we are simply running a for
loop right here in the command line. So
for percentage sign I after that we just
need to say in and then parenthesis and
then we just need to write
here asterric sign right here and then
MP4. So this is essentially what it is
doing right here. It is looping through
all the videos which are present in this
folder. It is saying for and we have put
this placeholder variable I in and this
parenthesis is doing it
is MP4. So we are not providing names
right here. Names can be anything but we
just provided this extension that
ismpp4. So it is essentially it is
saying that if all the videos are
present in this folder is MP4. So one by
one it is uh do the processing of each
video and after that we just need to
execute the command here. So we simply
write
do
ffmppg dash i. So we take each video and
we execute this simple command ffmpg- i
and after that we just say in double
quotes percentage sign i. We take the
video and after that again we write uh
double quotes and we convert that video
into MP4. So we simply write here this
symbol which
is right in the keyboard right here. You
throw just put shift key you will see
this is actually the key right here and
then you
can
ni.mpp3. So I have given the command in
the description of this video. So you
can copy this command. So you just need
to write this
command in double quotes percentage sign
ni.mpp3. So as soon as I execute this
command right here, you will see it will
process each video and it will create
this MP3 file for each video in the same
directory. So you can see it will save
you a lot of time because if you have
thousands of videos present and if you
just want to convert videos into MP3 you
can just execute the script in the
command line and you will see the
processing has been complete and the
four MP3 videos have been created
automatically. So you can see if I so in
this video I will show you variable by
these three. So see it is extracted all
the sound. Here it
is dot
up do machine W6. So all the four videos
sound has been extracted which comes
right here four different MP3 files. So
I have given this command uh with a
little bit detailed article as well of
stra overflow.com where I got this
command.
So they have explained each option in
detail and after that they have also
given command from Linux. This command
will only work for Windows machine but
if you are on Mac or Linux they have
also given command from for that as
well. So you can refer this article.
I've given this article in the
description of this video. So if you are
on Linux or Mac, you basically copy this
command and it will do the same task for
you. So thank you very much for watching
this video and also check out my website
freemediattools.com
uh which contains thousands of tools
regarding audio, video and image.
