scripts/rec: use hardware acceleration
This commit is contained in:
parent
fa05048e6e
commit
c8b37c7b04
16
scripts/rec
16
scripts/rec
@ -1,19 +1,17 @@
|
|||||||
#!/usr/bin/env fish
|
#!/bin/sh
|
||||||
|
|
||||||
function record
|
record() {
|
||||||
sleep 2
|
sleep 2
|
||||||
withcap sys_admin -- ffmpeg -f alsa -i recorder \
|
withcap sys_admin -- ffmpeg -f alsa -i recorder \
|
||||||
-vaapi_device /dev/dri/renderD128 -f kmsgrab -i - -r 60 \
|
-vaapi_device /dev/dri/renderD128 -f kmsgrab -i - -r 60 \
|
||||||
-vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' \
|
-vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' \
|
||||||
-c:v hevc_vaapi -qp 21 \
|
-c:v hevc_vaapi -qp 21 \
|
||||||
-c:a libopus -b:a 96k -ac 2 -ar 48000 \
|
-c:a libopus -b:a 96k -ac 2 -ar 48000 \
|
||||||
-y recording.mkv >/dev/null 2>&1 &
|
-y recording.mkv >/dev/null 2>&1
|
||||||
end
|
}
|
||||||
|
|
||||||
if test ! -f recording.mkv
|
if test ! -f recording.mkv; then
|
||||||
set -xU AUDIO_OUT record
|
record &
|
||||||
record
|
|
||||||
else
|
else
|
||||||
set -xU AUDIO_OUT
|
|
||||||
pkill ffmpeg
|
pkill ffmpeg
|
||||||
end
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user