3 save_at
="/mnt/data/recorded_screen"
4 time_date
=$
(date +'%Y_%m_%d_%H_%M_%S')
7 hide_mouse
="-draw_mouse 0"
8 encoding
="libx264 -preset ultrafast"
10 ms
=$
(xrandr |
grep -w connected |
awk -F'[ \+]' '{print $4}')
11 mh
=$
(echo "$ms" |
awk -Fx '{print $1}')
12 mw
=$
(echo "$ms" |
awk -Fx '{print $2}')
13 hms
="$(( $mh / 2))x$mw"
14 is_running
=$
(pgrep
-f "ffmpeg -f" |
wc -l)
16 [ -d "$save_at" ] || mkdir
"$save_at"
17 [ $fullscreen -eq 1 ] && monitor_size
=$ms || monitor_size
=$hms
19 if [ "$is_running" -eq 0 ]; then
20 ffmpeg
-f x11grab
-video_size $monitor_size -framerate $frate \
21 $hide_mouse -i $DISPLAY -c:v
$encoding $save_at/$time_date.mkv