Skip to the content.

Video Capture of Screen in Linux

With System Sounds

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :1.0+0,0 -f pulse -ac 2 -i 1 -c:v libx264 `date '+%Y.%m.%d-%H.%M.%S'`.mp4


ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :1.0+0,0 -f pulse -ac 2 -i 1 -c:v libx264 -t 00:00:10 `date '+%Y.%m.%d-%H.%M.%S'`.mp4

With Microphone

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :1.0+0,0 -f pulse -ac 2 -i 2 `date '+%Y.%m.%d-%H.%M.%S'`.mp4

Audio Capture of Screen in Linux

With System Sounds

ffmpeg -f pulse -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -ac 2 `date '+%Y.%m.%d-%H.%M.%S'`.m4a

With Microphone

ffmpeg -f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo -ac 2 `date '+%Y.%m.%d-%H.%M.%S'`.m4a

NOTE: CTRL + C lets you to stop recording. NOTE: alsamixer command lets you to visually arrange sound settings.

Ref: https://www.wikihow.com/Record-Your-Desktop-Using-FFmpeg-on-Ubuntu-Linux

NOTE: If you face some problem while trying to play captured video or audio on windows, you can visit Codec Guide and download K-Lite Codec Pack Mega on your computer which will most probably solve your problem.