groupgets / purethermal1-uvc-capture

USB Video Class capture examples for PureThermal 1 / PureThermal 2 FLIR Lepton Dev Kit
124 stars 81 forks source link

libv4l does not work on latest Raspberry Pi image ( 12/14/2018 ) #9

Closed phishstang65 closed 4 years ago

phishstang65 commented 5 years ago

I downloaded and install the very latest Raspbian on my Raspberry Pi 3, and followed all instructions on this Github. When I run the C++ v4l2 app, it fails with:

Libv4l didn't accept RGB24 format. Can't proceed

Also, the opencv-capture.py script fails as well with:

sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ./opencv-capture.py 
Testing for presense of camera #9...
HIGHGUI ERROR: V4L: index 9 is not correct!
Testing for presense of camera #8...
HIGHGUI ERROR: V4L: index 8 is not correct!
Testing for presense of camera #7...
HIGHGUI ERROR: V4L: index 7 is not correct!
Testing for presense of camera #6...
HIGHGUI ERROR: V4L: index 6 is not correct!
Testing for presense of camera #5...
HIGHGUI ERROR: V4L: index 5 is not correct!
Testing for presense of camera #4...
HIGHGUI ERROR: V4L: index 4 is not correct!
Testing for presense of camera #3...
HIGHGUI ERROR: V4L: index 3 is not correct!
Testing for presense of camera #2...
HIGHGUI ERROR: V4L: index 2 is not correct!
Testing for presense of camera #1...
HIGHGUI ERROR: V4L: index 1 is not correct!
Testing for presense of camera #0...
libv4l2: error set_fmt gave us a different result then try_fmt!
HIGHGUI ERROR: libv4l unable convert to requested pixfmt
libv4l2: error set_fmt gave us a different result then try_fmt!

How can I fix this? Thanks.

kekiefer commented 5 years ago

Are you using a Lepton 3? This example (which is very old) looks like it has a hard-coded 80x60 image format that should be set to 160x120 for the newer sensor.

phishstang65 commented 5 years ago

I'm using the latest Lepton 3 radiometric with the PureThermal2 USB/UVC board from here: https://groupgets.com/manufacturers/getlab/products/purethermal-2-flir-lepton-smart-i-o-module

I think it's a format thing because the OpenCV python script fails also without the frame size being set.

I tried capturing with v4l-ctl and it hangs on the capture:

pi@raspberrypi:/tmp $ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Capture
    Pixel Format: 'UYVY'
    Name        : UYVY 4:2:2
        Size: Discrete 160x120
            Interval: Discrete 0.111s (9.000 fps)

    Index       : 1
    Type        : Video Capture
    Pixel Format: 'Y16 '
    Name        : 16-bit Greyscale
        Size: Discrete 160x120
            Interval: Discrete 0.111s (9.000 fps)
        Size: Discrete 160x122
            Interval: Discrete 0.111s (9.000 fps)

    Index       : 2
    Type        : Video Capture
    Pixel Format: 'GREY'
    Name        : 8-bit Greyscale
        Size: Discrete 160x120
            Interval: Discrete 0.111s (9.000 fps)

    Index       : 3
    Type        : Video Capture
    Pixel Format: 'RGBP'
    Name        : 16-bit RGB 5-6-5
        Size: Discrete 160x120
            Interval: Discrete 0.111s (9.000 fps)

    Index       : 4
    Type        : Video Capture
    Pixel Format: 'BGR3'
    Name        : 24-bit BGR 8-8-8
        Size: Discrete 160x120
            Interval: Discrete 0.111s (9.000 fps)

pi@raspberrypi:/tmp $ 
pi@raspberrypi:/tmp $ 
pi@raspberrypi:/tmp $ 
pi@raspberrypi:/tmp $ v4l2-ctl --set-fmt-video=width=160,height=120,pixelformat=0
pi@raspberrypi:/tmp $ sudo v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=asdf.jpg

I'd appreciate any help figuring this out! Thanks.

kekiefer commented 4 years ago

Did you ever solve this problem?