Record your Linux desktop from the command line

By | January 20, 2011

If you do not wish to install a dedicated application for recording your desktop, you can do it with this one-liner:

ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /home/user/out.mpg

All you need is have ffmpeg already installed (and most systems do). Navigate to /home/user and you’ll find you MPEG video file there.

2 thoughts on “Record your Linux desktop from the command line

  1. SergioJP

    This command writes video only, if you want to add audio recording.
    oss-i / dev/dsp0
    oss-i / dev/dsp1

    depending on your audio configuration.
    For me works with dsp1.

    Sorry my English.

  2. RDB

    ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /home/mintylinux/

    It works, I changed it to mov file as mpg had buffer errors.

    SergioJP I would like to use the audio option, but I’m not sure how to input it into command line. Every time I try I just get weird errors and doesn’t work. Like this
    “[x11grab @ 0x9e31aa0] Could not open X display.
    oss-i: Input/output error”


Leave a Reply

Your email address will not be published. Required fields are marked *