Advertisement
slyfox1186

ffmpeg-convert-flac-to-mp3.bat

Jun 7th, 2021 (edited)
795
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.84 KB | None | 0 0
  1. @ECHO OFF
  2. SETLOCAL
  3. COLOR 0A
  4. TITLE RECURSIVELY CONVERT FLAC FILES TO MP3
  5.  
  6. :-----------------------------------------------------------------------------------------------------------------
  7.  
  8. REM Output file specs: mp3 @ 320kbps
  9.  
  10. REM By: SlyFox1186
  11. REM Pastebin: https://pastebin.com/u/slyfox1186
  12.  
  13. REM IMPORTANT 1.. !Always! test run this script
  14. REM before running it on your irreplaceable files!
  15.  
  16. REM IMPORTANT 2.. Make sure to point the 'FF' variable
  17. REM below to your ffmpeg.exe's full path.
  18.  
  19. REM The script will also transfer any embedded images
  20. REM found inside each FLAC file inside the output file.
  21.  
  22. :-----------------------------------------------------------------------------------------------------------------
  23.  
  24. PUSHD "%~dp0"
  25. IF NOT "%1"=="MAX" START /MAX CMD /D /C %0 MAX & GOTO :EOF
  26.  
  27. :-----------------------------------------------------------------------------------------------------------------
  28.  
  29. SET FF="PATH\TO\ffmpeg.exe"
  30.  
  31. :-----------------------------------------------------------------------------------------------------------------
  32. :RUN_FFMPEG
  33. :-----------------------------------------------------------------------------------------------------------------
  34.  
  35. SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  36. SET CNT=
  37. FOR /R %%G IN (*.flac) DO (
  38.     SET /A CNT+=1
  39.     SET "ADIR=%AppData%\%%~nG.jpg"
  40.  
  41.     %FF% -y -nostats -hide_banner -vsync 2 -color_range 2 -i "%%~fG" "!ADIR!"
  42.  
  43.     ECHO= & ECHO=
  44.     ECHO [ #!CNT! ] %%~nxG
  45.     ECHO= & ECHO=
  46.  
  47.     %FF% -y -nostats -hide_banner -vsync 2 -color_range 2 -i "!ADIR!" -y ^
  48.     -i "%%~fG" -ab 320k -ac 2 -map_metadata 0 -id3v2_version 3 "%%~dpnG.mp3"
  49.  
  50.     DEL /F /Q "!ADIR!" >NUL
  51.     ECHO= & ECHO=
  52. )
  53.  
  54. :-----------------------------------------------------------------------------------------------------------------
  55.  
  56. ENDLOCAL
  57. COLOR 0E
  58. ECHO=
  59. ECHO FFMPEG COMPLETED!
  60. ECHO=
  61. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement