Encoding a Flac library

Useful and helpful Windows specific command line samples and examples.
Post Reply
mapomme1108
Posts: 1
Joined: Thu Oct 25, 2018 8:31 am

Encoding a Flac library

Post by mapomme1108 » Thu Oct 25, 2018 8:38 am

Hello,

I want to encode a directories structure of Flac albums to MP3.
There are a lot of albums into seperates folders all in one root folder.

I have found this script

Code: Select all

@echo off
REM keep a counter for files converted
set /A nfile=0
REM do not copy empty folders or any files
@echo Copying directory structure from %0 to %1 ...
xcopy /T %1 %2
REM walk directory structure and convert each file in quiet mode
for /R %1 %%v in (*.mp4, *.aac, *.flv, *.m4a, *.mp3) do (
    echo converting "%%~nxv" ...
    ffmpeg -v quiet -i "%%v" "%2\%%~nv.mp3"
    set /A nfile+=1
)
echo Done! Converted %nfile% file(s)
but it creates the directories in destination folder but it puts the converted files at the root of the destination folder, not in the created subfolders.

How can I fix this?

Thanks ! ;)

Post Reply