Onboard camera stream changed in Jetpack 3.2?

Capturing image from the onboard Jetson camera worked just fine with previous version of Jetpack 3.1 on TX2 using following lines of c code.

const string gst = "nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)24/1 ! nvvidconv flip-method=6 ! video/x-raw, format=(string)I420 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink";  
VideoCapture cap(gst); // open the default camera

However this same code fail to open camera with Jetpack 3.2 clean install.

When tried to run

gst-launch-1.0 nvcamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1280, height=720, framerate=30/1, format=NV12' ! nvoverlaysink -ev

The camera works in full screen mode and in terminal I get

Setting pipeline to PAUSED ...

Available Sensor modes : 
2592 x 1944 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
2592 x 1458 FR=30.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1280 x 720 FR=120.000000 CF=0x1109208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 1 WxH = 2592x1458 FrameRate = 30.000000 ...

/GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstNvOverlaySink-nvoverlaysink:nvoverlaysink-nvoverlaysink0.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\(memory:NVMM\)\,\ width\=\(int\)1280\,\ height\=\(int\)720\,\ format\=\(string\)NV12\,\ framerate\=\(fraction\)30/1"
^Chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:03.751757536

Then what string value should be entered to open the camera?
Thanks,

Hi Kyubot,
OpenCV in Jetpack 3.2 does not enable gstreamer. Please not install OpenCV via Jetpack 3.2 but build/install manually.
Here is a script for your reference:
https://github.com/AastaNV/JEP/blob/master/script/install_opencv3.4.0.sh

Thank you for your quick reply. Today I ran the script and successfully capture video with following keyword

const string gst = "nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=4 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink";

Now I can capture image from gstream however got following error message.

VIDEOIO ERROR: V4L: device nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=4 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink: Unable to query number of channels

What is the correct number of channels by the way?

Hi,
Not sure what’s wrong in your pipeline. Other users may share experience.

Also a relative post: [url]https://devtalk.nvidia.com/default/topic/1024245/jetson-tx2/opencv-3-3-and-integrated-camera-problems-/post/5210735/#5210735[/url]