I can see my video but I cannot hear some background sound. This is the command I'm using:

ffmpeg -f x11grab -video_size 1366x768 -framerate 20 -i :11 /home/userx/Desktop/out.mpg

How can I enable sound?


1 Answer 1


Pulse only:

ffmpeg -f x11grab -video_size 1366x768 -framerate 30 -i :0.0 -f pulse -i default -c:a libmp3lame -b:a 128k -c:v libx264 -preset ultrafast -crf 18 -pix_fmt yuv420p desktop-out.mkv

Pulse with ALSA:

ffmpeg -f alsa -ac 2 -i pulse -c:a libmp3lame -b:a 128k -f x11grab -r 30 -s 1366x768 -i :0.0 -aspect 16:9 -c:v libx264 -preset ultrafast -crf 18 -pix_fmt yuv420p desktop-out.mkv


Use -f oss -i /dev/dsp1 to capture sound from microphone.

Audio libraries:

mp3: libmp3lame webm: libvpx ogg: libvorbis opus: libopus aac: libfaac

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .