OBS Studio: Difference between revisions
→Using the Virtual Camera: Adding a note on how to modify your v4l2loopback module config to have additional virtual devices such as you might use to use a DSLR as a webcam with gphoto2 |
m Added information about the OBS module added to NixOS in 24.11. |
||
| Line 5: | Line 5: | ||
Plugins are available from the <code>obs-studio-plugins</code> package set. | Plugins are available from the <code>obs-studio-plugins</code> package set. | ||
They can be installed by either | They can be installed by using either the [[NixOS]] or [[Home Manager]] module: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ config, pkgs, ... }: | |||
{ | |||
programs.obs-studio = { | |||
enable = true; | |||
plugins = with pkgs.obs-studio-plugins; [ | plugins = with pkgs.obs-studio-plugins; [ | ||
wlrobs | wlrobs | ||
| Line 15: | Line 17: | ||
obs-pipewire-audio-capture | obs-pipewire-audio-capture | ||
]; | ]; | ||
} | }; | ||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
or | or by wrapping the package with <code>wrapOBS</code>: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
environment.systemPackages = [ | |||
(pkgs.wrapOBS { | |||
plugins = with pkgs.obs-studio-plugins; [ | plugins = with pkgs.obs-studio-plugins; [ | ||
wlrobs | wlrobs | ||
| Line 31: | Line 31: | ||
obs-pipewire-audio-capture | obs-pipewire-audio-capture | ||
]; | ]; | ||
}; | }) | ||
]; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 39: | Line 39: | ||
=== Using the Virtual Camera === | === Using the Virtual Camera === | ||
The virtual camera requires the <code>v4l2loopback</code> [[Linux kernel#Custom kernel modules|kernel module]] to be installed, a loopback device configured, and polkit enabled so OBS can access the virtual device | The virtual camera requires the <code>v4l2loopback</code> [[Linux kernel#Custom kernel modules|kernel module]] to be installed, a loopback device configured, and polkit enabled so OBS can access the virtual device. | ||
<syntaxhighlight lang="nix"> | This can be done in NixOS with:<syntaxhighlight lang="nixos"> | ||
programs.obs-studio.enableVirtualCamera = true; | |||
</syntaxhighlight>Or by setting the kernel options manually, this is useful if you need to add an additional loopback device as shown below:<syntaxhighlight lang="nix"> | |||
{ config, ... }: | { config, ... }: | ||
{ | { | ||