I am making a Windows batch script with ffmpeg that can convert an audio file into multiple formats.
I want the audio to be converted in two formats here. 32kbps and 40kbps.
Setlocal EnableDelayedExpansion
for %%a in ("*.*") do ffmpeg -i "%%a" -b:a 32000 "%%~na - [email protected]"
for %%a in ("*.*") do ffmpeg -i "%%a" -b:a 40000 "%%~na - [email protected]"
pause
However it seems I am getting three outputs.
sound - [email protected]
sound - mp3@40kbps-mp3
sound - mp3@32kbps - [email protected]
I know I must be doing something wrong here because I only want two files. Why do Why do I get a third format here (sound mp3@32kbps - [email protected]) and how can I avoid this?
This is the updated code I am using:
@echo off
for %%a in (*.*) do (
ffmpeg -i "%%a" -b:a 32000 -ar 44100 "%%~na - [16-bit 44,100kHz - 32kbps].mp3"
)
pause
converter.bat: Invalid data found when processing inputwhich means that ffmpeg has found something wrong with the batch file, not the audio file.