For example:

ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
For example:

ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
For example, to grab the entire desktop using ffmpeg:

ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
There are two options for the input filename:

desktop
Grab a 640x480 region at position 10,20:

ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
Grab the contents of the window named "Calculator"

ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
With follow_mouse:

ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
To follow only when the mouse pointer reaches within 100 pixels to edge:

ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
For example:

ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
For example:

ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg

Recommend

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.8 gdigrab

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.7 fbdev

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.6 dshow 3.6.2 Examples

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.6 dshow

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.5 decklink 3.5.2 Examples

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.3 avfoundation 3.3.2 Examples

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.3 avfoundation

FFMPEG FFmpeg Devices Documentation 3 Input Devices 3.1 alsa

FFMPEG ffplay Documentation 3 Options 3.3 AVOptions

FFMPEG ffplay Documentation 3 Options 3.2 Generic options

FFMPEG FFmpeg Utilities Documentation 3 Expression Evaluation

FFMPEG FFmpeg Utilities Documentation 2 Syntax 2.3 Time duration

FFMPEG FFmpeg Utilities Documentation 2 Syntax 2.2 Date

FFMPEG FFmpeg Utilities Documentation 2 Syntax 2.1 Quoting and escaping 2.1.1 Examples

FFMPEG ffmpeg Documentation 6 Examples 6.3 Video and Audio file format conversion

FFMPEG ffmpeg Documentation 6 Examples 6.2 X11 grabbing

FFMPEG ffmpeg Documentation 6 Examples 6.1 Video and Audio grabbing

FFMPEG ffmpeg Documentation 5 Options 5.11 Advanced options

FFMPEG ffmpeg Documentation 5 Options 5.6 Advanced Video options

FFMPEG ffmpeg Documentation 5 Options 5.5 Video Options

FFMPEG ffmpeg Documentation 5 Options 5.4 Main options

FFMPEG ffmpeg Documentation 5 Options 5.3 AVOptions

FFMPEG ffmpeg Documentation 5 Options 5.2 Generic options

FFMPEG ffmpeg Documentation 4 Stream selection 4.2 Examples Example: labeled filtergraph outputs