opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
77.01k stars 55.68k forks source link

4.6.0 can't access PureThermal USB camera #22738

Open itspalomo opened 1 year ago

itspalomo commented 1 year ago

System Information

OpenCV python version: 4.2.0 && 4.6.0 Operating System: Ubuntu Server 20.04 Platform: Raspberry Pi 4b Firmware: Nov 18 2021 16:17:39 version: d9b293558b4cef6aabedcc53c178e7604de90788 (clean) (release) (start_x) Python version: 3.8.10

Detailed description

Hello, I am working on my capstone project and have hit a wall. I am trying to access frames from a usb camera, more specifically an FLIR lepton 3.5 infrared using a PureThermal carrier board but always get stuck in an infinite loop (code doesn't exit) or get the following error:

[ WARN:0] global ../modules/videoio/src/cap_v4l.cpp (998) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.

The camera is the only USB device connected, here is the lsusb output:

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1e4e:0100 Cubeternet WebCam
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I verified the product and vendor id through dmseg (dmesg log available here: dmesg.txt) command and tried to give the device permissions by running the command sudo chmod 666 /dev/bus/usb/001/003 however, that also did not seem to help. I also chmod the python file but that also did not work. I will add that I have a generic raspberry pi camera module that does run through the csi port. Note that the lepton is recognized on a model 4b running raspbian os buster no issues.

Here is the v4l2-ctl --list-devices output:

bcm2835-codec-decode (platform:bcm2835-codec):
        /dev/video10
        /dev/video11
        /dev/video12
        /dev/media2

bcm2835-isp (platform:bcm2835-isp):
        /dev/video13
        /dev/video14
        /dev/video15
        /dev/video16
        /dev/media1

PureThermal (fw:v1.3.0): PureTh (usb-0000:01:00.0-1.1):
        /dev/video0
        /dev/video1
        /dev/media0

I verified the /dev/video* are all under the video group here:

crw-rw----+ 1 root video 81, 1 Aug 31 15:27 /dev/video0
crw-rw----+ 1 root video 81, 2 Aug 31 15:27 /dev/video1
crw-rw----+ 1 root video 81, 6 Aug 31 15:27 /dev/video10
crw-rw----+ 1 root video 81, 7 Aug 31 15:27 /dev/video11
crw-rw----+ 1 root video 81, 8 Aug 31 15:27 /dev/video12
crw-rw----+ 1 root video 81, 0 Aug 31 15:27 /dev/video13
crw-rw----+ 1 root video 81, 3 Aug 31 15:27 /dev/video14
crw-rw----+ 1 root video 81, 4 Aug 31 15:27 /dev/video15
crw-rw----+ 1 root video 81, 5 Aug 31 15:27 /dev/video16

Steps to reproduce

Here is the code I am running, pretty simple. Inside the index, I have tried every available index plus different cv2.CAP... backends, V4L2, GSTREAMER, DSHOW and I've also left it blank.

#every 5s until keyboard interrup, pi will take a picture
def cam_ind_test(cam_path , count: int, fname: str):
    cap = cv2.VideoCapture(cam_path)

    i = 0
    while(cap.isOpened()):
        ret, frame = cap.read()

        # This condition prevents from infinite looping
        # incase video ends.
        if (ret == False) or (i > count):
            print('ret is False')
            break

        # Save Frame by Frame into disk using imwrite method
        cv2.imwrite(fname+str(i)+'.jpg', frame)
        i += 1
    cv2.waitKey(1)
    cap.release()
    cv2.waitKey(1)

cam_ind_test(0,5, 'vl')

I've tracked the following but to no avail, #https://github.com/opencv/opencv/issues/19527

Issue submission checklist

kallaballa commented 1 year ago

First a question: why do you need to open and close the VideoCapture object repeatedly? Could you change your code to keep it open all the time?

Anyway:

* could you please check the output of the command ```id```. just to be sure you are in the "video" group.
* also, could you verify that gstreamer can open you device by running:
```bash
gst-launch-1.0 -v v4l2src device=/dev/video0 ! fakesink
itspalomo commented 1 year ago

Hello thank you for your prompt response. here is the output for the id command:

uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),115(netdev),118(lxd)

As for the reason, I have multiple cameras so I wrote a quick function to test multiple indexes. I should add some context, I am SSH'd into the pi through vscode. Opening the VideoCapture object for the raspberry pi camera through the csi port works as expected.

I ran the command

gst-launch-1.0 -v v4l2src device=/dev/video0 ! fakesink

and got the following output where it got "stuck" I'm assuming this is because I'm connected to the pi remotely via ssh.

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)UYVY, width=(int)80, height=(int)60, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)9/1, colorimetry=(string)2:4:5:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, format=(string)UYVY, width=(int)80, height=(int)60, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)9/1, colorimetry=(string)2:4:5:1, interlace-mode=(string)progressive

For ffmpeg, I changed the backend to

cap = cv2.VideoCapture(cam_path, cv2.CAP_FFMPEG)

and the VideoCapture object was not able to open the device, verified by checking cap.isOpened().

Additionally, could you provide more info on how to do this suggested step? I ran the commands through bash but the issue remains the same for both V4L2 and FFMPEG backends.

you could re-run your application with debug environment variables set:
export OPENCV_LOG_LEVEL=DEBUG
export OPENCV_VIDEOIO_DEBUG=1
export OPENCV_VIDEOWRITER_DEBUG=1
export OPENCV_VIDEOCAPTURE_DEBUG=1
export OPENCV_DUMP_ERRORS=1
export OPENCV_DUMP_CONFIG=1
export OPENCV_TRACE=1
export OPENCV_FFMPEG_DEBUG=1
export OPENCV_FFMPEG_LOGLEVEL=trace
kallaballa commented 1 year ago

and got the following output where it got "stuck" I'm assuming this is because I'm connected to the pi remotely via ssh.

actually the output looks alright.

Additionally, could you provide more info on how to do this suggested step? I ran the commands through bash but the issue remains the same for both V4L2 and FFMPEG backends.

you could re-run your application with debug environment variables set:
export OPENCV_LOG_LEVEL=DEBUG
export OPENCV_VIDEOIO_DEBUG=1
export OPENCV_VIDEOWRITER_DEBUG=1
export OPENCV_VIDEOCAPTURE_DEBUG=1
export OPENCV_DUMP_ERRORS=1
export OPENCV_DUMP_CONFIG=1
export OPENCV_TRACE=1
export OPENCV_FFMPEG_DEBUG=1
export OPENCV_FFMPEG_LOGLEVEL=trace

Those environment variables enable extended logging of OpenCV and capture backends. First you set the variables by executing the export statements and after that you run your program.

export OPENCV_LOG_LEVEL=DEBUG
export OPENCV_VIDEOIO_DEBUG=1
export OPENCV_VIDEOWRITER_DEBUG=1
export OPENCV_VIDEOCAPTURE_DEBUG=1
export OPENCV_DUMP_ERRORS=1
export OPENCV_DUMP_CONFIG=1
export OPENCV_TRACE=1
export OPENCV_FFMPEG_DEBUG=1
export OPENCV_FFMPEG_LOGLEVEL=trace
your_program

Please post the output of your program if you run it like that.

itspalomo commented 1 year ago

I see, thank you for the clarification @kallaballa , here is the output terminal:

ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ ls
BRID_ROADMAP.png  ContentServer.pdf  image_processing  infrastructures-07-00107-v2.pdf  README.md  ros  test.jpg
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_LOG_LEVEL=DEBUG
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOIO_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOWRITER_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOCAPTURE_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_DUMP_ERRORS=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_DUMP_CONFIG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_TRACE=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_FFMPEG_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_FFMPEG_LOGLEVEL=trace
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ OPENCV_VIDEOCAPTURE_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOCAPTURE_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_DUMP_ERRORS=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOIO_DEBUG=1^C
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ python3 image_processing/dualcamp.py 

OpenCV build configuration is:

General configuration for OpenCV 4.2.0 =====================================
  Version control:               unknown

  Extra modules:
    Location (extra):            /build/opencv-EQP6mK/opencv-4.2.0+dfsg/contrib/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2020-02-18T03:31:25Z
    Host:                        Linux 4.4.0-173-generic aarch64
    CMake:                       3.16.3
    CMake generator:             Ninja
    CMake build tool:            /usr/bin/ninja
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16
      required:                  NEON
      disabled:                  VFPV3

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                /usr/bin/c++  (ver 9.2.1)
    C++ flags (Release):         -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG
    C++ flags (Debug):           -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG
    C flags (Debug):             -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now  -Wl,--gc-sections -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now 
    Linker flags (Debug):        -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now  -Wl,--gc-sections  
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:          dl m pthread rt
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy hdf hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      sfm
    Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv gapi js matlab ovis python2 ts
    Applications:                apps
    Documentation:               doxygen python javadoc
    Non-free algorithms:         NO

  GUI: 
    GTK+:                        YES (ver 3.24.13)
      GThread :                  YES (ver 2.63.3)
      GtkGlExt:                  NO
    OpenGL support:              NO
    VTK support:                 YES (ver 6.3.0)

  Media I/O: 
    ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
    JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
    WEBP:                        /usr/lib/aarch64-linux-gnu/libwebp.so (ver encoder: 0x020e)
    PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
    TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
    OpenEXR:                     /usr/lib/aarch64-linux-gnu/libImath.so /usr/lib/aarch64-linux-gnu/libIlmImf.so /usr/lib/aarch64-linux-gnu/libIex.so /usr/lib/aarch64-linux-gnu/libHalf.so /usr/lib/aarch64-linux-gnu/libIlmThread.so (ver 2.3.0)
    GDAL:                        YES (/usr/lib/libgdal.so)
    GDCM:                        YES (3.0.4)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      YES (2.2.5)
    FFMPEG:                      YES
      avcodec:                   YES (58.54.100)
      avformat:                  YES (58.29.100)
      avutil:                    YES (56.31.100)
      swscale:                   YES (5.5.100)
      avresample:                YES (4.0.0)
    GStreamer:                   YES (1.16.2)
    PvAPI:                       NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            TBB (ver 2020.1 interface 11101)

  Trace:                         YES (built-in)

  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       YES (ver 3.3.7)
    Custom HAL:                  NO
    Protobuf:                    /usr/lib/aarch64-linux-gnu/libprotobuf.so (3.6.1)

  OpenCL:                        YES (no extra features)
    Include path:                /usr/include/CL
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /usr/bin/python3 (ver 3.8.2)
    Libraries:                   /usr/lib/aarch64-linux-gnu/libpython3.8.so (ver 3.8.2rc1)
    numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.17.4)
    install path:                lib/python3.8/dist-packages

  Python (for build):            /usr/bin/python3

  Java:                          
    ant:                         /usr/bin/ant (ver 1.10.7)
    JNI:                         /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
    Java wrappers:               YES
    Java tests:                  NO

  Install to:                    /usr
-----------------------------------------------------------------

[DEBUG:0] global ../modules/videoio/src/videoio_registry.cpp (161) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
[DEBUG:0] global ../modules/videoio/src/videoio_registry.cpp (185) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
[ INFO:0] global ../modules/videoio/src/videoio_registry.cpp (187) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
[ WARN:0] global ../modules/videoio/src/cap.cpp (163) open VIDEOIO(V4L2): trying capture cameraNum=0 ...
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (895) open VIDEOIO(V4L2:/dev/video0): opening...
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (911) open VIDEOIO(V4L2:/dev/video0): deviceHandle=3
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QUERYCAP(2154321408), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QUERYCAP(2154321408), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_G_FMT(3234878980), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_G_FMT(3234878980), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_S_FMT(3234878981), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_S_FMT(3234878981), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_S_PARM(3234616854), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_S_PARM(3234616854), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_G_PARM(3234616853), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_G_PARM(3234616853), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (605) setFps VIDEOIO(V4L2:/dev/video0): FPS=9/1
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[ WARN:0] global ../modules/videoio/src/cap.cpp (174) open VIDEOIO(V4L2): created, isOpened=1
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_STREAMON(1074026002), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_STREAMON(1074026002), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_DQBUF(3227014673), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)
[ WARN:0] global ../modules/videoio/src/cap_v4l.cpp (998) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (934) read_frame_v4l2 VIDEOIO(V4L2:/dev/video0): can't read frame (VIDIOC_DQBUF): errno=0 (Success)
ret is False
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_STREAMOFF(1074026003), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_STREAMOFF(1074026003), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (953) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(3, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (961) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(3, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0] global ../modules/videoio/src/cap_v4l.cpp (454) closeDevice VIDEOIO(V4L2:/dev/video0): close(3)
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ 

The python I ran is below:

import cv2
import numpy as np
import time

#every 5s until keyboard interrup, pi will take a picture
def cam_ind_test(cam_path: int, count: int, fname: str):
    cap = cv2.VideoCapture(cam_path, cv2.CAP_V4L2)

    i = 0

    while(cap.isOpened()):
        ret, frame = cap.read()

        # This condition prevents from infinite looping
        # incase video ends.
        if (ret == False) or (i > count):
            print('ret is False')
            break

        # Save Frame by Frame into disk using imwrite method
        cv2.imwrite(fname+str(i)+'.jpg', frame)
        i += 1
    cv2.waitKey(1)
    cap.release()
    cv2.waitKey(1)

cam_ind_test(0,5, 'vl')

Thank you.

itspalomo commented 1 year ago

Running with the ffmpeg backend produced the following log but no output.

cap = cv2.VideoCapture(cam_path, cv2.CAP_FFMPEG)
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_LOG_LEVEL=DEBUG
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOIO_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOWRITER_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_VIDEOCAPTURE_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_DUMP_ERRORS=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_DUMP_CONFIG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_TRACE=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_FFMPEG_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ export OPENCV_FFMPEG_LOGLEVEL=trace
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ python3 image_processing/dualcamp.py 

OpenCV build configuration is:

General configuration for OpenCV 4.2.0 =====================================
  Version control:               unknown

  Extra modules:
    Location (extra):            /build/opencv-EQP6mK/opencv-4.2.0+dfsg/contrib/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2020-02-18T03:31:25Z
    Host:                        Linux 4.4.0-173-generic aarch64
    CMake:                       3.16.3
    CMake generator:             Ninja
    CMake build tool:            /usr/bin/ninja
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16
      required:                  NEON
      disabled:                  VFPV3

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                /usr/bin/c++  (ver 9.2.1)
    C++ flags (Release):         -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG
    C++ flags (Debug):           -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG
    C flags (Debug):             -g -O2 -fdebug-prefix-map=/build/opencv-EQP6mK/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now  -Wl,--gc-sections -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now 
    Linker flags (Debug):        -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now  -Wl,--gc-sections  
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:          dl m pthread rt
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy hdf hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      sfm
    Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv gapi js matlab ovis python2 ts
    Applications:                apps
    Documentation:               doxygen python javadoc
    Non-free algorithms:         NO

  GUI: 
    GTK+:                        YES (ver 3.24.13)
      GThread :                  YES (ver 2.63.3)
      GtkGlExt:                  NO
    OpenGL support:              NO
    VTK support:                 YES (ver 6.3.0)

  Media I/O: 
    ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
    JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
    WEBP:                        /usr/lib/aarch64-linux-gnu/libwebp.so (ver encoder: 0x020e)
    PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
    TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
    OpenEXR:                     /usr/lib/aarch64-linux-gnu/libImath.so /usr/lib/aarch64-linux-gnu/libIlmImf.so /usr/lib/aarch64-linux-gnu/libIex.so /usr/lib/aarch64-linux-gnu/libHalf.so /usr/lib/aarch64-linux-gnu/libIlmThread.so (ver 2.3.0)
    GDAL:                        YES (/usr/lib/libgdal.so)
    GDCM:                        YES (3.0.4)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      YES (2.2.5)
    FFMPEG:                      YES
      avcodec:                   YES (58.54.100)
      avformat:                  YES (58.29.100)
      avutil:                    YES (56.31.100)
      swscale:                   YES (5.5.100)
      avresample:                YES (4.0.0)
    GStreamer:                   YES (1.16.2)
    PvAPI:                       NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            TBB (ver 2020.1 interface 11101)

  Trace:                         YES (built-in)

  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       YES (ver 3.3.7)
    Custom HAL:                  NO
    Protobuf:                    /usr/lib/aarch64-linux-gnu/libprotobuf.so (3.6.1)

  OpenCL:                        YES (no extra features)
    Include path:                /usr/include/CL
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /usr/bin/python3 (ver 3.8.2)
    Libraries:                   /usr/lib/aarch64-linux-gnu/libpython3.8.so (ver 3.8.2rc1)
    numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.17.4)
    install path:                lib/python3.8/dist-packages

  Python (for build):            /usr/bin/python3

  Java:                          
    ant:                         /usr/bin/ant (ver 1.10.7)
    JNI:                         /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
    Java wrappers:               YES
    Java tests:                  NO

  Install to:                    /usr
-----------------------------------------------------------------

[DEBUG:0] global ../modules/videoio/src/videoio_registry.cpp (161) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
[DEBUG:0] global ../modules/videoio/src/videoio_registry.cpp (185) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
[ INFO:0] global ../modules/videoio/src/videoio_registry.cpp (187) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940)
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone$ 
kallaballa commented 1 year ago

Oh. I just saw you are using OpenCV 4.2.0. could you please first upgrade before we continue?

cruzer77 commented 1 year ago

Hello so me and @itspalomo have both been working on this and this is still what were getting. Upgraded to version 4.6.0 and verified checking

cv2.__version__

Here is the output.

ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_LOG_LEVEL=DEBUGO_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_VIDEOIO_1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_VIDEOWRITER_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_VIDEOCAPTURE_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_DUMP_ERRORS=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_DUMP_CONFIG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_TRACE=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_FFMPEG_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ export OPENCV_FFMPEG_LOGLEVEL=trace
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ python3 dualcamp.py

OpenCV build configuration is:

General configuration for OpenCV 4.6.0 =====================================
  Version control:               4.6.0-dirty

  Platform:
    Timestamp:                   2022-06-07T12:50:51Z
    Host:                        Linux 4.9.140-tegra aarch64
    CMake:                       3.22.5
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf quirc tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O:
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.2-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp36-cp36m/bin/python3.6 (ver 3.6.15)
    Libraries:                   libpython3.6m.a (ver 3.6.15)
    numpy:                       /opt/python/cp36-cp36m/lib/python3.6/site-packages/numpy/core/include (ver 1.19.3)
    install path:                python/cv2/python-3

  Python (for build):            /bin/python2.7

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.6/cmake-install
-----------------------------------------------------------------

[DEBUG:0@0.024] global /io/opencv/modules/videoio/src/videoio_registry.cpp (197) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.024] global /io/opencv/modules/videoio/src/videoio_registry.cpp (221) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ INFO:0@0.024] global /io/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/backend.cpp (120) createDefaultUIBackend UI: Initializing backend...
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/registry.impl.hpp (87) UIBackendRegistry UI: Builtin backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/registry.impl.hpp (112) UIBackendRegistry UI: Available backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[ INFO:0@0.024] global /io/opencv/modules/highgui/src/registry.impl.hpp (114) UIBackendRegistry UI: Enabled backends(3, sorted by priority): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK (priority=1000)
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK plugin's glob is 'libopencv_highgui_gtk*.so', 1 location(s)
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK3 (priority=990)
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK3 plugin's glob is 'libopencv_highgui_gtk3*.so', 1 location(s)
[DEBUG:0@0.026] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.026] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK3
[DEBUG:0@0.026] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK2 (priority=980)
[DEBUG:0@0.026] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK2 plugin's glob is 'libopencv_highgui_gtk2*.so', 1 location(s)
[DEBUG:0@0.027] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.027] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK2
[DEBUG:0@0.027] global /io/opencv/modules/highgui/src/backend.cpp (106) createUIBackend UI: fallback on builtin code: QT5
[ INFO:0@0.112] global /io/opencv/modules/core/src/trace.cpp (882) ~TraceManager Trace: Total events: 7
[ WARN:0@0.112] global /io/opencv/modules/core/src/trace.cpp (886) ~TraceManager Trace: Total skipped events: 6
ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$
kallaballa commented 1 year ago

Could you please post the full dualcamp.py? In the debug output is no trace of any attempt to open a v4l2 device.

cruzer77 commented 1 year ago

Another issue we are getting. These are for video capture 0. Also verified video capture 0

[DEBUG:0@0.229] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)

GSTREAMER

[ WARN:0@0.024] global /io/opencv/modules/videoio/src/cap.cpp (304) open VIDEOIO(GSTREAMER): backend is not available (plugin is missing, or can't be loaded due dependencies or it is not compatible)

FFMPEG (couldn't identify warning)

[DEBUG:0@0.022] global /io/opencv/modules/videoio/src/videoio_registry.cpp (197) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.022] global /io/opencv/modules/videoio/src/videoio_registry.cpp (221) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ INFO:0@0.022] global /io/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/backend.cpp (120) createDefaultUIBackend UI: Initializing backend...
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/registry.impl.hpp (87) UIBackendRegistry UI: Builtin backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/registry.impl.hpp (112) UIBackendRegistry UI: Available backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[ INFO:0@0.023] global /io/opencv/modules/highgui/src/registry.impl.hpp (114) UIBackendRegistry UI: Enabled backends(3, sorted by priority): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK (priority=1000)
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK plugin's glob is 'libopencv_highgui_gtk*.so', 1 location(s)
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK
[DEBUG:0@0.023] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK3 (priority=990)
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK3 plugin's glob is 'libopencv_highgui_gtk3*.so', 1 location(s)
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK3
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK2 (priority=980)
[DEBUG:0@0.024] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK2 plugin's glob is 'libopencv_highgui_gtk2*.so', 1 location(s)
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK2
[DEBUG:0@0.025] global /io/opencv/modules/highgui/src/backend.cpp (106) createUIBackend UI: fallback on builtin code: QT5
[ INFO:0@0.108] global /io/opencv/modules/core/src/trace.cpp (882) ~TraceManager Trace: Total events: 7
[ WARN:0@0.108] global /io/opencv/modules/core/src/trace.cpp (886) ~TraceManager Trace: Total skipped events: 6

This is the code we have been running we have been changing the video backend for the video capture object

import cv2
import numpy as np
import time

#every 5s until keyboard interrup, pi will take a picture
def cam_ind_test(cam_path: int, count: int, fname: str):
    cap = cv2.VideoCapture(cam_path, cv2.CAP_FFMPEG)

    i = 0

    while(cap.isOpened()):
        ret, frame = cap.read()

        # This condition prevents from infinite looping
        # incase video ends.
        if (ret == False) or (i > count):
            print('ret is False')
            break

        # Save Frame by Frame into disk using imwrite method
        cv2.imwrite(fname+str(i)+'.jpg', frame)
        i += 1
    cv2.waitKey(1)
    cap.release()
    cv2.waitKey(1)

cam_ind_test(0,5, 'vl')
kallaballa commented 1 year ago

Are all your video devices actual capture devices?

itspalomo commented 1 year ago

Yes, they are physical USB cameras, here is a lsusb output. Note, it works as expected running on RaspberryPi OS with videocapture(0).

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1e4e:0100 Cubeternet WebCam
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
kallaballa commented 1 year ago

I mean the /dev/videoX device files. It could be that some of them are not ment for capturing. what for example does this command print on your setup:

v4l2-ctl --list-formats-ext --device /dev/video0
cruzer77 commented 1 year ago

Here is the output of the code.

ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'UYVY' (UYVY 4:2:2)
                Size: Discrete 80x60
                        Interval: Discrete 0.111s (9.000 fps)
        [1]: 'Y16 ' (16-bit Greyscale)
                Size: Discrete 80x60
                        Interval: Discrete 0.111s (9.000 fps)
                Size: Discrete 80x63
                        Interval: Discrete 0.111s (9.000 fps)
        [2]: 'GREY' (8-bit Greyscale)
                Size: Discrete 80x60
                        Interval: Discrete 0.111s (9.000 fps)
        [3]: 'RGBP' (16-bit RGB 5-6-5)
                Size: Discrete 80x60
                        Interval: Discrete 0.111s (9.000 fps)
        [4]: 'BGR3' (24-bit BGR 8-8-8)
                Size: Discrete 80x60
                        Interval: Discrete 0.111s (9.000 fps)
kallaballa commented 1 year ago

Alright, that is capture device.

Anyway..

cruzer77 commented 1 year ago

Thank you for the help we really appreciate it V4L2

OpenCV build configuration is:

General configuration for OpenCV 4.6.0 =====================================
  Version control:               4.6.0-dirty

  Platform:
    Timestamp:                   2022-06-07T12:50:51Z
    Host:                        Linux 4.9.140-tegra aarch64
    CMake:                       3.22.5
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf quirc tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.2-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp36-cp36m/bin/python3.6 (ver 3.6.15)
    Libraries:                   libpython3.6m.a (ver 3.6.15)
    numpy:                       /opt/python/cp36-cp36m/lib/python3.6/site-packages/numpy/core/include (ver 1.19.3)
    install path:                python/cv2/python-3

  Python (for build):            /bin/python2.7

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.6/cmake-install
-----------------------------------------------------------------

[DEBUG:0@0.023] global /io/opencv/modules/videoio/src/videoio_registry.cpp (197) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.024] global /io/opencv/modules/videoio/src/videoio_registry.cpp (221) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ INFO:0@0.024] global /io/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ WARN:0@0.024] global /io/opencv/modules/videoio/src/cap.cpp (244) open VIDEOIO(V4L2): trying capture cameraNum=0 ...
[DEBUG:0@0.024] global /io/opencv/modules/videoio/src/cap_v4l.cpp (910) open VIDEOIO(V4L2:/dev/video0): opening...
[DEBUG:0@0.209] global /io/opencv/modules/videoio/src/cap_v4l.cpp (926) open VIDEOIO(V4L2:/dev/video0): deviceHandle=5
[DEBUG:0@0.209] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYCAP(2154321408), failIfBusy=1)
[DEBUG:0@0.210] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYCAP(2154321408), ...) => 0    errno=0 (Success)
[DEBUG:0@0.210] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_FMT(3234878980), failIfBusy=1)
[DEBUG:0@0.210] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_FMT(3234878980), ...) => 0    errno=0 (Success)
[DEBUG:0@0.210] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981), failIfBusy=1)
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...) => 0    errno=0 (Success)
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_PARM(3234616854), failIfBusy=1)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_PARM(3234616854), ...) => 0    errno=0 (Success)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_PARM(3234616853), failIfBusy=1)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_PARM(3234616853), ...) => 0    errno=0 (Success)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (615) setFps VIDEOIO(V4L2:/dev/video0): FPS=9/1
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.224] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[ WARN:0@0.224] global /io/opencv/modules/videoio/src/cap.cpp (256) open VIDEOIO(V4L2): created, isOpened=1
[DEBUG:0@0.225] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.226] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.226] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.226] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.226] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.226] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.227] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.227] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.227] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMON(1074026002), failIfBusy=1)
[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMON(1074026002), ...) => 0    errno=0 (Success)
[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_DQBUF(3227014673), failIfBusy=1)
[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)

FFMPEG with path as index

OpenCV build configuration is:

General configuration for OpenCV 4.6.0 =====================================
  Version control:               4.6.0-dirty

  Platform:
    Timestamp:                   2022-06-07T12:50:51Z
    Host:                        Linux 4.9.140-tegra aarch64
    CMake:                       3.22.5
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf quirc tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.2-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp36-cp36m/bin/python3.6 (ver 3.6.15)
    Libraries:                   libpython3.6m.a (ver 3.6.15)
    numpy:                       /opt/python/cp36-cp36m/lib/python3.6/site-packages/numpy/core/include (ver 1.19.3)
    install path:                python/cv2/python-3

  Python (for build):            /bin/python2.7

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.6/cmake-install
-----------------------------------------------------------------

[DEBUG:0@0.025] global /io/opencv/modules/videoio/src/videoio_registry.cpp (197) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.025] global /io/opencv/modules/videoio/src/videoio_registry.cpp (221) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ INFO:0@0.026] global /io/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ WARN:0@0.026] global /io/opencv/modules/videoio/src/cap.cpp (130) open VIDEOIO(FFMPEG): trying capture filename='/dev/video0' ...
[ WARN:0@0.212] global /io/opencv/modules/videoio/src/cap.cpp (153) open VIDEOIO(FFMPEG): can't create capture
[DEBUG:0@0.213] global /io/opencv/modules/highgui/src/backend.cpp (120) createDefaultUIBackend UI: Initializing backend...
[DEBUG:0@0.213] global /io/opencv/modules/highgui/src/registry.impl.hpp (87) UIBackendRegistry UI: Builtin backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@0.213] global /io/opencv/modules/highgui/src/registry.impl.hpp (112) UIBackendRegistry UI: Available backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[ INFO:0@0.213] global /io/opencv/modules/highgui/src/registry.impl.hpp (114) UIBackendRegistry UI: Enabled backends(3, sorted by priority): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@0.213] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK (priority=1000)
[DEBUG:0@0.213] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK plugin's glob is 'libopencv_highgui_gtk*.so', 1 location(s)
[DEBUG:0@0.214] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.214] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK
[DEBUG:0@0.215] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK3 (priority=990)
[DEBUG:0@0.215] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK3 plugin's glob is 'libopencv_highgui_gtk3*.so', 1 location(s)
[DEBUG:0@0.216] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.216] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK3
[DEBUG:0@0.216] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK2 (priority=980)
[DEBUG:0@0.216] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK2 plugin's glob is 'libopencv_highgui_gtk2*.so', 1 location(s)
[DEBUG:0@0.217] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@0.218] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK2
[DEBUG:0@0.218] global /io/opencv/modules/highgui/src/backend.cpp (106) createUIBackend UI: fallback on builtin code: QT5
[ INFO:0@0.302] global /io/opencv/modules/core/src/trace.cpp (882) ~TraceManager Trace: Total events: 7
[ WARN:0@0.302] global /io/opencv/modules/core/src/trace.cpp (886) ~TraceManager Trace: Total skipped events: 6
kallaballa commented 1 year ago

I have to read into the V4L2 api to interprete what is going on. I'll get back to you

cruzer77 commented 1 year ago

Thank you. Appreciate all the help.

kallaballa commented 1 year ago

I think you might be unto something.

According to the V4L2 docs The following line basically means that OpenCV tried to grab data while there was none queued and should try again to queue data, if i understood correctly.

[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)

There is handling in the code for that but it only handles EIO (5): https://github.com/opencv/opencv/blob/1ba0984203ab10c9356c56abf4146707bf8e925d/modules/videoio/src/cap_v4l.cpp#L1026-L1031

@alalek: who knows more about the v4l2 implementatiton?

kallaballa commented 1 year ago

Actually EIO should be handled differently since it signals an internal error. I'll create a branch that replaces EIO with EAGAIN for you to try out.

kallaballa commented 1 year ago

Are you familiar with building from a custom branch? https://github.com/kallaballa/opencv/tree/v4l2_requeue_on_EAGAIN If not I'll guide you through

itspalomo commented 1 year ago

Thank you, I have not done so, at least not on a huge project like this, nor built from source. I would appreciate the guidance.

kallaballa commented 1 year ago

I will try to get you quickly up to speed, but don't worry - if anything doesn't work just ask :)

itspalomo commented 1 year ago

Thank you for the guidance, here is the output for cmake..


ubuntu@ubuntu:~/ros2_ws/opencv/build$ cmake ..
-- 'Release' build type is used by default. Use CMAKE_BUILD_TYPE to specify build type (Release or Debug)
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detected processor: aarch64
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.18", minimum required is "2.7") 
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "2.7.18")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3.2") 
-- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.8.so (found suitable exact version "3.8.10") 
<string>:1: DeprecationWarning: 

  `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
  of the deprecation of `distutils` itself. It will be removed for
  Python >= 3.12. For older Python versions it will remain present.
  It is recommended to use `setuptools < 60.0` for those Python versions.
  For more details, see:
    https://numpy.org/devdocs/reference/distutils_status_migration.html 

-- Looking for ccache - not found
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WRETURN_TYPE
-- Performing Test HAVE_CXX_WRETURN_TYPE - Success
-- Performing Test HAVE_C_WRETURN_TYPE
-- Performing Test HAVE_C_WRETURN_TYPE - Success
-- Performing Test HAVE_CXX_WNON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WNON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WADDRESS
-- Performing Test HAVE_CXX_WADDRESS - Success
-- Performing Test HAVE_C_WADDRESS
-- Performing Test HAVE_C_WADDRESS - Success
-- Performing Test HAVE_CXX_WSEQUENCE_POINT
-- Performing Test HAVE_CXX_WSEQUENCE_POINT - Success
-- Performing Test HAVE_C_WSEQUENCE_POINT
-- Performing Test HAVE_C_WSEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WFORMAT_SECURITY
-- Performing Test HAVE_CXX_WFORMAT_SECURITY - Success
-- Performing Test HAVE_C_WFORMAT_SECURITY
-- Performing Test HAVE_C_WFORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Failed
-- Performing Test HAVE_CXX_WUNINITIALIZED
-- Performing Test HAVE_CXX_WUNINITIALIZED - Success
-- Performing Test HAVE_C_WUNINITIALIZED
-- Performing Test HAVE_C_WUNINITIALIZED - Success
-- Performing Test HAVE_CXX_WSUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WSUGGEST_OVERRIDE - Success
-- Performing Test HAVE_C_WSUGGEST_OVERRIDE
-- Performing Test HAVE_C_WSUGGEST_OVERRIDE - Failed
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_CXX_WNO_COMMENT
-- Performing Test HAVE_CXX_WNO_COMMENT - Success
-- Performing Test HAVE_C_WNO_COMMENT
-- Performing Test HAVE_C_WNO_COMMENT - Success
-- Performing Test HAVE_CXX_WIMPLICIT_FALLTHROUGH_3
-- Performing Test HAVE_CXX_WIMPLICIT_FALLTHROUGH_3 - Success
-- Performing Test HAVE_C_WIMPLICIT_FALLTHROUGH_3
-- Performing Test HAVE_C_WIMPLICIT_FALLTHROUGH_3 - Success
-- Performing Test HAVE_CXX_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_CXX_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW
-- Performing Test HAVE_C_WNO_STRICT_OVERFLOW - Success
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_PTHREAD
-- Performing Test HAVE_CXX_PTHREAD - Success
-- Performing Test HAVE_C_PTHREAD
-- Performing Test HAVE_C_PTHREAD - Success
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_C_FFUNCTION_SECTIONS
-- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_CXX_FDATA_SECTIONS
-- Performing Test HAVE_CXX_FDATA_SECTIONS - Success
-- Performing Test HAVE_C_FDATA_SECTIONS
-- Performing Test HAVE_C_FDATA_SECTIONS - Success
-- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp)
-- Performing Test HAVE_CPU_NEON_SUPPORT - Success
-- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CPU_FP16_SUPPORT - Success
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Success
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Failed
-- Performing Test HAVE_LINK_AS_NEEDED
-- Performing Test HAVE_LINK_AS_NEEDED - Success
-- Performing Test HAVE_LINK_NO_UNDEFINED
-- Performing Test HAVE_LINK_NO_UNDEFINED - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for memalign
-- Looking for memalign - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found suitable version "1.2.11", minimum required is "1.2.3") 
-- Found JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (found version "80") 
-- Found TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (found version "4.1.0") 
-- Found WebP: /usr/lib/aarch64-linux-gnu/libwebp.so  
-- The imported target "openjp2_static" references the file
   "/usr/lib/aarch64-linux-gnu/libopenjp2.a"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "openjpip" references the file
   "/usr/lib/aarch64-linux-gnu/libopenjpip.so.2.3.1"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "openjpip_server" references the file
   "/usr/lib/aarch64-linux-gnu/libopenjpip_server.a"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_decompress" references the file
   "/usr/bin/opj_decompress"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_compress" references the file
   "/usr/bin/opj_compress"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_dump" references the file
   "/usr/bin/opj_dump"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_jpip_addxml" references the file
   "/usr/bin/opj_jpip_addxml"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_server" references the file
   "/usr/bin/opj_server"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_dec_server" references the file
   "/usr/bin/opj_dec_server"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_jpip_transcode" references the file
   "/usr/bin/opj_jpip_transcode"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- The imported target "opj_jpip_test" references the file
   "/usr/bin/opj_jpip_test"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/aarch64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake"
but not all the files it references.

-- Found system OpenJPEG: openjp2 (found version "")
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/aarch64-linux-gnu/libpng.so (found version "1.6.37") 
-- Looking for /usr/include/libpng/png.h
-- Looking for /usr/include/libpng/png.h - found
-- Found OpenEXR: /usr/lib/aarch64-linux-gnu/libIlmImf.so
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY) 
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/aarch64-linux-gnu/libblas.so  
-- Looking for cheev_
-- Looking for cheev_ - not found
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Performing Test HAVE_CXX_WNO_DEPRECATED
-- Performing Test HAVE_CXX_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WNO_MISSING_PROTOTYPES - Failed
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WNO_SHADOW
-- Performing Test HAVE_CXX_WNO_SHADOW - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
-- Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS
-- Performing Test HAVE_CXX_WNO_UNUSED_LOCAL_TYPEDEFS - Success
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE
-- Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO
-- Performing Test HAVE_CXX_WNO_SIGN_PROMO - Success
-- Performing Test HAVE_CXX_WNO_UNDEF
-- Performing Test HAVE_CXX_WNO_UNDEF - Success
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE
-- Performing Test HAVE_CXX_WNO_TAUTOLOGICAL_UNDEFINED_COMPARE - Failed
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS
-- Performing Test HAVE_CXX_WNO_IGNORED_QUALIFIERS - Success
-- Performing Test HAVE_CXX_WNO_EXTRA
-- Performing Test HAVE_CXX_WNO_EXTRA - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION
-- Performing Test HAVE_CXX_WNO_UNUSED_FUNCTION - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE
-- Performing Test HAVE_CXX_WNO_UNUSED_CONST_VARIABLE - Success
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32
-- Performing Test HAVE_CXX_WNO_SHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF
-- Performing Test HAVE_CXX_WNO_INVALID_OFFSETOF - Success
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH
-- Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE - Success
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE
-- Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE - Failed
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
-- Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
-- Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS
-- Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- The imported target "vtkParseOGLExt" references the file
   "/usr/bin/vtkParseOGLExt-7.1"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/aarch64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "pvtk" references the file
   "/usr/bin/pvtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- Found VTK 7.1.1 (/usr/lib/cmake/vtk-7.1/UseVTK.cmake)
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
-- Performing Test HAVE_C_WNO_SHADOW
-- Performing Test HAVE_C_WNO_SHADOW - Success
-- Looking for dlerror in dl
-- Looking for dlerror in dl - found
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_C_WNO_IMPLICIT_FALLTHROUGH - Success
-- Performing Test HAVE_C_WNO_UNDEF
-- Performing Test HAVE_C_WNO_UNDEF - Success
-- Performing Test HAVE_C_WNO_SIGN_COMPARE
-- Performing Test HAVE_C_WNO_SIGN_COMPARE - Success
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES
-- Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success
-- ADE: Downloading v0.1.2a.zip from https://github.com/opencv/ade/archive/v0.1.2a.zip
-- Checking for module 'gtk+-3.0'
--   No package 'gtk+-3.0' found
-- Checking for module 'gtk+-2.0'
--   No package 'gtk+-2.0' found
-- Checking for module 'gthread-2.0'
--   Found gthread-2.0, version 2.64.6
-- Checking for modules 'libavcodec;libavformat;libavutil;libswscale'
--   Found libavcodec, version 58.54.100
--   Found libavformat, version 58.29.100
--   Found libavutil, version 56.31.100
--   Found libswscale, version 5.5.100
-- Checking for module 'libavresample'
--   Found libavresample, version 4.0.0
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-audio-1.0'
--   No package 'gstreamer-audio-1.0' found
-- Checking for module 'libdc1394-2'
--   Found libdc1394-2, version 2.2.5
-- Allocator metrics storage type: 'int'
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.ssse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_1.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin512.avx512_skx.cpp
-- Excluding from source files list: modules/imgproc/src/corner.avx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.lasx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/resize.lasx.cpp
-- Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp
-- Registering hook 'INIT_MODULE_SOURCES_opencv_dnn': /home/ubuntu/ros2_ws/opencv/modules/dnn/cmake/hooks/INIT_MODULE_SOURCES_opencv_dnn.cmake
-- opencv_dnn: filter out cuda4dnn source code
-- Excluding from source files list: modules/dnn/src/layers/fast_convolution/fast_convolution.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.rvv.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.lasx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/int8layers/layers_common.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/int8layers/layers_common.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/dnn/int8layers/layers_common.lasx.cpp
-- Excluding from source files list: modules/features2d/src/fast.avx2.cpp
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
-- highgui: using builtin backend: NONE
-- Found 'misc' Python modules from /home/ubuntu/ros2_ws/opencv/modules/python/package/extra_modules
-- Found 'mat_wrapper;utils' Python modules from /home/ubuntu/ros2_ws/opencv/modules/core/misc/python/package
-- Found 'gapi' Python modules from /home/ubuntu/ros2_ws/opencv/modules/gapi/misc/python/package
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL
-- Performing Test HAVE_CXX_WNO_OVERLOADED_VIRTUAL - Success
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD
-- Performing Test HAVE_CXX_WNO_UNUSED_PRIVATE_FIELD - Failed
-- Found 'misc' Python modules from /home/ubuntu/ros2_ws/opencv/modules/python/package/extra_modules
-- Found 'mat_wrapper;utils' Python modules from /home/ubuntu/ros2_ws/opencv/modules/core/misc/python/package
-- Found 'gapi' Python modules from /home/ubuntu/ros2_ws/opencv/modules/gapi/misc/python/package
-- 
-- General configuration for OpenCV 4.6.0-dev =====================================
--   Version control:               9fbac91c29
-- 
--   Platform:
--     Timestamp:                   2022-11-12T05:35:28Z
--     Host:                        Linux 5.4.0-1073-raspi aarch64
--     CMake:                       3.16.3
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
-- 
--   CPU/HW features:
--     Baseline:                    NEON FP16
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/c++  (ver 9.4.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching ts video videoio
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 java python2
--     Applications:                tests perf_tests apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI:                           NONE
--     GTK+:                        NO
--     VTK support:                 YES (ver 7.1.1)
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        /usr/lib/aarch64-linux-gnu/libwebp.so (ver encoder: 0x020e)
--     PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
--     TIFF:                        /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
--     JPEG 2000:                   OpenJPEG (ver 2.3.1)
--     OpenEXR:                     /usr/lib/aarch64-linux-gnu/libImath.so /usr/lib/aarch64-linux-gnu/libIlmImf.so /usr/lib/aarch64-linux-gnu/libIex.so /usr/lib/aarch64-linux-gnu/libHalf.so /usr/lib/aarch64-linux-gnu/libIlmThread.so (ver 2_3)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      YES (2.2.5)
--     FFMPEG:                      YES
--       avcodec:                   YES (58.54.100)
--       avformat:                  YES (58.29.100)
--       avutil:                    YES (56.31.100)
--       swscale:                   YES (5.5.100)
--       avresample:                YES (4.0.0)
--     GStreamer:                   NO
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.7)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.19.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/ubuntu/ros2_ws/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.8.10)
--     Libraries:                   /usr/lib/aarch64-linux-gnu/libpython3.8.so (ver 3.8.10)
--     numpy:                       /home/ubuntu/.local/lib/python3.8/site-packages/numpy/core/include (ver 1.23.4)
--     install path:                lib/python3.8/site-packages/cv2/python-3.8
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/ros2_ws/opencv/build
ubuntu@ubuntu:~/ros2_ws/opencv/build$ 
kallaballa commented 1 year ago

