https://github.com/alexeykarnachev/v4l2_gl_filter
OpenGL filter for v4l2 virtual camera device
https://github.com/alexeykarnachev/v4l2_gl_filter
opengl v4l2 v4l2loopback webcam
Last synced: about 1 month ago
JSON representation
OpenGL filter for v4l2 virtual camera device
- Host: GitHub
- URL: https://github.com/alexeykarnachev/v4l2_gl_filter
- Owner: alexeykarnachev
- License: mit
- Created: 2023-07-21T21:31:58.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-29T09:57:10.000Z (almost 3 years ago)
- Last Synced: 2023-07-29T11:48:31.827Z (almost 3 years ago)
- Topics: opengl, v4l2, v4l2loopback, webcam
- Language: Rust
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# V4L2 OpenGL Filter
A simple application of the OpenGL shader to the Linux video device (webcamera)
## Quick Start
1. Install [v4l2loopback](https://wiki.archlinux.org/title/V4l2loopback) - the Linux kernel module for creation virtual webcamera devices
2. Create virtual device:
```bash
sudo modprobe v4l2loopback
```
3. Build and run the applicatoin:
```bash
cargo build --release && ./target/release/v4l2_gl_filter /dev/video0 /dev/video2
```
In your case the device ids (`video0`, `video2`) may differ. Select the appropriate ones (the first device is your main camera, the second one is your virtual camera, created by v4l2loopback module)
4. Now you can select the virtual camera in any streaming application (e.g Zoom)

## Custom shader
You can implement your custom fragment shader which will be applied to each video frame. [filter.frag](./shaders/filter.frag) provides the default implementation. Modify it as you need and rebuild the apllication.