misc/scripts/rec

20 lines
461 B
Plaintext
Raw Normal View History

2021-07-27 17:49:48 +02:00
#!/usr/bin/env fish
2020-07-22 14:43:23 +02:00
2021-07-27 17:49:48 +02:00
function record
2020-07-22 14:43:23 +02:00
sleep 2
2021-07-27 17:49:48 +02:00
withcap sys_admin -- ffmpeg -f alsa -i recorder \
-vaapi_device /dev/dri/renderD128 -f kmsgrab -i - -r 60 \
-vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' \
-c:v hevc_vaapi -qp 21 \
2020-07-22 14:43:23 +02:00
-c:a libopus -b:a 96k -ac 2 -ar 48000 \
2021-01-04 12:45:36 +01:00
-y recording.mkv >/dev/null 2>&1 &
2021-07-27 17:49:48 +02:00
end
2020-07-22 14:43:23 +02:00
2021-07-27 17:49:48 +02:00
if test ! -f recording.mkv
set -xU AUDIO_OUT record
record
2020-07-22 14:43:23 +02:00
else
2021-07-27 17:49:48 +02:00
set -xU AUDIO_OUT
2020-07-22 14:43:23 +02:00
pkill ffmpeg
2021-07-27 17:49:48 +02:00
end