nariakiiwatani / ofxNDI

NewTek NDI SDK Wrapper for openFrameworks.
https://ndi.tv/
MIT License
103 stars 19 forks source link

example-sender - corrupt video on Linux #28

Closed steeley closed 2 years ago

steeley commented 3 years ago

In example-sender the OF video grabber gets corrupted and and sends a faulty image. Note the video grabber preview in the sender is also corrupted.

Maybe pixel type is wrong ?? This seems to be a workaround, but means a copy(??)

void ofApp::update(){
    camera_.update();
            if(camera_.isFrameNew()) {
        //video_.send(camera_.getPixels()); //video gets corrupted by this call on linux
        ofPixels pix = camera_.getPixels();
        video_.send(pix);
    }

}

corrupted image: corrupt

correct image: ok

nariakiiwatani commented 3 years ago

ofxNDISendVideo sends frames async by default. Guessing from the situation, the pixels may be edited inside camera_ before NDI sends the frame. probably from another thread?

So your workaround is correct.