From c8b37c7b04abb78feac6986738d213709a8724ff Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Thu, 9 Dec 2021 21:51:57 +0100 Subject: [PATCH] scripts/rec: use hardware acceleration --- scripts/rec | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/rec b/scripts/rec index 6a35d96..7ff30d1 100755 --- a/scripts/rec +++ b/scripts/rec @@ -1,19 +1,17 @@ -#!/usr/bin/env fish +#!/bin/sh -function record +record() { sleep 2 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 \ -c:a libopus -b:a 96k -ac 2 -ar 48000 \ - -y recording.mkv >/dev/null 2>&1 & -end + -y recording.mkv >/dev/null 2>&1 +} -if test ! -f recording.mkv - set -xU AUDIO_OUT record - record +if test ! -f recording.mkv; then + record & else - set -xU AUDIO_OUT pkill ffmpeg -end +fi