[FFmpeg-user] Reliable audio capture method on windows ? (stereo mix does not exist on most computers)
ffmpeg-user at domn.net
Tue Nov 8 08:17:28 EET 2022
I need a way to capture output audio that works reliably on most computers
without having to know anything about the state of said computer.
Searching for ffmpeg how to capture desktop audio only returns variants of
-f dshow -i audio="Stereo Mix (Realtek High Definition Audio)"
However, none of the computers I have in the house have any form of "stereo
mix" recording device
Yes,I did try all of these fixes
None of them work, stereo mix is a sound card driver feature that only
exists on some cards and only some drivers. Most random computers you come
across will not have this so giving the user a ffmpeg command string almost
As far as I can tell, ffmpeg has no current way of desktop audio capture on
If it existed, I think it would be described here
But audio capture is possible without 3rd party applications or drivers on
windows. OBS proves it, it can capture on all of my computers without any
prior setting up
There seems to be two systems which OBS uses, one that can capture all
system output audio and one that can capture audio on a per application
I'm not sure what the API is for the whole desktop (presumably an older
API), but the for the per-application capture, it is using the
API, which has been back ported to later versions of windows 10.
I have done some poking around in the ffmpeg code and found these clues to
how they are doing it.
obs forum post by audio capture dev
audio related obs files
ActivateAudioInterfaceAsync with AUDIOCLIENT_PROCESS_LOOPBACK_PARAMS
More information about the ffmpeg-user