7

Is it possible to capture multiple audio devices using ffmpeg dshow? I am trying to capture my desktop using gdigrab along with mic and speaker audio using dshow. I have tried using the following command but it doesn't work:

ffmpeg -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)" -f dshow -i audio="Microphone Array (Creative VF0800)" -f gdigrab -framerate 10 -video_size 1920x1080 -draw_mouse 1 -i desktop screen.avi

It only captures audio from the first mentioned audio device. Am I missing some options in the above command?

putuyuwono
  • 101
  • 1
  • 6

2 Answers2

3

Finally, I figured out that I need to merge the two audio streams. I used amerge to combine those two streams into one and map them to the output. Here is a fully functional script which is able to do the task that I want.

ffmpeg -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)" -f dshow -i audio="Microphone Array (Creative VF0800)" -f gdigrab -framerate 10 -video_size 1920x1080 -draw_mouse 1 -i desktop -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map 2 -map "[a]" screen.avi
putuyuwono
  • 101
  • 1
  • 6
1

In this case, you have to expressly map all needed streams, as the auto mapping will only pick up one audio stream. So,

ffmpeg -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)"
       -f dshow -i audio="Microphone Array (Creative VF0800)"
       -f gdigrab -framerate 10 -video_size 1920x1080 -draw_mouse 1 -i desktop
       -map 2 -map 0 -map 1 screen.avi
Gyan
  • 38,955