Recording speaker audio using avconv

I'm having some problems recording the audio from my speakers using avconv.

This is the command I type into the terminal:

avconv -f alsa \
       -i pulse -f x11grab -r 30 -s 1920*1080 \
       -i :0.0 \
       -vcodec libx264 -preset ultrafast \
       -ab 320k -threads 8 \
       screen.mkv

THE PROBLEM: avconv is recording the speaker audio and my microphone audio, however the speaker audio is extremely low. I've tried playing around with all of my audio/volume levels and I can't seem to get avconv to pickup the speaker audio better.

Is there an option for the avconv command that is for speaker audio?

Please do not reply with "use gtk-recordMyDesktop" or "kazam", i find avconv much more convenient.

Any help is appreciated, thanks!


The info is in the man pages for avconv. In my version (probably the same as yours) I found it in the chapter on "Input Devices", in the section "pulse", on line 1854.

Type in:

$ pactl list sources | less

You'll see info on "Source #0", "Source #1" etc. depending how how many sound cards and whatnot you have.

Get the string under "Name:", it will be something like:

alsa_output.pci-[some number].analog-stereo.monitor

where "some number" is dependent on your hardware.

Instead of demuxing using alsa directly (avconv ... -f alsa ...) as you've tried to do above, use pulse instead:

avconv ... -f pulse -i alsa_output.pci-....analog-stereo.monitor ...

This will record the audio being monitored and passed to the speakers or headphones or whereever. If you wish to use pulse to demux and record the microphone, use the other "Name:" (or one of the other names) which doesn't include the word "monitor".

I hope it helps.


Install pavucontrol package. Open the PulseAudio Volume Control application from the dash.

On the Input Devices tab, go down and choose All Input Devices. Then, press the button with a check mark on it next to the device named "Monitor of... (your device name)". The pulse Input Device is now whatever goes through the speakers.

enter image description here

The settings you're currently using on avconv should be OK for this to work properly.


The speaker volume is soft because it's recording it through your mic. Did you ever find a way to record both together? I'm having the same issue. I wear headphones to play and the sound would be a lot better that way as well... not familiar enough with pulse to know what to change :-/