https://github.com/mycrl/vcam
windows virtual camera.
https://github.com/mycrl/vcam
camera virtual-camera windows
Last synced: 8 months ago
JSON representation
windows virtual camera.
- Host: GitHub
- URL: https://github.com/mycrl/vcam
- Owner: mycrl
- License: gpl-3.0
- Created: 2022-09-08T09:33:17.000Z (over 3 years ago)
- Default Branch: release
- Last Pushed: 2022-09-08T10:05:41.000Z (over 3 years ago)
- Last Synced: 2024-11-07T10:31:26.853Z (over 1 year ago)
- Topics: camera, virtual-camera, windows
- Language: C++
- Homepage:
- Size: 95.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Windows virtual Camera
Virtual camera plugin, divided into COM components and caller dll and provides Node.Js native modules.
## Build
first generate the visual studio project file through cmake:
```bash
cd virtual.camera
mkdir build
cd build
cmake ..
```
open the project file in the build directory to generate the dll.
### Node.js Napi Module
prerequisites, Node.Js 16.x version and Pyhton environment are required.
```bash
npm install
npm install -g node-gyp
node-gyp configure build
```
## Usage
register com component:
```bash
cd virtual.camera
./install.bat
```
output empty frame:
```c
#include "client.h"
#include "windows.h"
int main()
{
NV12Layout layout = get_nv12_layout(1920, 1080);
uint8_t* frame_buf = (uint8_t*)malloc(sizeof(uint8) * layout.size);
if (frame_buf == NULL)
{
return -1;
}
VCam* vcam = vcam_open();
if (vcam == NULL)
{
return -1;
}
if (vcam_start(vcam, 1920, 1080) != 0)
{
return -1;
}
for (;;)
{
Sleep(1000 / 30);
if (vcam_write_frame(vcam, frame_buf) != 0)
{
return -1;
}
}
}
```
## License
[GPL](./LICENSE)
Copyright (c) 2020 Mr.Panda.