Using CSI camera with OpenCV on Jetson Nano

Hi, everyone
My OpenCV version is 4.1.1, and I try to use cap.VideoCapture(0) to capture the frames of camera alway get the error

[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created

I read some topics in this forum or in facebook, many people recommend to use cap.VideoCapture(pipeline, cv2.CAP_GSTREAMER) instead of cap.VideoCapture(0).

My question is that way will be better than use cap.VideoCapture(0) ? Why can’t I just use cap.VideoCapture(0) the same with what I do in PC ?

There are samples in pubic source code package. Please download it and take a look.

And a python code for your reference: