-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecord_screen
More file actions
executable file
·50 lines (43 loc) · 906 Bytes
/
record_screen
File metadata and controls
executable file
·50 lines (43 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# Install slop: https://github.com/naelstrof/slop
# pacman -S slop
# Run this like: ./record_screen moviename
if ! which slop 2>&1 > /dev/null
then
echo "slop not installed"
exit 1
fi
if [ -z "$1" ]
then
echo "provide output name"
exit 1
fi
eval $(slop --nodecorations --format="W=%w; H=%h; X=%x; Y=%y;")
if [ -z "$W" -o -z "$H" -o -z "$X" -o -z "Y" ]
then
exit 0
fi
echo $W $H $X $Y
# Record just the screen
exec ffmpeg \
-f x11grab \
-show_region 1 \
-framerate 60 \
-video_size "${W}x${H}" \
-draw_mouse 1 \
-i ":0.0+$X,$Y" \
-filter:v "crop=iw-mod(iw\,2):ih-mod(ih\,2)" \
-codec:v libx264 \
-preset:v fast \
-profile:v baseline \
-pix_fmt yuv420p \
-r 60 \
$1
# Record the screen and audio output
#cmd="ffmpeg \
# -f x11grab \
# -s ${W}x${H} \
# -i :0.0+${X},${Y} \
# -f pulse \
# -i bluez_sink.00_16_94_28_73_FC.a2dp_sink.monitor \
# $1"