nariakiiwatani/ofxNDI

Lags with "Pixels" example

Closed this issue · 3 comments

Hi ! Thanks for this addon !

When I'm trying your "example-sender", it's perfect and no lagging stream for the way :
video_.send(camera_.getPixels());
With camera_.getPixels().size() = 8294400
But this way lag a lot :
ofPixels pixels;
ofGetGLRenderer()->saveFullViewport(pixels);
video_.send(pixels);
while pixels.size() = 3145728

Is that normal ? Is there any optimization to do in code for streaming the principal canvas without lagging ?
Thx

Hi! thank you for trying this addon!

I don't know this is it but I found that saveFullViewport stores the pixel data in BGRA format.
I'm not sure if it matters or not, it at least is worth to check.

So you can try...

  • Using ofFbo allocated as RGBA instead of drawing directly to a window then use ofFbo::readToPixels for NDI and ofFbo::draw for screen.

or

  • Changing receiving format from RGBA to BGRA by changing color_format argument for ofxNDIReceiver::setup

It seems to be ok right now with your first solution !
Thx and very happy to use your add-on !!!!!!!!!!

nice :)

Closing