14

I am trying to record what's playing on my soundcard in Windows 8.1

I ran the following to determine what devices I have:

ffmpeg -list_devices true -f dshow -i dummy

The output listed:

DirectShow video devices (some may be both video and audio devices)
  "Built-in iSight"
DirectShow audio devices
  "Microphone (Cirrus Logic CS4206A (AB 71))"
  "Digital Audio (S/PDIF) (Cirrus Logic CS4206A (AB 71))"

From this I am assuming that Digital Audio (S/PDIF) (Cirrus Logic CS4206A (AB 71)) is my one and only output soundcard.

So I put on some random youtube video with sound and run the following to record an mp3 for duration of 10 seconds.

ffmpeg -f dshow -i audio="Digital Audio (S/PDIF) (Cirrus Logic CS4206A (AB 71))" -acodec libmp3lame  -t 10 out.mp3

It does record a 10 second clip but its silent.
When I look at playback devices, I see that the device through which audio is actually playing is Speakers, not Digital Audio (S/PDIF). enter image description here

I tried replacing Digital Audio (S/PDIF) with Speakers in the ffmpeg command line, but it obviously couldn't recognize the device.

I've seen in a similar question, that people suggested "Stereo Mix" - I do not see it on my computer at all. Downloading the latest drivers didn't add it to the list of devices.

So what am I missing? How can I record the audio off my sound card

2
  • 3
    either stereo mix (doesn't exist typically in windows > XP) or some type of virtual audio capturer like github.com/rdp/virtual-audio-capture-grabber-device or VAC or VB net or what not
    – rogerdpack
    Commented Nov 3, 2015 at 22:05
  • @rogerdpack Thank you for the advice. I grabbed the github package and was recording in no time. Commented Nov 4, 2015 at 16:41

3 Answers 3

5

If it's still relevant to anybody. You need to open Sound Devices window shown above, then click RMB in clean spot and select Show Disabled Devices to toggle Stereo Mix device visibility

1
  • No, it doesn't work. In a lot of environments "Stereo Mix" isn't just disabled, it is just missing. You have to use windows wasapi and put in loopback the speakers! By the way what do you mean for RMB ? Commented Nov 9, 2023 at 7:55
7

First enable your Stereo Mix by opening the "Sound" window shown in the screenshot above, selecting the "Recording" tab, then right clicking on the window and selecting "Show Disabled Devices" to toggle the Stereo Mix device visibility. This post has the instructions in more detail.

After you enable your Stereo Mix you need to plug a speaker or headphones into your audio output. Then run the command to get the name of your headset/speaker output.

ffmpeg -list_devices true -f dshow -i dummy

Here is the full command that is working for me on Windows 10 Home to get the audio:

ffmpeg -f dshow -i audio="Microphone (Realtek High Definition Audio)" D:\Audio\output.mp3

Here is a command for audio and video at the same time:

ffmpeg -f gdigrab -framerate ntsc -video_size 1920x1080 -i desktop  -f dshow -i audio="Microphone (Realtek High Definition Audio)" -vcodec libx264 -pix_fmt yuv420p -preset ultrafast D:\Movies\output.mp4

This video output is also working on my iPad. I have a laptop plugged into a monitor and this will record the full screen of my monitor and the audio coming out of my speakers.

5
  • 1
    that list devices gives me an error.
    – chovy
    Commented Dec 29, 2020 at 15:49
  • 1
    This solution doesn't work. I've seen this explained in several posts and followed and re-followed it perfectly and it just records dead air.
    – Tyguy7
    Commented Apr 23, 2021 at 7:57
  • Ok first, why would you record from the microphone? When I do that I just hear the sounds in the room. When I try recording the USB-C microphone, I hear room sounds, but only if I replug it. When I try recording the now-enabled Stereo Mix, which is what I expect should work, I also hear nothing.
    – Michael
    Commented Nov 7, 2022 at 23:18
  • @Michael This was a long time ago, and I have not used ffmeg for a long time, but if I recall correctly, I just tried what was there and eventually found one that worked for me. I agree it is strange.
    – ADH
    Commented Nov 9, 2022 at 15:07
  • 1
    Figured it out... apparently you have to close the panel in which you enable Stereo Mix before Windows 10 will release access and let other apps use it.
    – Michael
    Commented Nov 9, 2022 at 16:41
1

The answer doesn't work in Practice, for the reason that it doesn't work if headphones are plugged in.

I can get ffmpeg to record, using the above directions (except that they forgot to tell people that they need to run mmsys.cpl, and assumed people knew or remember how to do it, which is unlikely, unless you have done it in the last 6 months at least 7 times). But this only works until I plug in some headphones to quiet the machine from disturbing the room around, which is essential on a laptop that lacks external speakers that can be unplugged.

In addition to elaborating on why 5 other users in the thread sporadically couldn't get this to work. (I too had sporadic results until I realized that I was plugging and unpluging the ear phones for 2 reasons. Then I realized that plugging in headphones, muted the recording)

I do not believe that there is any obvious work around this. So far, I have tried to be more specific in the sound mixer. I also ran the dummy code for ffmpeg to see if any more devices popped up. If you want to record on a laptop, don't wish a blaring player, i5 is going to take the purchase of an external sound card and see if that works, if there isn't a trick to get ffmpeg to record from the stereo mix when headphones are attached, despite enabling it in the mmsys.cpl.

The other solution partial solution is to use a virtual sound card driver, which works great. I personally am recording 2 streams at one time, but want to record as many as possible at the same time on one machine to get the maximum variety to choose from, without streaming data. It would be nice to not to waste and make use of the laptop's internal sound card, without the laptop's speaker jabbering while no one is listening.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .