![]() ![]() The two channels on “frame” (frame and frame) show nothing but static looking images, but this responds in real time. lect((video,), (), ()) # Wait for the device to fill the buffer.įrame = np.frombuffer(image_data, dtype=np.uint8).reshape(1920,1080,2)Ĭv_frame = cv2.imdecode(frame, cv2.COLOR_BAYER_RG2BGR) Video = v4l2capture.Video_device("/dev/video1") I have also tried using the v4l2capture library in python using the code: import numpy as np There is no lag running gst-launch-1.0 nvcamerasrc fpsRange="15.0 15.0" sensor-id=1 ! 'video/x-raw(memory:NVMM), width=(int)4056, height=(int)3040, format=(string)I420, framerate=(fraction)15/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw, format=(string)I420' ! xvimagesink -eīut when I try to run this in opencv: cv2.VideoCapture("gst-launch-1.0 nvcamerasrc fpsRange='15.0 15.0' sensor-id=1 ! video/x-raw(memory:NVMM), width=(int)4056, height=(int)3040, format=(string)I420, framerate=(fraction)15/1 ! nvtee ! nvvidconv flip-method=2 ! video/x-raw, format=(string)I420 ! xvimagesink -e")Ĭap.read() returns a None type. I do not want to use gstreamer to convert my video to BGR because that causes some lag in the video, but it works: cv2.VideoCapture("nvcamerasrc fpsRange='1.0 60.0' sensor-id=1 ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)15/1 ! nvvidconv flip-method=6 ! video/x-raw, format=(string)I420 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink") This is the code I run to reproduce this error: import cv2 ![]() VIDEOIO ERROR: V4L: can't open camera by index 1 VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV I want to display the camera stream directly using opencv, but it seems to not be able to support my pixel format: (python:5901): GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |