This Python script extracts audio from all video files in a specified folder using ffmpeg. The extracted audio is saved as WAV files in a subfolder.
- Batch extraction of audio from
.mp4
,.mkv
,.mov
,.avi
(customizable) - Output is lossless WAV format
- Skips files if audio already extracted
- Simple command-line interface
- Python 3.6+
- ffmpeg (must be installed and in your system PATH)
- Windows, macOS, or Linux
- Clone or download this repository.
- Install ffmpeg:
- On Windows (with Chocolatey):
choco install ffmpeg -y
- On macOS (with Homebrew):
brew install ffmpeg
- Or download from ffmpeg.org
- On Windows (with Chocolatey):
python extract_audio.py "path\to\your\video\folder"
python extract_audio.py "path\to\your\video\folder" --extensions .mp4,.mov
- The script will create an
extracted_audio
folder inside your video folder. - All extracted
.wav
files will be placed there.
python extract_audio.py "C:\Users\andre\Videos"
- ffmpeg not found:
Make sure ffmpeg is installed and added to your system PATH. - Unicode errors:
The script uses UTF-8 encoding and ignores problematic characters in ffmpeg output.
MIT License