diff --git a/.basescripts/utilities/screen_recorder.sh b/.basescripts/utilities/screen_recorder.sh index c2555eb..6b8ecc2 100755 --- a/.basescripts/utilities/screen_recorder.sh +++ b/.basescripts/utilities/screen_recorder.sh @@ -1,19 +1,21 @@ #/bin/sh +# Adjust the GPU encoding with -c:v hevc_amf +# To see the list of available encoders: ffmpeg -encoders | grep -E "h264|hevc" + PIDFILE="/tmp/screen_recorder.pid" mkdir -p ~/Videos -# if pkill -0 ffmpeg 2>/dev/null; then - if [ -f "$PIDFILE" ]; then kill -2 "$(cat "$PIDFILE")" rm "$PIDFILE" else ffmpeg -nostdin -hide_banner -loglevel quiet -nostats \ - -f x11grab -framerate 30 -i :0.0 -f pulse \ + -f x11grab -framerate 24 -i :0.0 -f pulse \ -i alsa_output.pci-0000_00_1f.3.analog-stereo.monitor \ - -c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p -c:a aac \ - -b:a 192k ~/Videos/$(date +%Y%m%d_%H%M%S).mp4 & + -c:v hevc_amf -c:v libx264 -preset ultrafast -crf 28 \ + -pix_fmt yuv420p -c:a aac -b:a 128k \ + ~/Videos/$(date +%Y%m%d_%H%M%S).mp4 & echo $! > "$PIDFILE" fi