Module src.streaming.io.webcam_writer
Module for writing to a virtual webcam that can be used anywhere.
This module only runs on linux machines as it requires that the external v4l2loopback-utils package is installed and that the v4l2loopback driver is inserted into the kernel. This also means the begin and end methods are empty and just pass.
Classes
class WebcamWriter (interface: int, res: Tuple[int, int])-
An instance is made with a webcam interface number and resolution.
Looks for v4l2loopback devcies on /dev/videoN, where N is the interface number
Contains methods for starting and stopping video output and a method that takes in a image and writes it as a frame in videobuffer.
Methods
def write(self, img: numpy.ndarray) ‑> NoneType-
Writes image to videobuffer
Takes input image, mirrors it and writes it to loopback device
Args
img- image buffer as numpy ndarray.