I'm trying to record both video, speaker sounds and microphone sounds at the same time. To deal with the audio, I set up two loopbacks (one for microphone, one for speakers):
pactl load-module module-loopback pactl load-module module-loopback
pavucontrol, I redirect both loopbacks to a null-sink, which is the audio input for my ffmpeg recording script:
pactl load-module module-null-sink pavucontrol
I then start recording with the following command:
ffmpeg -f x11grab -y -r 60 -f alsa -i pulse output.mkv
Everything seems to work perfectly, for the first 20-25 seconds of
output.mkv. After that, sound becomes horribly distorted until the end of the file. Here's a similar report from another user.
Is there a way to fix/avoid the distortion?
Or, is there an alternative way to record both microphone and speakers at the same time (that doesn't cause distortion)?