looks good!

now please change back into the opencv build directory

cd opencv/build

and start the build:

make -j4

this is going to take a while, but afterwards you can install it using following command

sudo make install
itspalomo commented 1 year ago

Awesome, I've started the build but will definitely take a long time. Is there an output of the make install command you would like me to post here? Does this replace the CV version I'm currently running with your custom branch to test?

kallaballa commented 1 year ago

Awesome, I've started the build but will definitely take a long time. Is there an output of the make install command you would like me to post here?

Only if it shows an obvious error.

Does this replace the CV version I'm currently running with your custom branch to test?

It installs it side by side. Your opencv resides in /usr/lib while the new opencv resides in /usr/local/lib once it is installed you can start your application by first setting the LD_LIBRARY_PATH variable to point the system to your new opencv install and then running your program.

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
yourProgram
itspalomo commented 1 year ago

After selecting the custom build, here is the error:

ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ python3 camtest.py 
[ WARN:0@10.258] global /io/opencv/modules/videoio/src/cap_v4l.cpp (1013) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
ret is False

Here is the debug output once enabling debug variables:

export OPENCV_LOG_LEVEL=DEBUG
export OPENCV_VIDEOIO_DEBUG=1
export OPENCV_VIDEOWRITER_DEBUG=1
export OPENCV_VIDEOCAPTURE_DEBUG=1
export OPENCV_DUMP_ERRORS=1
export OPENCV_DUMP_CONFIG=1
export OPENCV_TRACE=1

ubuntu@ubuntu:~/ros2_ws/bridgeroadinspectiondrone/image_processing$ python3 camtest.py 

OpenCV build configuration is:

General configuration for OpenCV 4.6.0 =====================================
  Version control:               4.6.0-dirty

  Platform:
    Timestamp:                   2022-06-07T12:50:51Z
    Host:                        Linux 4.9.140-tegra aarch64
    CMake:                       3.22.5
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf quirc tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.2-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp36-cp36m/bin/python3.6 (ver 3.6.15)
    Libraries:                   libpython3.6m.a (ver 3.6.15)
    numpy:                       /opt/python/cp36-cp36m/lib/python3.6/site-packages/numpy/core/include (ver 1.19.3)
    install path:                python/cv2/python-3

  Python (for build):            /bin/python2.7

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.6/cmake-install
-----------------------------------------------------------------

[DEBUG:0@0.030] global /io/opencv/modules/videoio/src/videoio_registry.cpp (197) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.030] global /io/opencv/modules/videoio/src/videoio_registry.cpp (221) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ INFO:0@0.030] global /io/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ WARN:0@0.030] global /io/opencv/modules/videoio/src/cap.cpp (244) open VIDEOIO(V4L2): trying capture cameraNum=0 ...
[DEBUG:0@0.030] global /io/opencv/modules/videoio/src/cap_v4l.cpp (910) open VIDEOIO(V4L2:/dev/video0): opening...
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (926) open VIDEOIO(V4L2:/dev/video0): deviceHandle=5
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYCAP(2154321408), failIfBusy=1)
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYCAP(2154321408), ...) => 0    errno=0 (Success)
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_FMT(3234878980), failIfBusy=1)
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_FMT(3234878980), ...) => 0    errno=0 (Success)
[DEBUG:0@0.216] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981), failIfBusy=1)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...) => 0    errno=0 (Success)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_PARM(3234616854), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_PARM(3234616854), ...) => 0    errno=0 (Success)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_PARM(3234616853), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_PARM(3234616853), ...) => 0    errno=0 (Success)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (615) setFps VIDEOIO(V4L2:/dev/video0): FPS=9/1
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.231] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.231] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[ WARN:0@0.231] global /io/opencv/modules/videoio/src/cap.cpp (256) open VIDEOIO(V4L2): created, isOpened=1
[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.233] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.233] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.233] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.233] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.233] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.233] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMON(1074026002), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMON(1074026002), ...) => 0    errno=0 (Success)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_DQBUF(3227014673), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)
[ WARN:0@10.249] global /io/opencv/modules/videoio/src/cap_v4l.cpp (1013) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[DEBUG:0@10.249] global /io/opencv/modules/videoio/src/cap_v4l.cpp (949) read_frame_v4l2 VIDEOIO(V4L2:/dev/video0): can't read frame (VIDIOC_DQBUF): errno=0 (Success)
ret is False
[DEBUG:0@10.249] global /io/opencv/modules/highgui/src/backend.cpp (120) createDefaultUIBackend UI: Initializing backend...
[DEBUG:0@10.250] global /io/opencv/modules/highgui/src/registry.impl.hpp (87) UIBackendRegistry UI: Builtin backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@10.250] global /io/opencv/modules/highgui/src/registry.impl.hpp (112) UIBackendRegistry UI: Available backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[ INFO:0@10.250] global /io/opencv/modules/highgui/src/registry.impl.hpp (114) UIBackendRegistry UI: Enabled backends(3, sorted by priority): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@10.250] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK (priority=1000)
[DEBUG:0@10.250] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK plugin's glob is 'libopencv_highgui_gtk*.so', 1 location(s)
[DEBUG:0@10.252] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@10.252] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK
[DEBUG:0@10.252] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK3 (priority=990)
[DEBUG:0@10.252] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK3 plugin's glob is 'libopencv_highgui_gtk3*.so', 1 location(s)
[DEBUG:0@10.254] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@10.254] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK3
[DEBUG:0@10.254] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK2 (priority=980)
[DEBUG:0@10.255] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK2 plugin's glob is 'libopencv_highgui_gtk2*.so', 1 location(s)
[DEBUG:0@10.256] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@10.256] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK2
[DEBUG:0@10.256] global /io/opencv/modules/highgui/src/backend.cpp (106) createUIBackend UI: fallback on builtin code: QT5
[DEBUG:0@10.257] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMOFF(1074026003), failIfBusy=1)
[DEBUG:0@10.262] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMOFF(1074026003), ...) => 0    errno=0 (Success)
[DEBUG:0@10.262] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0@10.262] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0@10.262] global /io/opencv/modules/videoio/src/cap_v4l.cpp (461) closeDevice VIDEOIO(V4L2:/dev/video0): close(5)
[ INFO:0@10.351] global /io/opencv/modules/core/src/trace.cpp (882) ~TraceManager Trace: Total events: 8
[ WARN:0@10.351] global /io/opencv/modules/core/src/trace.cpp (886) ~TraceManager Trace: Total skipped events: 7
kallaballa commented 1 year ago

