Other Parts Discussed in Thread: AM69A
Tool/software:
Camera preview using Python code in AM69A not able to view
My python code
import time
import cv2
fps = 30
frame_width = 640
frame_height = 480
cap = cv2.VideoCapture("/dev/video-imx219-cam3")
cap.set(cv2.CAP_PROP_FRAME_WIDTH, frame_width)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, frame_height)
cap.set(cv2.CAP_PROP_FPS, fps)
gst_str = "appsrc name=source ! tiovxdlcolorconvert ! video/x-raw,format=NV12 ! kmssink driver-name=tidss sync=false"
out = cv2.VideoWriter(gst_str, 0, fps, (frame_width, frame_height), True)
while True:
ret, frame = cap.read()
out.write(frame)
out.release()
cap.release()
Log :
REMOTE_SERVICE: Init ... Done !!!
1333.920283 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
1333.920338 s: VX_ZONE_INIT:Enabled
1333.920347 s: VX_ZONE_ERROR:Enabled
1333.920352 s: VX_ZONE_WARNING:Enabled
1333.920887 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-0
1333.920972 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-1
1333.921048 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-2
1333.921144 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-3
1333.921153 s: VX_ZONE_INIT:[tivxInitLocal:136] Initialization Done !!!
1333.921594 s: VX_ZONE_INIT:[tivxHostInitLocal:101] Initialization Done for HOST !!!
[ WARN:0@0.191] global /usr/src/debug/opencv/4.5.5-r0/git/modules/videoio/src/cap_gstreamer.cpp (2042) open OpenCV | GStreamer warning: GStreamer: cannot find appsrc in manual pipeline
1333.925915 s: VX_ZONE_INIT:[tivxHostDeInitLocal:115] De-Initialization Done for HOST !!!
1333.930333 s: VX_ZONE_INIT:[tivxDeInitLocal:204] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
IPC: Deinit ... !!!
IPC: DeInit ... Done !!!
MEM: Deinit ... !!!
DDR_SHARED_MEM: Alloc's: 0 alloc's of 0 bytes
DDR_SHARED_MEM: Free's : 0 free's of 0 bytes
DDR_SHARED_MEM: Open's : 0 allocs of 0 bytes
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!
[ 586.018643] ds90ub960 4-0030: rx0 CSI error: 0x4
[ 586.023264] ds90ub960 4-0030: rx0 CSI checksum error
[ WARN:0@10.316] global /usr/src/debug/opencv/4.5.5-r0/git/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO(V4L2:/dev/video-imx219-cam3): select() timeout.
^CTraceback (most recent call last):
File "/opt/edgeai-gst-apps/ruban/test4.py", line 16, in <module>
ret, frame = cap.read()
KeyboardInterrupt
If possible, provide complete python code to preview imx219 camera.
Thanks in Advance,
Ruban