PowerShell one-liner: Convert FLAC to MP3 using ffmpeg

By , 2022-08-09 21:07

obviously requires ffmpeg in PATH, I use the Windows binaries from here: https://github.com/BtbN/FFmpeg-Builds/releases

Get-ChildItem -Filter '*.flac' ".\inflacfilesdir\" | ForEach-Object { ffmpeg -i $_.FullName -c:a libmp3lame -q:a 0 -map_metadata 0 ".\outmp3filesdir\$($_.Basename).mp3" }
  • -c:a libmp3lame = use lame encoder
  • -q:a 0 = equivalent to lame V0 VBR
  • -map_metadata 0 = copy metadata tags, including embedded album art
  • inflacfilesdir and outmp3filesdir should be modified to point to corresponding directories. They can also be set to the same value if you want the .mp3 files to be created in the same place as the .flac files.

Leave a Reply

 

Custom theme by me. Based on Panorama by Themocracy