Welcome back! I think there's a little mistake somewhere because you seem to still be using the old 4.6.0 install. If you were using the new build the fields "Version control" and "Timestamp" would be updated:

OpenCV build configuration is:

General configuration for OpenCV 4.6.0 =====================================
  Version control:               4.6.0-dirty

  Platform:
    Timestamp:                   2022-06-07T12:50:51Z

Did you maybe forget to sudo make install? Or maybe you forgot to set the library path right before you run your command export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH?

If you didn't forget, could you please post the result of

ls -ltrh /usr/local/lib
itspalomo commented 1 year ago

Apologies for the delay, we have been running tests on different aspects of our project and haven't had time to setup the testbench again until now. You were right! I forgot to do a sudo make install , however, after doing so and setting the library path, it still used the official release, am I missing a step? here is my terminal. Thanks again for all the help.


ubuntu@ubuntu:~/ros2_ws/opencv/build$ ls -ltrh /usr/local/lib
total 29M
drwxrwsr-x 4 root staff 4.0K Aug  7 02:54 python2.7
-rw-r--r-- 1 root root  112K Sep  6 20:52 libseek.so
-rw-r--r-- 1 root root  4.3M Nov 12 06:18 libopencv_core.so.4.6.0
-rw-r--r-- 1 root root  625K Nov 12 06:20 libopencv_flann.so.4.6.0
-rw-r--r-- 1 root root  625K Nov 12 06:21 libopencv_ml.so.4.6.0
-rw-r--r-- 1 root root  4.5M Nov 12 06:27 libopencv_imgproc.so.4.6.0
-rw-r--r-- 1 root root  637K Nov 12 06:31 libopencv_photo.so.4.6.0
-rw-r--r-- 1 root root  497K Nov 12 06:32 libopencv_imgcodecs.so.4.6.0
-rw-r--r-- 1 root root  815K Nov 12 06:33 libopencv_features2d.so.4.6.0
-rw-r--r-- 1 root root  661K Nov 12 06:37 libopencv_videoio.so.4.6.0
-rw-r--r-- 1 root root  227K Nov 12 06:39 libopencv_highgui.so.4.6.0
-rw-r--r-- 1 root root  2.1M Nov 12 06:51 libopencv_calib3d.so.4.6.0
-rw-r--r-- 1 root root  7.0M Nov 12 07:07 libopencv_dnn.so.4.6.0
-rw-r--r-- 1 root root  639K Nov 12 07:36 libopencv_objdetect.so.4.6.0
-rw-r--r-- 1 root root  773K Nov 12 07:38 libopencv_stitching.so.4.6.0
-rw-r--r-- 1 root root  604K Nov 12 07:41 libopencv_video.so.4.6.0
-rw-r--r-- 1 root root  4.6M Nov 12 07:55 libopencv_gapi.so.4.6.0
-rw-r--r-- 1 root root   86K Nov 17 19:51 libuvc.so
drwxr-xr-x 4 root root  4.0K Nov 17 20:08 cmake
lrwxrwxrwx 1 root root    23 Nov 17 20:08 libopencv_core.so.406 -> libopencv_core.so.4.6.0
lrwxrwxrwx 1 root root    21 Nov 17 20:08 libopencv_core.so -> libopencv_core.so.406
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_flann.so.406 -> libopencv_flann.so.4.6.0
lrwxrwxrwx 1 root root    22 Nov 17 20:08 libopencv_flann.so -> libopencv_flann.so.406
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_imgproc.so.406 -> libopencv_imgproc.so.4.6.0
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_imgproc.so -> libopencv_imgproc.so.406
lrwxrwxrwx 1 root root    21 Nov 17 20:08 libopencv_ml.so.406 -> libopencv_ml.so.4.6.0
lrwxrwxrwx 1 root root    19 Nov 17 20:08 libopencv_ml.so -> libopencv_ml.so.406
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_photo.so.406 -> libopencv_photo.so.4.6.0
lrwxrwxrwx 1 root root    22 Nov 17 20:08 libopencv_photo.so -> libopencv_photo.so.406
lrwxrwxrwx 1 root root    22 Nov 17 20:08 libopencv_dnn.so.406 -> libopencv_dnn.so.4.6.0
lrwxrwxrwx 1 root root    20 Nov 17 20:08 libopencv_dnn.so -> libopencv_dnn.so.406
lrwxrwxrwx 1 root root    29 Nov 17 20:08 libopencv_features2d.so.406 -> libopencv_features2d.so.4.6.0
lrwxrwxrwx 1 root root    27 Nov 17 20:08 libopencv_features2d.so -> libopencv_features2d.so.406
lrwxrwxrwx 1 root root    28 Nov 17 20:08 libopencv_imgcodecs.so.406 -> libopencv_imgcodecs.so.4.6.0
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_imgcodecs.so -> libopencv_imgcodecs.so.406
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_videoio.so.406 -> libopencv_videoio.so.4.6.0
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_videoio.so -> libopencv_videoio.so.406
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_calib3d.so.406 -> libopencv_calib3d.so.4.6.0
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_calib3d.so -> libopencv_calib3d.so.406
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_highgui.so.406 -> libopencv_highgui.so.4.6.0
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_highgui.so -> libopencv_highgui.so.406
lrwxrwxrwx 1 root root    28 Nov 17 20:08 libopencv_objdetect.so.406 -> libopencv_objdetect.so.4.6.0
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_objdetect.so -> libopencv_objdetect.so.406
lrwxrwxrwx 1 root root    28 Nov 17 20:08 libopencv_stitching.so.406 -> libopencv_stitching.so.4.6.0
lrwxrwxrwx 1 root root    26 Nov 17 20:08 libopencv_stitching.so -> libopencv_stitching.so.406
lrwxrwxrwx 1 root root    24 Nov 17 20:08 libopencv_video.so.406 -> libopencv_video.so.4.6.0
lrwxrwxrwx 1 root root    22 Nov 17 20:08 libopencv_video.so -> libopencv_video.so.406
lrwxrwxrwx 1 root root    23 Nov 17 20:08 libopencv_gapi.so.406 -> libopencv_gapi.so.4.6.0
lrwxrwxrwx 1 root root    21 Nov 17 20:08 libopencv_gapi.so -> libopencv_gapi.so.406
drwxrwsr-x 4 root staff 4.0K Nov 17 20:08 python3.8
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export OPENCV_LOG_LEVEL=DEBUG
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export OPENCV_VIDEOIO_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export OPENCV_VIDEOWRITER_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export OPENCV_VIDEOCAPTURE_DEBUG=1
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export OPENCV_DUMP_ERRORS=1
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export OPENCV_DUMP_CONFIG=1
ubuntu@ubuntu:~/ros2_ws/opencv/build$ export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
ubuntu@ubuntu:~/ros2_ws/opencv/build$ cd ..
ubuntu@ubuntu:~/ros2_ws/opencv$ cd ..
ubuntu@ubuntu:~/ros2_ws$ python3 bridgeroadinspectiondrone/image_processing/camtest.py 

