Jump to content
IGNORED

best batch FLAC->MP3 converter for win7


dr lopez

Recommended Posts

if you want the mp3 files to be in the same folder as the original flacs (and optionally delete the flacs when done) it would be super easy with ffmpeg.exe and a "for loop" in Windows batch:

:ASSUMES THIS BATCH FILE IS IN A FOLDER THAT CONTAINS ONLY THE FLACS YOU WANT TO CONVERT
:ASSUMES FFMPEG.EXE EXISTS ALONGSIDE THIS BATCH FILE
:LIBMP3LAME IS SET FOR MAXIMUM QUALITY VBR0 OUTPUT
@echo off
if not exist ffmpeg.exe goto BAIL
:CONVERT
echo Converting FLACs to MP3...
for /f "delims=" %%A in ('dir /s /b "%~dp0*.flac"') do (
echo Converting %%~nA%%~xA
start /b "" ffmpeg -loglevel error -y -i "%%A" -acodec libmp3lame -joint_stereo 0 -compression_level 0 -q 0 -map_metadata 0 "%%~pA\%%~nA.mp3"
tasklist /FI "IMAGENAME eq ffmpeg.exe" 2>NUL | find /i /c "ffmpeg.exe" >threadcount.txt
     for /f "tokens=*" %%B in (threadcount.txt) do (
     if "%%B" GTR "6" ping 1.1.1.1 -n 1 -w %%B000 >NUL
     )
)
endlocal
:DELETE_PREP
echo.
echo Done converting.
echo Going to delete FLACs...
echo Waiting for ffmpeg threads to finish...
:TASKCHECK
echo ffmpegs are not done yet...
ping 1.1.1.1 -n 1 -w 5000 >nul
tasklist /FI "IMAGENAME eq ffmpeg.exe" 2>NUL | find /i /n "ffmpeg.exe">NUL
if "%ERRORLEVEL%"=="0" goto TASKCHECK
GOTO DELETE_NOW
:DELETE_NOW
del /f /q threadcount.txt
echo.
echo ffmpeg threads are done!
echo To keep FLACs, close this window WITHOUT pressing any keys.
echo To delete FLACs,
pause
echo Are you SURE you want to delete FLACs?
echo If so,
pause
echo Ok, deleting FLACs...
for /f "delims=" %%A in ('dir /s /b "%~dp0*.flac"') do (
del /f /q "%%A"
)
echo All done!
pause
exit
:BAIL
echo Error, could not find ffmpeg.exe
pause

What bitrate/quality are you going for, straight 320, 32-320 variable, etc? Are you trying to make them small to fit on a portable device or something? I can tweak the script to your needs.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.