enable hardware encode/decode

This commit is contained in:
zuckerberg 2021-09-09 11:28:30 -04:00
parent 0af3855f26
commit 7c7ae6698d
3 changed files with 17 additions and 2 deletions

View File

@ -33,6 +33,7 @@ in {
Domain radio is hosted on Domain radio is hosted on
''; '';
}; };
enableVideoAcceleration = lib.mkEnableOption "enable video acceleration";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -70,4 +71,17 @@ in {
''; '';
}; };
}; };
# hardware accelerated video encoding/decoding (on intel)
nixpkgs.config.packageOverrides = lib.mkIf cfg.enableVideoAcceleration pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
hardware.opengl = lib.mkIf cfg.enableVideoAcceleration {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965
];
extraPackages32 = with pkgs.pkgsi686Linux; [ vaapiIntel ];
};
} }

4
flake.lock generated
View File

@ -98,8 +98,8 @@
}, },
"nixpkgs-peertube": { "nixpkgs-peertube": {
"locked": { "locked": {
"lastModified": 1631196474, "lastModified": 1630887850,
"narHash": "sha256-/9EnOH/pNgFR2sWdTQ954abxWVQHE5vlYY5js71vFi8=", "narHash": "sha256-VcVFlhVuceolv1FZdle0q47tSHLRXFHCus7A9PJGUjc=",
"owner": "GoogleBot42", "owner": "GoogleBot42",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7fc03b76db3e5bf655bb3a9f5ee2f115e528944b", "rev": "7fc03b76db3e5bf655bb3a9f5ee2f115e528944b",

View File

@ -126,6 +126,7 @@ in {
services.radio = { services.radio = {
enable = true; enable = true;
host = "radio.neet.space"; host = "radio.neet.space";
enableVideoAcceleration = true;
}; };
services.nginx.virtualHosts."paradigminteractive.agency" = { services.nginx.virtualHosts."paradigminteractive.agency" = {