Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to capture the stereomix or line-in sound on Windows with the Windows build of ffmpeg. On linux I'd do something like this:

ffmpeg -f alsa -ac 2 -ar 48000 -i front rec.flac

This records from the alsa device, and saves it as FLAC. Now, I'd like the same thing, but on Windows.

How do I do that?

share|improve this question

I don't know about ffmpeg specifically, but

Here's something to try..which has worked for other programs like audacity or sndrec32.

just generally tells windows to record what would come out the speakers before it comes out. Instead of taking input from the mic or line in. This has then worked when hitting record in programs.

Open the volume control(, or the icon in the tray), then go to check boxes stereo mix and mono mix. Now choose Stereo mix or mono mix.

Then if I recall, when you open if you play things and hit record it should pick it up. Instead of things from the mic again when you want it.

And remember to change it back so you get recording from mic again!

It worked for the few programs i've used.. So it may help for ffmpeg too.

share|improve this answer
OK, but what should I chose for -i and -f options then? – polemon Feb 28 '11 at 11:24
I don't know. I searched for recording from line in or mic and didn't find things, then searched for ffmpeg windows record from, and I found this… it's from the ffmpeg users mailing list.. it says By running: ffmpeg -f vfwcap -i 0 output.mpg you should be able to record from the default device. You might have to pass the framerate before the -i, such as: ffmpeg -f vfwcap -r 25 -i 0 output.mpg I haven't tried it though – barlop Feb 28 '11 at 12:56
Erm, I don't plan to capture video. VfW is is just a format filter for re-encoding. A friend of mine looked through the source code of FFmpeg and confirmed, that it's simply not possible to capture sound with FFmpeg. VfW is for input devices, like Webcams, capture devices, etc. – polemon Mar 1 '11 at 10:16
up vote 0 down vote accepted

OK, no one came up with this, really, so this is what I use most of the time:

I use sox.

It is the best option so far, I can record with rec, it will always record from the activated device in the windows sound configuration.

share|improve this answer

With the recently added directshow support, you should be able to capture it by selecting stereo mix in your “recording properties” and then recording with the "normal" audio line in.

You could use a directshow audio "sniffer" if you're on vista/windows 7

then it's

$ ffmpeg -f dshow -i audio=virtual-audio-capturer out.mp3

share|improve this answer
I settled on using SOX recorder for that. It works reasonably well. – polemon Sep 2 '11 at 16:47
so sox can record stereo mix? – rogerdpack Nov 5 '13 at 17:34
yes, it can. If stereo mix is selected in the volume/sound manager, sox will record from that pseudo device. – polemon Nov 6 '13 at 3:33
ok yeah, that option will only work if you sound card "exposes" stereo mix, if not available then other options might then be necessary for some users. – rogerdpack Nov 6 '13 at 16:17
It is driver dependent. The standard audio drivers of Windows do that, though. Back in the Windows XP days, it was pretty much the fallback for any recording, as this is the downmix before it goes off to the line-out/speaker DACs. You pretty much only run into problems, when you have some fancy sound card that uses its own highly specialized drivers. Even ASIO devices work with that. – polemon Nov 7 '13 at 2:11

You must log in to answer this question.

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