Sway: Simplify codec params.

This commit is contained in:
Dmitry Voronin 2024-12-26 11:39:22 +03:00
parent 732fbbf885
commit aa40735236
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -11,22 +11,19 @@ let
keyboardLayouts = config.module.keyboard.layouts;
keyboardOptions = config.module.keyboard.options;
alpha = config.module.style.opacity.hex;
accent = config.module.style.color.accent + alpha;
alpha = config.module.style.opacity.hex;
border = config.module.style.color.border + alpha;
borderSize = config.module.style.window.border;
fg = config.module.style.color.fg.light;
opacity = "26";
selection = with config.module.style.color; "slurp -d -b ${bg.light}${opacity} -c ${fg.light} -w 0 -s 00000000";
wallpaper = config.module.wallpaper.path;
windowGap = config.module.style.window.gap;
codec = "libsvtav1";
color = config.module.style.color;
container = "mp4";
format = "%Y-%m-%d_%H-%M-%S";
framerate = 30;
opacity = "26";
pixfmt = "yuv420p10le";
selection = "slurp -d -b ${color.bg.light}${opacity} -c ${color.fg.light} -w 0 -s 00000000";
notifyStart = ''swayscript notify_short'';
notifyEnd = ''swayscript notify_long'';
@ -84,13 +81,11 @@ let
--codec h264_vaapi \
--device /dev/dri/renderD128 \
--no-damage \
--framerate ${toString framerate} \
--file "''${scrFile}" \
-o $(swaymsg -t get_outputs | jq -r ".[] | select(.focused) | .name") - ||
wf-recorder \
--codec libx264 \
--no-damage \
--framerate ${toString framerate} \
--file "''${scrFile}" \
-o $(swaymsg -t get_outputs | jq -r ".[] | select(.focused) | .name") -
'';
@ -99,9 +94,7 @@ let
wf-recorder \
--codec ${codec} \
--no-damage \
--framerate ${toString framerate} \
--file "''${scrFile}" \
--pixel-format "${pixfmt}" \
--codec-param "lp=$(($(cat /proc/cpuinfo | grep ^processor | wc -l) / 2))" \
--geometry "''${scrSelection}"
'';
@ -111,7 +104,6 @@ let
ffmpeg \
-i "''${scrFile}" \
-c:v ${codec} \
-pix_fmt ${pixfmt} \
-f ${container} \
-svtav1-params "lp=$(($(cat /proc/cpuinfo | grep ^processor | wc -l) / 2))" \
"''${scrFile}_" \