OpenCV build configuration is:

General configuration for OpenCV 4.6.0 =====================================
  Version control:               4.6.0-dirty

  Platform:
    Timestamp:                   2022-06-07T12:50:51Z
    Host:                        Linux 4.9.140-tegra aarch64
    CMake:                       3.22.5
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf quirc tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.2-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp36-cp36m/bin/python3.6 (ver 3.6.15)
    Libraries:                   libpython3.6m.a (ver 3.6.15)
    numpy:                       /opt/python/cp36-cp36m/lib/python3.6/site-packages/numpy/core/include (ver 1.19.3)
    install path:                python/cv2/python-3

  Python (for build):            /bin/python2.7

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.6/cmake-install
-----------------------------------------------------------------

[DEBUG:0@0.034] global /io/opencv/modules/videoio/src/videoio_registry.cpp (197) VideoBackendRegistry VIDEOIO: Builtin backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[DEBUG:0@0.034] global /io/opencv/modules/videoio/src/videoio_registry.cpp (221) VideoBackendRegistry VIDEOIO: Available backends(7): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ INFO:0@0.035] global /io/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); UEYE(940)
[ WARN:0@0.035] global /io/opencv/modules/videoio/src/cap.cpp (244) open VIDEOIO(V4L2): trying capture cameraNum=0 ...
[DEBUG:0@0.035] global /io/opencv/modules/videoio/src/cap_v4l.cpp (910) open VIDEOIO(V4L2:/dev/video0): opening...
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (926) open VIDEOIO(V4L2:/dev/video0): deviceHandle=5
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYCAP(2154321408), failIfBusy=1)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYCAP(2154321408), ...) => 0    errno=0 (Success)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_FMT(3234878980), failIfBusy=1)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_FMT(3234878980), ...) => 0    errno=0 (Success)
[DEBUG:0@0.223] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981), failIfBusy=1)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...) => 0    errno=0 (Success)
[DEBUG:0@0.230] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_PARM(3234616854), failIfBusy=1)
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_PARM(3234616854), ...) => 0    errno=0 (Success)
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_PARM(3234616853), failIfBusy=1)
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_PARM(3234616853), ...) => 0    errno=0 (Success)
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (615) setFps VIDEOIO(V4L2:/dev/video0): FPS=9/1
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0@0.237] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665), ...) => 0    errno=0 (Success)
[ WARN:0@0.238] global /io/opencv/modules/videoio/src/cap.cpp (256) open VIDEOIO(V4L2): created, isOpened=1
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.238] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.239] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.239] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.239] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671), failIfBusy=1)
[DEBUG:0@0.239] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...) => 0    errno=0 (Success)
[DEBUG:0@0.239] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMON(1074026002), failIfBusy=1)
[DEBUG:0@0.243] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMON(1074026002), ...) => 0    errno=0 (Success)
[DEBUG:0@0.244] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_DQBUF(3227014673), failIfBusy=1)
[DEBUG:0@0.244] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)
[ WARN:0@10.253] global /io/opencv/modules/videoio/src/cap_v4l.cpp (1013) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
[DEBUG:0@10.253] global /io/opencv/modules/videoio/src/cap_v4l.cpp (949) read_frame_v4l2 VIDEOIO(V4L2:/dev/video0): can't read frame (VIDIOC_DQBUF): errno=0 (Success)
ret is False
[DEBUG:0@10.254] global /io/opencv/modules/highgui/src/backend.cpp (120) createDefaultUIBackend UI: Initializing backend...
[DEBUG:0@10.257] global /io/opencv/modules/highgui/src/registry.impl.hpp (87) UIBackendRegistry UI: Builtin backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@10.257] global /io/opencv/modules/highgui/src/registry.impl.hpp (112) UIBackendRegistry UI: Available backends(3): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[ INFO:0@10.257] global /io/opencv/modules/highgui/src/registry.impl.hpp (114) UIBackendRegistry UI: Enabled backends(3, sorted by priority): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(QT5)
[DEBUG:0@10.257] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK (priority=1000)
[DEBUG:0@10.257] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK plugin's glob is 'libopencv_highgui_gtk*.so', 1 location(s)
[DEBUG:0@10.258] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@10.258] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK
[DEBUG:0@10.258] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK3 (priority=990)
[DEBUG:0@10.258] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK3 plugin's glob is 'libopencv_highgui_gtk3*.so', 1 location(s)
[DEBUG:0@10.259] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@10.259] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK3
[DEBUG:0@10.259] global /io/opencv/modules/highgui/src/backend.cpp (78) createUIBackend UI: trying backend: GTK2 (priority=980)
[DEBUG:0@10.259] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (220) getPluginCandidates UI: GTK2 plugin's glob is 'libopencv_highgui_gtk2*.so', 1 location(s)
[DEBUG:0@10.259] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (230) getPluginCandidates     - /home/ubuntu/.local/lib/python3.8/site-packages/cv2: 0
[DEBUG:0@10.259] global /io/opencv/modules/highgui/src/plugin_wrapper.impl.hpp (234) getPluginCandidates Found 0 plugin(s) for GTK2
[DEBUG:0@10.260] global /io/opencv/modules/highgui/src/backend.cpp (106) createUIBackend UI: fallback on builtin code: QT5
[DEBUG:0@10.260] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMOFF(1074026003), failIfBusy=1)
[DEBUG:0@10.263] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMOFF(1074026003), ...) => 0    errno=0 (Success)
[DEBUG:0@10.263] global /io/opencv/modules/videoio/src/cap_v4l.cpp (968) tryIoctl VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216), failIfBusy=1)
[DEBUG:0@10.263] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216), ...) => 0    errno=0 (Success)
[DEBUG:0@10.263] global /io/opencv/modules/videoio/src/cap_v4l.cpp (461) closeDevice VIDEOIO(V4L2:/dev/video0): close(5)
[ INFO:0@10.362] global /io/opencv/modules/core/src/trace.cpp (882) ~TraceManager Trace: Total events: 8
[ WARN:0@10.362] global /io/opencv/modules/core/src/trace.cpp (886) ~TraceManager Trace: Total skipped events: 7
kallaballa commented 1 year ago

