Comments (5)
Hi @tshino,
you're amazing. It works like a charm!
Thank you so much for your help!
from softcam.
Hi, thank you for your interest and effort!
Actually, I have some experience with pybind11 in other projects, I'm sure that you are going in the right direction.
Since in python we are likely using a Numpy array to hold an image, you can use py::array_t<uint8_t>
to pass the image to C++.
Since the element order (like row/column major) of a Numpy array can be different from the softcam's expectation, py::array::c_style
option would be useful to avoid costly memory copy and to ensure you can safely pass the pointer to softcam.
Maybe I can do the whole thing to create a python bind of softcam, by just taking half a day, and I'm happy to do that.
So, I don't want to take your work, but if you are okay, I will do that.
Anyway, thanks for the great idea!
from softcam.
Hi @tshino,
if you are really willing to do that, that'd be amazing! I'm not that experienced with Visual Studio and C++, hence my frustration.
Let me know if I could be of any assistance and thanks for your help!
Kind regards
Kev
from softcam.
Hi @kevinpl07,
I've just made it and it is already working!
The code is in the branch for #13, so you can try it now.
Steps to build:
- run
DownloadPybind11.bat
. - activate your target Python environment in Command Prompt.
- run
LaunchVisualStudio.bat
in the environment. - on Visual Studio, build solution with Release|x64 configuration.
- copy
softcam.pyd
andsoftcam.dll
to an appropriate directory. - in python, you can
import softcam
!
I will write a detailed instruction like above as well as sample python code to use it.
from softcam.
Thank you again for your post!
That made this library more valuable.
from softcam.
Related Issues (20)
- How to use this library to make two or more virtual webcams on Windows? HOT 3
- Add CI build and test of python_binding example HOT 1
- Default image when there is no input HOT 4
- Image colors are not correct HOT 2
- Let us to set our custom device name HOT 3
- Package manager HOT 1
- Add 32-bit support HOT 1
- Is it possible to set resolution for the output? HOT 1
- could it add a convert function() which make input is a Mat format HOT 1
- Issues with the 32 bit support HOT 5
- Suggestion: support multiple virtual cameras with different parameters HOT 2
- Add VS2022 project files HOT 1
- Softcam doesn't appear in camera list on discord HOT 3
- VS2022 Build Error HOT 1
- Different Video Formats? HOT 3
- Add audio pin? HOT 2
- Add hardware ID into device info? HOT 2
- Mac version? Example problem HOT 5
- Changing dll name that is searched for HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from softcam.