I have found a ffmpeg command to record area of my screen:

ffmpeg -video_size 2000x1600 -framerate 25 -f x11grab -i :0.0+2140,280 output.mp4

But to find the correct area, I had to do multiple trial/error runs and it was tedious.

Is there some possibility to select area by mouse, and have it recorded by ffmpeg ?

If there is no ready made solution, how would I hack together something that works in this way?

in another post, somebody mentioned xrectsel, which prints coordinates of a rectangle selected by mouse. Is there some easier way to do this?

1 Answer 1


Slop (an application that queries for a selection from the user and prints the region to stdout) appears to be the easiest tool exactly fitting your purpose… since… it provides an example linked to ffmpeg capturing straight in its readme. ;-)

slop can be used to create a video recording script in only three lines of code.

slop=$(slop -f "%x %y %w %h %g %i") || exit 1
read -r X Y W H G ID <<< $slop
ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/myfile.webm

You must log in to answer this question.

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