Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Super Fast Exchange of video texture between Threads

$
0
0

@princemio wrote:

Hey guys,

im having a problem. I want to grab video images and process them (optical flow farneback) in a different thread. My current solution sends pixels to the second thread (with camera.getPixels()) and everything is super fast! But im looking for the quickest logic possible and smallest latency.

Hence i was thinking if a Pixel Buffer Object upload would be faster and started to experiment with threadedPixelBufferExample. In this example the texture of an FBO is uploaded to a different thread via PBO.

But as soon as i draw a camera texture to the FBO - The camera images dont update anymore

if (camera.isFrameNew()) {
fbo.begin();
ofClear(0, 255);
ofSetColor(100);
ofSetColor(255);
camera.draw(0, 0);
fbo.end();
}

Now my question are:

1) is PBO actually appropriate for my case? Would this speed up the exchange of pixel between the threads?

2) What does the drawinig a camera texture have to do - with the uploaded FBO Texture. Why does it stop working as soon as i draw the texture in it.

To recreate the error: Simply open example threadedPixelBufferExample and draw a video grabber into the FBO - press Record

Any help - suggestion or written thought is highly appreciated.

thank you guys

mio

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles