How open camera with CV( cv::VideoCapture)

orin NX board,
jetpack 6.1 build with OpenCV4.10 and CUDA

the camera can work with jetson-inference

but cannot open it CV
cv::VideoCapture reader(0);

[ WARN:0@0.039] global cap_gstreamer.cpp:2839 handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0@0.040] global cap_gstreamer.cpp:1698 open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0@0.040] global cap_gstreamer.cpp:1173 isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Device 0: “Orin” 15656Mb, sm_87, Driver/Runtime ver.12.60/12.60
Read 1 frame
[ WARN:0@10.199] global cap_v4l.cpp:1136 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
Stop

hello peter626ca,

let’s narrow down the issue,
please check you’re able to fetch the camera stream correctly,
for instance, please check with v4l2 IOCTL,
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100

if above works,
you may further test with gst pipeline with nvarguscamerasrc to check the sensor frame-rate.
for example,
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 sensor-mode=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvvidconv ! fpsdisplaysink text-overlay=0 name=sink_0 video-sink=fakesink sync=0 -v