Search code examples
vlc

VLC command line batch file to rip audio CD


Anyone have a batch file to rip a CD using VLC player, so I don't have to rip one track at a time using the GUI?


Solution

  • Just replace the D: with your CD drive (2 bold italic occurrences):

    @ECHO OFF
    
        setlocal ENABLEDELAYEDEXPANSION
    
        SET /a x=0
    
        FOR /R D:\ %%G IN (*.cda) DO (CALL :SUB_VLC "%%G")
        GOTO :eof
    
        :SUB_VLC
        call SET /a x=x+1
    
        ECHO Transcoding %1
        REM Here's where the actual transcoding/conversion happens. The next line
        REM fires off a command to VLC.exe with the relevant arguments:
        CALL "C:\Program Files\VideoLAN\VLC\vlc" -I http cdda:///D:/ --cdda-track=!x! :sout=#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access="file",mux=raw,dst="Track!x!.mp3"} --noloop vlc://quit
    
        :eof