Sway: Limit screen rec cpu usage to half the cores.

This commit is contained in:
Dmitry Voronin 2024-12-24 09:11:42 +03:00
parent 7e1502dae3
commit 011fc516e0
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -102,6 +102,7 @@ let
--framerate ${toString framerate} \
--file "''${scrFile}" \
--pixel-format "${pixfmt}" \
--codec-param "lp=$(($(cat /proc/cpuinfo | grep ^processor | wc -l) / 2))" \
--geometry "''${scrSelection}"
'';
@ -112,6 +113,7 @@ let
-c:v ${codec} \
-pix_fmt ${pixfmt} \
-f ${container} \
-svtav1-params "lp=$(($(cat /proc/cpuinfo | grep ^processor | wc -l) / 2))" \
"''${scrFile}_" \
&& mv "''${scrFile}_" "''${scrFile}" \
|| rm "''${scrFile}_"