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?
Asked
Active
Viewed 1.5k times
1 Answers
41
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

Motomotes
- 4,111
- 1
- 25
- 24
-
2If you have a 64bit Windows, change the CALL path of VLC to: "C:\Program Files (x86)\VideoLAN\VLC\vlc" – Diogo Luis Dec 01 '15 at 14:48
-
-
This is awesome. Figure out how to get album info automatically added as well and this will be the perfect batch! – ringstaff Dec 28 '15 at 20:12
-
@ringstaff VLC uses an external server (CDDB) to retrieve information for Audio CDs, but it doesn't do this for MP3s but trust their tags embedded in the file. This tool may be used to update MP3 Tags with info from CDDB, http://www.softpedia.com/get/Multimedia/Audio/Other-AUDIO-Tools/CDDB-MP3-Tool.shtml – Motomotes Dec 28 '15 at 20:38
-
2
-
1In Windows 10, this fails if their is a space in the filename, like the "Program Files" part of the directory path. So, you need to move VLC to something like "C:\VLC" and modify the path in the script for Windows 10. – Motomotes Mar 06 '17 at 22:06
-
I reduced the #transcode section to just {acodec=mp3} to avoid producing 0-byte files. – Peaeater Mar 03 '18 at 19:18
-
1I noticed the 0-byte file thing happens if you have VLC set to "loop" playback, as this is a persistent setting on the player. Reducing the transcode section is not the answer, I added `--noloop` to the command, and it worked for me. – Motomotes May 15 '18 at 15:07