Accelerated Video Playback: Difference between revisions
m The option `hardware.opengl.enable' defined in `/etc/nixos/configuration.nix' has been renamed to `hardware.graphics.enable'. |
m Add Gentoo Wiki VAAPI Page on Also see. |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 46: | Line 46: | ||
{ | { | ||
hardware.graphics.enable = true; | hardware.graphics.enable = true; | ||
} | |||
</nowiki>}} | |||
<translate> | |||
=== NVIDIA === <!--T:23--> | |||
<!--T:24--> | |||
NVIDIA do not officially support accelerated video playback on Linux. A third-party implementation exists, but does not support Chrome<ref>https://github.com/elFarto/nvidia-vaapi-driver#chrome</ref>, and has significant limitations compared to the other implementations<ref>https://github.com/elFarto/nvidia-vaapi-driver#codec-support</ref>. | |||
<!--T:25--> | |||
NVIDIA users with a separate iGPU should generally prefer to use their iGPU for this, and therefore look to the above Intel and AMD sections instead. | |||
<!--T:26--> | |||
Users with only an NVIDIA GPU can attempt to use the third party implementation; the package is added to <code>hardware.graphics.extraPackages</code> by default, but it requires some additional setup to be useful<ref>https://github.com/elFarto/nvidia-vaapi-driver#configuration</ref>: | |||
</translate> | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ config, lib, ...}: { | |||
environment.variables.LIBVA_DRIVER_NAME = "nvidia" | |||
# If used with Firefox | |||
environment.variables.MOZ_DISABLE_RDD_SANDBOX = "1"; | |||
programs.firefox.preferences = let | |||
ffVersion = config.programs.firefox.package.version; | |||
in { | |||
"media.ffmpeg.vaapi.enabled" = lib.versionOlder ffVersion "137.0.0"; | |||
"media.hardware-video-decoding.force-enabled" = lib.versionAtLeast ffVersion "137.0.0"; | |||
"media.rdd-ffmpeg.enabled" = lib.versionOlder ffVersion "97.0.0"; | |||
"gfx.x11-egl.force-enabled" = true; | |||
"widget.dmabuf.force-enabled" = true; | |||
# Set this to true if your GPU supports AV1. | |||
# | |||
# This can be determined by reading the output of the | |||
# `vainfo` command, after the driver is enabled with | |||
# the environment variable. | |||
"media.av1.enabled" = false; | |||
}; | |||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
<translate> | <translate> | ||
== Testing your configuration == <!--T:6--> | == Testing your configuration == <!--T:6--> | ||
| Line 82: | Line 123: | ||
<!--T:14--> | <!--T:14--> | ||
<syntaxHighlight lang=ini> | <syntaxHighlight lang=ini> | ||
hwdec=auto | hwdec=auto | ||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 97: | Line 135: | ||
== Also see == | == Also see == | ||
* [https://wiki.archlinux.org/index.php/Hardware_video_acceleration Arch Linux wiki#Hardware video acceleration]. | * [https://wiki.archlinux.org/index.php/Hardware_video_acceleration Arch Linux wiki#Hardware video acceleration]. | ||
* [https://wiki.gentoo.org/wiki/VAAPI Gentoo Wiki#VAAPI.] | |||
* [https://github.com/NixOS/nixos-hardware nixos-hardware] has example configurations for various types of hardware. | * [https://github.com/NixOS/nixos-hardware nixos-hardware] has example configurations for various types of hardware. | ||
</translate> | </translate> | ||
[[Category:Video]] | [[Category:Video]] | ||