Could you please, in a python console, run the following?

import sys
print '\n'.join(sys.path)
itspalomo commented 1 year ago

Hello, here is the output:

ubuntu@ubuntu:~/ros2_ws$ python3
Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print '\n'.join(sys.path)
  File "<stdin>", line 1
    print '\n'.join(sys.path)
          ^
SyntaxError: invalid syntax
>>> print('\n'.join(sys.path))

/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/home/ubuntu/.local/lib/python3.8/site-packages
/usr/local/lib/python3.8/dist-packages
/usr/lib/python3/dist-packages
/usr/lib/python3.8/dist-packages
>>> 

To give a bigger update, I ended up using a different camera, the SeekThermal Compact Pro which can interface nicely with the library libseek-thermal, which also uses OpenCV to open the videocapture object, I think anyways haha. Thank you so much for the help @kallaballa ! We truly do appreciate all the time you've spent trying to debug this for us, once I get the original camera back that was causing issues I can jump back on trying to figure this out, would be nice. Should I close the issue then reopen once I get the device back?

Thank you once again.

kallaballa commented 1 year ago

Hehe alright. Cya!

kallaballa commented 1 year ago

I think you might be unto something.

According to the V4L2 docs The following line basically means that OpenCV tried to grab data while there was none queued and should try again to queue data, if i understood correctly.

