I am use FFmpeg v4.1 .
How can I convert all '.mp3' files in the "ab1" folder to the "cd2" folder with the same file names as '.mp3'?
The process I'm going to do is:
-acodec libmp3lame -b:a 192k -ar 48000 -map_metadata -1
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It only takes a minute to sign up.
Sign up to join this communityI am use FFmpeg v4.1 .
How can I convert all '.mp3' files in the "ab1" folder to the "cd2" folder with the same file names as '.mp3'?
The process I'm going to do is:
-acodec libmp3lame -b:a 192k -ar 48000 -map_metadata -1
You can use a bash for loop.
cd ab1
mkdir cd2
for f in *.mp3; do ffmpeg -i "$f" -c:a libmp3lame -b:a 192k -ar 48000 -map_metadata -1 "cd2/${f%.*}.mp3"; done
This assumes your OS supports bash shell scripting.
Cross platform solution with Powershell (Cross-platform, but only Windows has powershell installed by default. Mac or Linux users have to install it).
ls "\path\to\source\folder\"|?{$_.extension -match (".mp3")}|%{
ffmpeg -i $_.fullname -acodec libmp3lame -b:a 192k -ar 48000 -map_metadata -1 ("\path\to\destination\folder\" + $_.name)
}
the |?{$_.extension -match (".mp3")}
means where the item's extension matches ".mp3" and is only necessary if you have other files in the source folder.
"\path\to\source\folder\"
or "\path\to\destination\folder\"
need to be replaced with, er, the path to the folders. One or the other can be omitted if your current directory is the source folder, or destination folder respectively. This can be an absolute or relative path.
mkdir "\path\to\destination\folder\"
before running the command.