tweaked vaapi driver

This commit is contained in:
fwastring 2026-03-29 15:20:18 +02:00
parent 966970c256
commit e413d301f6
2 changed files with 21 additions and 0 deletions

View file

@ -25,6 +25,7 @@ let
useVaapi = cfg.useVaapi;
vaapiDevice = cfg.vaapiDevice;
vaapiQp = cfg.vaapiQp;
vaapiDriver = cfg.vaapiDriver;
};
};
@ -99,6 +100,11 @@ in
default = 24;
description = "VAAPI quality parameter (lower means better quality, higher CPU/bitrate).";
};
vaapiDriver = mkOption {
type = types.nullOr types.str;
default = null;
description = "Optional LIBVA_DRIVER_NAME value (for example iHD).";
};
streams = mkOption {
type = types.attrsOf (
types.submodule {
@ -166,6 +172,11 @@ in
default = 24;
description = "VAAPI quality parameter for h264_vaapi.";
};
vaapiDriver = mkOption {
type = types.nullOr types.str;
default = null;
description = "Optional LIBVA_DRIVER_NAME value (for example iHD).";
};
};
}
);
@ -209,6 +220,7 @@ in
Type = "simple";
Restart = "always";
RestartSec = "2";
Environment = optional (streamCfg.vaapiDriver != null) "LIBVA_DRIVER_NAME=${streamCfg.vaapiDriver}";
ExecStart = "${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel warning -f v4l2 -framerate ${toString streamCfg.framerate} -video_size ${streamCfg.videoSize} -i ${streamCfg.device} ${videoCodecArgs} ${rateControlArgs} -f rtsp ${streamCfg.rtspUrl}";
};
}