Record Screen and System Audio with FFmpeg on Windows

Capturing both your screen and system audio simultaneously on Windows using FFmpeg requires configuring the correct input devices. This guide provides a straightforward, step-by-step walkthrough on how to identify your internal audio device and run the exact FFmpeg command needed to record high-quality screen video alongside desktop audio.

Step 1: Identify Your Audio Device Name

To record system audio, you must target the loopback device of your speakers or headphones. FFmpeg can discover these devices using the DirectShow framework.

Open Command Prompt or PowerShell and run the following command:

ffmpeg -list_devices true -f dshow -i dummy

Look at the output under the DirectShow audio devices section. You need to find the loopback version of your active playback device. It will look something like this:

Copy the exact name inside the quotation marks.

Step 2: Run the FFmpeg Capture Command

Once you have your audio device name, use gdigrab to capture the desktop screen and dshow to capture the system audio.

Replace YOUR_LOOPBACK_DEVICE in the command below with the exact name you copied in Step 1:

ffmpeg -f gdigrab -framerate 30 -i desktop -f dshow -i audio="YOUR_LOOPBACK_DEVICE" -c:v libx264 -pix_fmt yuv420p -c:a aac output.mp4

Command Breakdown:

Step 3: Stop the Recording

To stop recording, click on the Command Prompt window and press Q or Ctrl + C. FFmpeg will safely finish writing the file and save the output.mp4 file in your current working directory.