ldenoue / cameraextension Goto Github PK
View Code? Open in Web Editor NEWsample camera extension using coremedia io
License: MIT License
sample camera extension using coremedia io
License: MIT License
Hi,
From my understanding cameraextension , as its name suggests, is the one that handles low level stuff and I don't need to make changes on this part. My problem is I simply want to read a video frame by frame and push them to virtual camera. However, I need to do this because in C++ because I will do some operations on the frame and my framework is written in C++. I have a few questions, just to confirm:
Does cameraextension creates a virtual camera such as width, height, format etc. and has nothing to do with client side(zoom etc). It just creates a virtual camera and sends the incoming frame to whatever app wants at that moment.
The way you push the frame to virtual camera from samplecamera. Should I call enqueue function for each frame? Assume I successfully converted the code in C++ read frames from hardware camera, then after reading and operation I will call enqueue function with my result frame and it will call virtual camera and frame will be shown on the screen, cycle completed. Am I right?
I had tried several virtual cameras, the problem was they are too slow. Writing one frame takes 500ms so around 2FPS, which is terrible. Have you made any test to estimate performance..
Thanks a lot!
Halil
I've been hammering on my own camera extension for a few months now and the example I was using (which I think was based on your example here) uses DispatchSource.makeTimerSource() to schedule this 3 times every frame instead of calling it continuously.
Your method appeals to me as it feels less hit and miss than polling every few milliseconds and hoping for the best, but it does seem to hike up the CPU usage.
I'm wondering if you've found the same thing and moved on from this way of polling the sample buffer or if there's something I don't know?
Thanks, I really appreciate you putting up this minimal sample - the documentation on this subject is SO thin on the ground! (Will we ever get our promised sample project?? seems unlikely at this point!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.