]> git.sesse.net Git - ffmpeg/commit
avdevice/xcbgrab: Add select_region option
authorOmar Emara <mail@OmarEmara.dev>
Sat, 11 Jul 2020 09:29:09 +0000 (11:29 +0200)
committerAndriy Gelman <andriy.gelman@gmail.com>
Sat, 7 Nov 2020 04:25:13 +0000 (23:25 -0500)
commit04b37b5d7fcd5ffd141054177611d5168629e4ac
treea426e7e66baecc55ec8086686c92f471a0b1e31a
parentc8101aabee654f6d147a4d89f77fa73e18908610
avdevice/xcbgrab: Add select_region option

This patch adds a select_region option to the xcbgrab input device.
If set to 1, the user will be prompted to select the grabbing area
graphically by clicking and dragging. A rectangle will be drawn to
mark the grabbing area. A single click with no dragging will select
the whole screen. The option overwrites the video_size, grab_x, and
grab_y options if set by the user.

For testing, just set the select_region option as follows:

ffmpeg -f x11grab -select_region 1 -i :0.0 output.mp4

The drawing happens directly on the root window using standard rubber
banding techniques, so it is very efficient and doesn't depend on any
X extensions or compositors.

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Omar Emara <mail@OmarEmara.dev>
doc/indevs.texi
libavdevice/xcbgrab.c