xrectdraw

Draw geometry of a rectangular screen region
git clone git://git.noxz.tech/xrectdraw
Log | Files | Refs | README | LICENSE

screenrec.sh (705B)


      1 #!/bin/sh
      2 
      3 # use xrectsel to define region
      4 geo=$(xrectsel "%x %y %w %h")
      5 
      6 # record region on screen using backgrounded ffmpeg
      7 ffmpeg                                                                      \
      8     -video_size $(echo $geo | awk {'print $3 "x" $4'})                      \
      9     -framerate 25                                                           \
     10     -f x11grab                                                              \
     11     -i $(echo $geo | awk {'print ":0.0+" $1 "," $2'})                       \
     12     -y output.mkv &
     13 
     14 # store ffmpeg pid
     15 ffmpeg_pid=$!
     16 
     17 # run xrectdraw to indicate region being recorded
     18 xrectdraw $geo \#ff0000 2:2:5:2
     19 
     20 # when xrectdraw dies kill ffmpeg
     21 kill $ffmpeg_pid