jvcleave / ofxRPiCameraVideoGrabber

development of ofxRPiCameraVideoGrabber, an addon to control the native Raspberry Pi camera in openFrameworks
89 stars 17 forks source link

ofxBaseVideoGrabber? #7

Closed danomatika closed 8 years ago

danomatika commented 10 years ago

Could this inherit ofxBaseVideoGrabber so it's interchangeable with ofxVideoGrabber? I usually do this with cross platform apps.

Also, how do I get access to the raw pixels? Get them out of the texture?

danomatika commented 10 years ago

Nevermind. ofTexture::readToPixels is a noop on OpenGL ES.

jvcleave commented 10 years ago

its implemented in develop - it uses an fbo

On Mar 16, 2014, at 7:05 PM, Dan Wilcox notifications@github.com wrote:

Nevermind. ofTexture::readToPixels is a noop on OpenGL ES.

Reply to this email directly or view it on GitHubhttps://github.com/jvcleave/ofxRPiCameraVideoGrabber/issues/7#issuecomment-37774575 .

danomatika commented 10 years ago

Ok. I just reorganized the develop branch as well and am diving in. Thanks

danomatika commented 10 years ago

Sorry, I can't find it. What should I be looking for?

jvcleave commented 10 years ago

weird - maybe I haven't uploaded my changes

jvcleave commented 10 years ago

ok - I am getting my addons mixed up

This addon doesn't do it internally but the shaderApp currently demos how to do it

https://github.com/jvcleave/ofxRPiCameraVideoGrabber/blob/develop/src/shaderApp.cpp

danomatika commented 10 years ago

Ah ha. Ok. I actually did get it to work using ofImage::grabScreen (uses glReadPixels internally), but an FBO would be better. I'll try that.

I'm currently adding the isFrameNew() internals since glReadPixels is slow, at least it is from the screen buffer.

jvcleave commented 10 years ago

isFrameNew is kinda tricky as the OpenMax components are a bit different in how that is determined.

It kinda turned into a philosophic question when I did attempted it before (isFrameNew? - depends who is asking and when)

I settled on that is it likely being asked by ofApp::update so I was planning on doing an ofAddListener(ofEvents().update.... against a frame counter that the addon uses internally

So the issue with that where the OMX components differences lie - a non-textured (or direct to screen) can be probed for when a frame is complete. The textured version needs to measure when the buffer is filled

It looks like I implemented it here https://github.com/jvcleave/ofxRPiCameraVideoGrabber/blob/develop/addons/ofxRPiCameraVideoGrabber/src/TextureEngine.cpp#L134

Since this callback process doesn't happen for the for the non-texture I will have to do something different. I recently found a way (at least with video files) to probe an OMX component for a frame count.

In your case (using pixels) the textured is priority anyway

danomatika commented 10 years ago

I'm basically using the commented out ofxRPiCameraVideoUpdate::udpate() with textureEngine->renderedFrameCounter. That should suffice as I just need something to keep the update CPU time down.

I'll send you info on the project when it's out. I'm basically making a sound engine generator that uses the camera and ofxPd. My friend has created these massive crystal canvases that will change color over time as the crystals grow and dry. The pi + camera + wide angle lens will be sitting there plugged into speakers generating the soundscape that morphs slowly over time.

jvcleave commented 10 years ago

awesome! would love to see it :)

Let me know if you need the rest of the remote control functionality and I can piece that together this week. Basically there are so many parameters it became overwhelming to change/compile/change/compile test so I built a system that publishes the settings to an xml file, starts a server you connect to and can change them with a separate app on the desktop (and eventually iPad, etc)

danomatika commented 10 years ago

Thanks but no time. I have to finish this tonight as I'm out of town for the next 2 weeks on a freelance thing.

jvcleave commented 8 years ago

example of a wrapper here https://github.com/jvcleave/ofxRPiCameraVideoGrabber/tree/master/example-wrapper

texture-mode only