#StackBounty: #ffmpeg How to fix "Could not run graph" error when recording the screen with audio using ffmpeg in Windows 10?

Bounty: 150

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 🙂


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.