Record Virtual Audio Cable with FFmpeg on Windows

Capturing audio from a virtual sound card like Virtual Audio Cable (VAC) using FFmpeg on Windows allows you to record system sounds, application audio, or routed streams directly into a digital audio file. This guide provides a straightforward, step-by-step walkthrough on how to identify your virtual audio devices using DirectShow and execute the correct FFmpeg commands to record high-quality audio.

Step 1: Identify Your Virtual Audio Device Name

Before recording, you must find the exact name of your virtual audio device as recognized by Windows. FFmpeg uses the DirectShow (dshow) device grabber to access Windows audio hardware.

Open your Windows Command Prompt (cmd) or PowerShell and run the following command:

ffmpeg -list_devices true -f dshow -i dummy

Locate the section in the output labeled “DirectShow audio devices”. You will see a list of available audio input devices. Look for your virtual audio card, which is often named something like: * "Line 1 (Virtual Audio Cable)" * "CABLE Output (VB-Audio Virtual Cable)"

Note the exact name inside the quotation marks.

Step 2: Record Audio Using FFmpeg

Once you have the device name, you can start recording. Use the following command structure to capture the audio and save it to a file.

Replace "Line 1 (Virtual Audio Cable)" with the exact name of your virtual device:

ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" output.mp3

Explaining the Command Parameters:

Advanced Recording Options

To ensure maximum compatibility and audio quality, you can specify the audio codec, sample rate, and bit rate manually.

Record Lossless WAV (PCM 16-bit):

ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" -c:a pcm_s16le output.wav

Record High-Quality MP3 (320kbps):

ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" -c:a libmp3lame -b:a 320k output.mp3

Record AAC Audio with 48kHz Sampling Rate:

ffmpeg -f dshow -i audio="Line 1 (Virtual Audio Cable)" -c:a aac -ar 48000 output.m4a

To stop the recording at any time, press q or Ctrl + C in the command prompt window. FFmpeg will safely close the file and finalize the audio track.