### Camera Class Initialization Source: https://letmaik.github.io/pyvirtualcam Initializes a new virtual camera instance with specified dimensions, frame rate, and backend settings. ```APIDOC ## pyvirtualcam.Camera ### Description Initializes a virtual camera device for streaming frames. ### Parameters #### Constructor Arguments - **width** (int) - Required - Frame width in pixels. - **height** (int) - Required - Frame height in pixels. - **fps** (float) - Required - Target frame rate in frames per second. - **fmt** (PixelFormat) - Optional - Input pixel format (default: PixelFormat.RGB). - **device** (str) - Optional - The virtual camera device to use. - **backend** (str) - Optional - The virtual camera backend to use. - **print_fps** (bool) - Optional - Print frame rate every second. ``` -------------------------------- ### Camera Constructor Parameters Source: https://letmaik.github.io/pyvirtualcam Parameters available when initializing a Camera object. ```APIDOC ## Camera Constructor ### Parameters #### Keyword Arguments - **device** (`Optional[str]`) - Optional - If given, name of the virtual camera device to use, otherwise any available device can be used. Depending on the operating system, this is typically a device file name or a camera name as it appears in apps. If a device name is given then the specified device must be used or an exception raised if the device is unavailable. If no device name is given (`None`) and no device is available then an exception must be raised. - **kw** - Extra keyword arguments passed through from user code. ``` -------------------------------- ### pyvirtualcam.Backend Class Source: https://letmaik.github.io/pyvirtualcam/_sources/index.rst.txt Documentation for the Backend class, which serves as a base class for virtual camera backends. ```APIDOC ## pyvirtualcam.Backend Class ### Description Base class for implementing virtual camera backends. ### Members This class provides methods and attributes for backend implementations. Refer to the source for specific details. ``` -------------------------------- ### pyvirtualcam.register_backend Function Source: https://letmaik.github.io/pyvirtualcam/_sources/index.rst.txt Documentation for the register_backend function, used to register a custom backend for PyVirtualCam. ```APIDOC ## pyvirtualcam.register_backend Function ### Description Registers a custom backend implementation with PyVirtualCam. ### Parameters Refer to the source code for detailed parameter information. ``` -------------------------------- ### pyvirtualcam.Camera Class Source: https://letmaik.github.io/pyvirtualcam/_sources/index.rst.txt Documentation for the Camera class, which represents a virtual camera device. ```APIDOC ## pyvirtualcam.Camera Class ### Description Represents a virtual camera device that can be used by applications. ### Members This class has members related to camera properties and operations. Refer to the source for specific method and attribute details. ``` -------------------------------- ### Backend Registration Source: https://letmaik.github.io/pyvirtualcam Allows for the registration of custom backend implementations. ```APIDOC ## pyvirtualcam.register_backend(name, clazz) ### Description Registers a new backend implementation for use with the Camera class. ### Parameters - **name** (str) - Required - Name of the backend. - **clazz** (class) - Required - Class type of the backend conforming to Backend. ``` -------------------------------- ### Camera Class Methods Source: https://letmaik.github.io/pyvirtualcam This section details the core methods of the Camera class for managing virtual camera devices. ```APIDOC ## Camera.close() ### Description Releases any resources associated with the virtual camera device. This method is guaranteed to be called exactly once. After this method was called, no further methods are called. ### Method `close` ### Endpoint N/A (Class Method) ### Parameters None ### Request Example None ### Response None ## Camera.device() ### Description Returns the name of the virtual camera device in use. If `device` was not `None` in the constructor, then the returned value must match the constructor argument. ### Method `device` ### Endpoint N/A (Class Method) ### Parameters None ### Return Type `str` ### Response Example `"/dev/video0"` ## Camera.native_fourcc() ### Description Returns the libyuv FourCC code of the native pixel format used in the backend. Must be one of the codes in the `PixelFormat` enum, or `None` if no matching code is defined or the value for some other reason is not available or sensible. This does not necessarily correspond to all the formats that the device supports when a program captures from it, which is typical on Windows. Rather it is an indication on whether any pixel format conversions have to be done in the backend itself before sending the frame to the camera device. ### Method `native_fourcc` ### Endpoint N/A (Class Method) ### Parameters None ### Return Type `Optional[int]` ### Response Example `1935963441` (Example FourCC code) ## Camera.send(_frame_) ### Description Send the given frame to the camera device. ### Method `send` ### Endpoint N/A (Class Method) ### Parameters #### Request Body - **frame** (`ndarray`) - Required - A 1D C-contiguous uint8 numpy array corresponding to the chosen pixel format and frame width and height. ### Request Example ```python import numpy as np # Assuming 'camera' is an instance of the Camera class # and 'frame_data' is a numpy array with appropriate dimensions and format frame_data = np.zeros((480, 640, 3), dtype=np.uint8) camera.send(frame_data) ``` ### Response None ``` -------------------------------- ### Camera Methods Source: https://letmaik.github.io/pyvirtualcam Methods for controlling the camera stream and resource management. ```APIDOC ## Camera Methods ### send(frame) Sends a frame to the virtual camera device. - **frame** (ndarray) - Required - Frame to send. Shape must match the chosen PixelFormat. ### sleep_until_next_frame() Adaptively sleeps until the next frame is due to maintain the target frame rate. ### close() Manually frees resources associated with the camera device. ``` -------------------------------- ### pyvirtualcam.PixelFormat Enum Source: https://letmaik.github.io/pyvirtualcam/_sources/index.rst.txt Documentation for the PixelFormat enumeration, used to specify the pixel format of the virtual camera. ```APIDOC ## pyvirtualcam.PixelFormat Enum ### Description Enumeration defining the available pixel formats for the virtual camera. ### Members This enum includes members representing different pixel formats. Refer to the source for specific enum values. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.