Folder .mp4 .wav Conversion

Converting All .mp4 Files to .wav in a Folder

A note on converting all .mp4 files in a folder to .wav files using the ffmpeg command after installing ffmpeg on Linux/Windows. Converting all files in a folder to .wav, deleting files other than wav (.mp4, etc.), or converting videos downloaded from Nico Nico Douga to .wav, etc.

Shou Arisaka
1 min read
Oct 30, 2025

A note on converting all .mp4 files in a folder to .wav files using the ffmpeg command after installing ffmpeg on Linux/Windows.

## Convert all .mp4 files in a folder to .wav
for i in *.mp4; do ffmpeg -i "$i" -vn -acodec pcm_s16le -ar 44100 -ac 2 "$i.wav"; done

## Convert all files in a folder to .wav
for i in *; do ffmpeg -i "$i" -vn -acodec pcm_s16le -ar 44100 -ac 2 "$i.wav"; done

## Convert files other than .wav to .wav (prevents .wav from becoming .wav.wav)
for i in !(*.wav); do ffmpeg -i "$i" -vn -acodec pcm_s16le -ar 44100 -ac 2 "$i.wav"; done

## Delete files other than wav (.mp4, etc.)
rm !(*.wav)

Useful for converting videos downloaded from Nico Nico Douga to .wav, etc.

For personal use

Place videos downloaded from Nico Nico in /mnt/c/tmp/_ and execute the following command:

cd /mnt/c/tmp/_ && for i in !(*.wav); do ffmpeg -i "$i" -vn -acodec pcm_s16le -ar 44100 -ac 2 "$i.wav"; done && rm !(*.wav)

Share this article

Shou Arisaka Oct 30, 2025

๐Ÿ”— Copy Links