gstCamera.cpp flip question

There is a block of code in gstCamera.cpp, i’m using it in jetson:

#if NV_TENSORRT_MAJOR > 4
// on newer JetPack’s, it’s common for CSI camera to need flipped
// so here we reverse FLIP_NONE with FLIP_ROTATE_180
if( mOptions.flipMethod == videoOptions::FLIP_NONE )
mOptions.flipMethod = videoOptions::FLIP_ROTATE_180;
else if( mOptions.flipMethod == videoOptions::FLIP_ROTATE_180 )
mOptions.flipMethod = videoOptions::FLIP_NONE;
ss << “nvarguscamerasrc sensor-id=” << mOptions.resource.port << " saturation=1 aeantibanding=0 awblock=true ee-mode=1 ee-strength=1 exposuretimerange=‘34000 4166000’ ! video/x-raw(memory:NVMM), width=(int)" << GetWidth() << “, height=(int)” << GetHeight() << “, framerate=” << (int)mOptions.frameRate << “/1, format=(string)NV12 ! nvvidconv left=640 bottom=100 top=100 flip-method=” << mOptions.flipMethod << " ! “;
// orginal was: ss << “nvarguscamerasrc sensor-id=” << mOptions.resource.port << " ! video/x-raw(memory:NVMM), width=(int)” << GetWidth() << “, height=(int)” << GetHeight() << “, framerate=” << (int)mOptions.frameRate << “/1, format=(string)NV12 ! nvvidconv flip-method=” << mOptions.flipMethod << " ! ";
#else

Is this flipping only required to turn image to be right - so the right side is on right and left on left or is there any other reason? I think it consumes GPU…

it seems so.

Hi @raul.orav, there are a bunch of different flip methods that it supports via nvvidconv:

--input-flip=FLIP      flip method to apply to input:
                             * none (default)
                             * counterclockwise
                             * rotate-180
                             * clockwise
                             * horizontal
                             * vertical
                             * upper-right-diagonal
                             * upper-left-diagonal

By default nvvidconv is using hardware engine (VIC) and not GPU.

1 Like

thnx. i figured it out.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.