ofxPostProcessing icon indicating copy to clipboard operation
ofxPostProcessing copied to clipboard

Upside-down video with ofVideoGrabber

Open andyinabox opened this issue 12 years ago • 4 comments
trafficstars

I'm attempting to use an unmodified fork for your ofxPostProcessing addon with video and for some reason when I add the post-processing transformation the video is vertically mirrored. Here's the code I'm using in my testApp.cpp.


#include "testApp.h"

//--------------------------------------------------------------
void testApp::setup(){

    camWidth        = ofGetWidth(); // try to grab at this size.
    camHeight       = ofGetHeight();

    // set up video grabber
    vidGrabber.setDeviceID(0);
    vidGrabber.setDesiredFrameRate(24);
    vidGrabber.initGrabber(camWidth,camHeight);

    // set up shader post-processing
    post.init(camWidth, camHeight);
    post.createPass<RimHighlightingPass>()->setEnabled(true);
}

//--------------------------------------------------------------
void testApp::update(){

    ofBackground(100,100,100);
    vidGrabber.update();
}

//--------------------------------------------------------------
void testApp::draw(){

    // copy enable part of gl state
    glPushAttrib(GL_ENABLE_BIT);

    // setup gl state
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);


    // begin scene to post process
    post.begin();

    vidGrabber.draw(0,0);

    // end scene and draw
    post.end();

    // set gl state back to original
    glPopAttrib();
}

andyinabox avatar Oct 06 '13 16:10 andyinabox

I was going to open another issue but I think it is the same. Everything is flipped vertically when using ofxPostProcessing here. Thanks

dimitre avatar Aug 01 '14 18:08 dimitre

Just after post.init() put post.setFlip(false); This solved problem for me.

darekzak avatar Sep 14 '14 20:09 darekzak

That is great, thank you @darekzak

dimitre avatar Sep 14 '14 22:09 dimitre

calling post.setFlip(false) after init just draws a black screen for me..... ?

this works as a temp work around for the time being

post.draw(0,ofGetHeight(),ofGetWidth(),0-ofGetHeight());

JoshuaBatty avatar Oct 03 '14 01:10 JoshuaBatty