VLC command line batch file to rip audio CD

vlc
user2574981 picture user2574981 · Jul 12, 2013 · Viewed 13.8k times · Source

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?

Answer

Motes picture Motes · Jul 12, 2013

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