Unable to access a logitech 270 webcam through openCV

asked 2020-07-12 14:58:16 -0500

Im running Ubuntu 18.04, OpenCV 2 Upon trying to use the regular VideoCapture(0), an error pops up as follows:

ROR: V4L2: Pixel format of incoming image is unsupported by OpenCV

Upon running $v4l2-ctl -d /dev/video0 --all , i got the following:

Driver Info (not using libv4l2):
    Driver name   : uvcvideo
    Card type     : UVC Camera (046d:0825)
    Bus info      : usb-0000:00:0c.0-2
    Driver version: 5.3.18
    Capabilities  : 0x84A00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps   : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height      : 800/600
    Pixel Format      : 'YUYV'
    Field             : None
    Bytes per Line    : 1600
    Size Image        : 960000
    Colorspace        : sRGB
    Transfer Function : Default (maps to sRGB)
    YCbCr/HSV Encoding: Default (maps to ITU-R 601)
    Quantization      : Default (maps to Limited Range)
    Flags             : 
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 800, Height 600
    Default     : Left 0, Top 0, Width 800, Height 600
    Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 800, Height 600
Selection: crop_bounds, Left 0, Top 0, Width 800, Height 600
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 20.000 (20/1)
    Read buffers     : 0

i believe the camera input is in the YUYV format. Is there any way i can access the input in this format , or will i have to convert it to another format to do so? Any suggestions at all will be very helpful

edit retag flag offensive close merge delete