- Published on
Batch Extract MP3 from MP4 Videos
- Authors

- Name
- Johnson Chang
Extracting audio from multiple video files can be tedious if you do it manually one by one. Whether you’re archiving lectures, creating a music playlist from video files, or just need to separate soundtracks from MP4 videos, automation can save a lot of time. In this guide, you’ll learn how to batch extract MP3 files from MP4 videos using FFmpeg and a short Windows batch script—no manual conversion required.
Tools
- FFmpeg – a free, powerful command-line tool for audio and video processing
- Windows Batch Script – to automate repetitive FFmpeg commands
Steps
Install FFmpeg (Windows version)
- Download the official FFmpeg build from ffmpeg.org.
- Add the
ffmpeg.exepath to your Windows environment variables, or place it in the same directory as your videos.
Create a Batch Script
Open Notepad and paste the following script:
@echo off for %%a in (*.mp4) do ( ffmpeg -i "%%a" -vn -acodec libmp3lame -qscale:a 0 "%%~na.mp3" )Save the file as
extract_mp3.batin the same folder as your MP4 videos.
Run the Script
- Double-click the
.batfile. - The script will loop through all
.mp4files and extract their audio as.mp3in the same directory.
- Double-click the
How It Works
- @echo off — Suppresses command output in the terminal window.
- for %%a in (*.mp4) — Loops through every MP4 file in the current folder.
- ffmpeg -i "%%a" — Specifies the input video file.
- -vn — Excludes video output (audio only).
- -acodec libmp3lame — Uses the LAME MP3 encoder.
- -qscale:a 0 — Sets the best audio quality (0 = highest).
- "%%~na.mp3" — Names the output file after the original video, changing only the extension.
Notes
- You can adjust
-qscale:ato balance file size and quality (e.g.,2for medium quality). - For other audio formats (like
.wavor.aac), simply replace the codec and file extension. - FFmpeg must be properly installed or located in the same directory for the script to run.
This simple workflow automates what would otherwise be a repetitive task. With FFmpeg and a batch file, you can convert entire folders of MP4 videos into MP3s in seconds — ideal for podcasting, music archiving, or quick audio extraction.