[DEBUG:0@0.232] global /io/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...) => -1    errno=11 (Resource temporarily unavailable)

There is handling in the code for that but it only handles EIO (5):

https://github.com/opencv/opencv/blob/1ba0984203ab10c9356c56abf4146707bf8e925d/modules/videoio/src/cap_v4l.cpp#L1026-L1031

@alalek: who knows more about the v4l2 implementatiton?

@alalek: I still think this is a bug but cannot reproduce without the hardware.

asmorkalov commented 1 year ago

Hello @kallaballa and @itspalomo Let me jump in and debug the issue step by step. UVC compatible cam should work in the same way on PC and Pi.

Shashi630 commented 5 months ago

@kallaballa

[ WARN:0] global ../modules/videoio/src/cap_v4l.cpp (998) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout. Floating point exception

stark@Shashivardhan:~/yolo-9000/darknet$ v4l2-ctl --list-devices UVC Camera (046d:0825) (usb-vhci_hcd.0-1): /dev/video0 /dev/video1 /dev/media0

--> this is the code void open_video_stream(const char f, int c, int w, int h, int fps) { cv::VideoCapture cap; if(f) cap = new cv::VideoCapture(f, cv::CAP_V4L2); else cap = new cv::VideoCapture(c, cv::CAP_V4L2); if(!cap->isOpened()) return 0; if(w) cap->set(cv::CAP_PROP_FRAME_WIDTH, 1280); if(h) cap->set(cv::CAP_PROP_FRAME_HEIGHT, 720); if(fps) cap->set(cv::CAP_PROP_FPS, fps); return (void ) cap; }

stark@Shashivardhan:~/yolo-9000/darknet/src$ v4l2-ctl --list-formats-ext --device /dev/video0 ioctl: VIDIOC_ENUM_FMT Type: Video Capture

    [0]: 'YUYV' (YUYV 4:2:2)
            Size: Discrete 640x480
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 160x120
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 176x144
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 320x176
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 320x240
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 352x288
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 432x240
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 544x288
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 640x360
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 752x416
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 800x448
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 800x600
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 864x480
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 960x544
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 960x720
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1024x576
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1184x656
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x720
                    Interval: Discrete 0.133s (7.500 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x960
                    Interval: Discrete 0.133s (7.500 fps)
                    Interval: Discrete 0.200s (5.000 fps)
    [1]: 'MJPG' (Motion-JPEG, compressed)
            Size: Discrete 640x480
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 160x120
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 176x144
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 320x176
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 320x240
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 352x288
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 432x240
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 544x288
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 640x360
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 752x416
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 800x448
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 800x600
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 864x480
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 960x544
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 960x720
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1024x576
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1184x656
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x720
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)
            Size: Discrete 1280x960
                    Interval: Discrete 0.033s (30.000 fps)
                    Interval: Discrete 0.040s (25.000 fps)
                    Interval: Discrete 0.050s (20.000 fps)
                    Interval: Discrete 0.067s (15.000 fps)
                    Interval: Discrete 0.100s (10.000 fps)
                    Interval: Discrete 0.200s (5.000 fps)

Please help me in this..