← Back

ofxV4l2loopback

github.com/Robotechnic/ofxV4l2loopback · @Robotechnic
OF 0.11 Video/Camera Linux

Creates a virtual camera on Linux via the v4l2loopback kernel module, pushing rendered frames into it.

1 0 Last commit 5y ago Created 5y ago

README

ofxV4l2loopback



An openframeworks addon that allow to create virtual camera

This module use this lib: lbv4l2cpp

Intalation



1. Install v4l2loopback

⚠️ You must install kernel headers to do that because v4l2loopback is a kernel module

2. Create a virtual device
sudo modprobe v4l2loopback card_label="myCamNameHere" exclusive_caps=1


3. Clone this repo
cd /yourOfPath/addons
git clone https://github.com:Robotechnic/ofxV4l2loopback.git --recurse-submodules -j8


4. Include module in your project

Whith qt:

Just add ofxV4l2loopback in addons:
of.addons: [
    'ofxV4l2loopback'
]


With project generator:

Add ofxV4l2loopback in addons.make file

Usage

Firs, you need to init the camera:
ofxV4l2loopback virtualcam;
virtualcam.setup(width,height,device,fps);
parameterusage
widthvirtual device width
heightvirtual device height
devicedevice number (Exemple: /dev/video1)
fpsfps of device
Then, you just need to update cam render at each frames:

virtualcam.update(pixels)
parameterusage
pixelsofPixel that contain your frame


Examples



https://github.com/Robotechnic/live_ascii_video

Get this addon

HTTPS
SSH