Creates a virtual camera on Linux via the v4l2loopback kernel module, pushing rendered frames into it.
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=13. Clone this repo
cd /yourOfPath/addons
git clone https://github.com:Robotechnic/ofxV4l2loopback.git --recurse-submodules -j84. 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);
| parameter | usage |
|---|---|
| width | virtual device width |
| height | virtual device height |
| device | device number (Exemple: /dev/video1) |
| fps | fps of device |
virtualcam.update(pixels) | parameter | usage |
|---|---|
| pixels | ofPixel that contain your frame |
Examples
https://github.com/Robotechnic/live_ascii_video
ofxAddons