[Python] OpenCV High Res Image Capture Broken

Discussão em 'Python' iniciado por Stack, Outubro 1, 2024.

  1. Stack

    Stack Membro Participativo

    I am upgrading to RPi 5 from my 4. On the 4 I had opencv 3.2, which is old but it captured high res still images from my 48mp ELP camera. I have now upgraded to opencv 4.6 and there have been some changes, mainly I had to add a second arg to VideoCapture. I am working in Python 3.11.2

    capture = cv2.VideoCapture(0, cv2.CAP_GSTREAMER)
    capture.set(cv2.CAP_PROP_FRAME_WIDTH, 8000)
    capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 4000)
    ret, frame = capture.read
    capture.release



    This is the error that I am receiving

    [ WARN:0@2.945] global ./modules/videoio/src/cap_gstreamer.cpp (1405) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
    [ WARN:0@2.952] global ./modules/videoio/src/cap_gstreamer.cpp (2401) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
    [ WARN:0@2.953] global ./modules/videoio/src/cap_gstreamer.cpp (897) startPipeline OpenCV | GStreamer warning: unable to start pipeline
    [ WARN:0@2.953] global ./modules/videoio/src/cap_gstreamer.cpp (1583) setProperty OpenCV | GStreamer warning: no pipeline


    To note this if I remove setting the width and height I only get the 1405 error but my image shows up in my next function as 1920x1080

    I also tried cv2.CAP_V4L instead of cv2.CAP_GSTREAMER, it does not error out but won't produce a high res image either.

    Continue reading...

Compartilhe esta Página