1

I want to record the screen with audio using ffmpeg in Windows 10.

The following command works but it does not record the audio:

 .\ffmpeg -f gdigrab -framerate 30 -i desktop output.mkv

To fix the issue, first I enable Audio Mix device from control panel > sounds

enter image description here

and then tried to find it in my audio devices with the follwing command:

 .\ffmpeg -list_devices true -f dshow -i dummy

enter image description here

I try different syntaxes to add audio to the video in the first command:

.\ffmpeg -f gdigrab -framerate 60 -video_size 1920x1080 -i desktop -f dshow -i audio="Stereo Mix (Realtek(R) Audio)" -vcodec libx264  -preset ultrafast -tune zerolatency -pix_fmt yuv422p -f mpegts udp://ip
   

.\ffmpeg -f gdigrab -i desktop -f dshow -i audio="Stereo Mix (Realtek(R) Audio)" -vcodec libx264 muxed-video-file.mp4

but the error is always the same:

Could not run graph (sometimes caused by a device already in use by other application)
audio=Stereo Mix (Realtek(R) Audio): I/O error

enter image description here

Please let me know if you know a working solution or a hint :-)

Sadegh
  • 583
  • 2
  • 7
  • 30

2 Answers2

4

I finally figured this out myself and I'm not sure if it applies in your situation but win 10 can cause virtual inputs like this to not be available due to privacy settings for the microphone. I'm using vb-audio "virtual audio cable" but I assume the same applies to Realtek stereo mix.

For me it was fixed by going to Privacy Settings In the App permissions section click "Microphone" And enable "Allow apps to access your microphone"

Screenshot of setting

Stephen Rauch
  • 3,091
  • 10
  • 23
  • 26
Will Carle
  • 41
  • 2
  • thanks for the answer. I see this particular setting is already set up correctly. however, I am not sure if I saw the microphone icon when I tried it. I will try again later. – Sadegh Dec 23 '20 at 09:25
  • Seemed to work for me; I was using Virtual Audio Cable on a windows VM and the two things I changed were: make two cables (one for line in, one for line out), and this setting. ffmpeg started working right after – Caius Jard Feb 08 '21 at 19:14
0

This whole time, the solution to my problem was a single button in the windows settings for a seemingly useless feature... Those VCL error messages are REALLY useless, wasted so much of my time. I'm pretty sure this is the only forum that actually mentions this as well.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 21 '22 at 13:25