When I try to use python code as followings, I got errors belows.
cv2.VideoCapture(0)
[ WARN:0@13.146] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
Also, this command works as well.
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! ‘video/x-raw(memory:NVMM),height=640,width=480,framerate=30/1’ ! nvvidconv ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! queue ! appsink drop=1
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1920 x 1536 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.122018, max 6.309574; Exposure Range min 16000, max 660000000;GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 1920 H = 1536
seconds to Run = 0
Frame Rate = 29.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
But, the following Python code is not working.
cv2.VideoCapture(“gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=3840, height=2162, framerate=30/1, format=NV12’ ! nvvidconv flip-method=0 ! ‘video/x-raw,width=1920, height=1080’ ! nvvidconv ! nvegltransform ! nveglglessink -e”, cv2.CAP_GSTREAMER)
How could I modify it?
This is my CSI camera information.
$ v4l2-ctl --all
Driver Info:
Driver name : tegra-video
Card type : vi-output, imx623 32-0044
Bus info : platform:tegra-capture-vi:4
Driver version : 5.10.104
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : tegra-camrtc-ca
Model : NVIDIA Tegra Video Input Device
Serial :
Bus info :
Media version : 5.10.104
Hardware revision: 0x00000003 (3)
Driver version : 5.10.104
Interface Info:
ID : 0x03000017
Type : V4L Video
Entity Info:
ID : 0x00000015 (21)
Name : vi-output, imx623 32-0044
Function : V4L2 I/O
Pad 0x01000016 : 0: Sink
Link 0x0200001b: from remote pad 0x100000f of entity ‘13e40000.host1x:nvcsi@15a00000-’: Data, Enabled
Priority: 2
Video input : 0 (Camera 4: no power)
Format Video Capture:
Width/Height : 1920/1536
Pixel Format : ‘YUYV’
Field : None
Bytes per Line : 3840
Size Image : 5898240
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :