AnsweredAssumed Answered

opencv with gstreamer in VideoCapture doesn't work

Question asked by Yibeom Han on May 6, 2020
Latest reply on May 6, 2020 by Yibeom Han

Hello guys,

I have built imx-image-multimeia in yocto(kernel 5.4.3.1) and added opencv some packages such as

CORE_IMAGE_EXTRA_INSTALL += " opencv-apps opencv-samples python3-opencv".

 

and then bitbake ima-image-multimedia -c populate_sdk.

and CROSS_COMPILE=/opt/fsl-imx-x11/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-

and SDKTARGETSYSROOT=/opt/fsl-imx-x11/5.4-zeus/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi.

 

but, when i run web cam app, some error occurred and stopped. I thought the pipeline would be right below

v4l2src device=/dev/video2 ! 'video/x-raw,width=640,height=480' ! imxv4l2sink. it works, but

 

VideoCapture cap("imxv4l2src device=/dev/video2 ! 'video/x-raw,width=640,height=480' ! appsink") doesn't work and below error is:

/usr/src/debug/opencv/4.1.2.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1

 

I think it is caused by opencv with gstreamer but, I have no idea.

Could you tell me how to debug?

Outcomes