The accepted answer did not work for me. Here's what did.
The problem is you're missing the v4l2 library, or Video4Linux2. But you can't install v4l2, because you're missing the kernel headers for your linux version. Now if you're like me you're wondering, shouldn't something called "kernel headers" come preinstalled? That is a great question. I don't know the answer.
1. Install from PPA
First, you need to have installed OBS from the PPA. Uninstall whatever OBS you're running (remove and purge as required by your package manger) and install thus:
sudo apt-add-repository ppa:obsproject/obs-studio
sudo apt-get update
sudo apt-get install ffmpeg obs-studio
ffmpeg, so don't miss this)
2. Install Kernel Headers
Next, install your kernel headers. To find your kernel headers, run:
apt search linux-headers-$(uname -r)
In my case, the output looked like this
Full Text Search... Done
linux-headers-5.19.0-76051900-generic/jammy 5.19.0-76051900.202207312230~1663791054~22.04~28340d4 amd64 [upgradable from: 5.19.0-76051900.202207312230~1660780566~22.04~9d60db1]
Linux kernel headers for version 5.19.0 on 64 bit x86 SMP
In my case, my headers are called linux-headers-5.19.0-76051900-generic So:
sudo apt install <your headers>
Then you can install the library
sudo apt install v4l-utils v4l2loopback-utils v4l2loopback-dkms
Reboot and open OBS. You should see the virtual camera button appear. Click the button and look for the virtual camera in wherever source you're streaming to.