This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM437X: Video capture with OpenCV

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: AM4378

Tool/software: Linux

Hello,

I'm using processor SDK 4 to develop an OpenCV application on AM4378. 

If I try a simple "VideoCapture cap(0)"

I get the following error:

VIDEOIO ERROR: libv4l unable to convert to requested pixfmt
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT


How do I solve this problem?

PS: There is a device entry /dev/video and the matrix-demo dual_camera works fine.

Thanks,

Rajat Rao

  • The software team have been notified. They will respond here.
  • We don't support openCV based capture. v4l2 API based or gstreamer plugin v4l2src based capture is supported.
  • Hi Manisha,

    I have 3 questions:

    1) OpenCV does use v4l2 as one of the backends. So it should also be supported right?

    2) There is an OpenCV demo included in Processor SDK4. The barcode roi demo by default reads an existing image, but it looks like it should also support camera capture. Is this right?

    3) That apart, could you provide a gstreamer pipeline that works on AM4378 (I only see some example for 5728)

    I tried - "gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)UYVY, width=(int)720, height=(int)576' ! queue ! waylandsink"

    But go the error :
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
    Additional debug info:
    ../../../../gstreamer-1.8.3/libs/gst/base/gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming task paused, reason not-negotiated (-4)

    Thanks,

    Rajat Rao

  • Hello,

    Rajat Rao said:
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
    Additional debug info:
    ../../../../gstreamer-1.8.3/libs/gst/base/gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming task paused, reason not-negotiated (-4)

    The error that you are observing most of the cases means that your caps filter is wrong (v4l2src is not compatible with the sink).

    Please check your capsfilter.

    You could try to add videoconvert element between v4l2src and waylandsink also in case your capsfilter is correct.

    BR
    Margarita