An openframeworks addon that allow to create virtual camera
This module use this lib: lbv4l2cpp
- Install v4l2loopback
- Create a virtual device
sudo modprobe v4l2loopback card_label="myCamNameHere" exclusive_caps=1
- Clone this repo
cd /yourOfPath/addons
git clone https://github.com:Robotechnic/ofxV4l2loopback.git --recurse-submodules -j8
- Include module in your project
- Whith qt:
Just add ofxV4l2loopback in addons:
of.addons: [
'ofxV4l2loopback'
]
- With project generator:
Add ofxV4l2loopback in addons.make file
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 |
Then, you just need to update cam render at each frames:
virtualcam.update(pixels)
parameter | usage |
---|---|
pixels | ofPixel that contain your frame |