How to use usb webcam in H3??

Jump to: navigation, search
Revision as of 23 October 2017 at 11:38.
The highlighted comment was created in this revision.

How to use usb webcam in H3??

Because I use python opencv

>> cap = cv2.VideoCapture(0)

It doesn't capture webcam

How to solve this problem??

    11:52, 17 October 2017

    Hi

    I write information when I checked the usb webcam using Yocto v2.23.0.
    I don't understand your detailed environment, but I am glad if this is helpful for you.

    Environment:
    - H3 Starter Kit
    - Yocto v2.23.0
    - USB Webcam Logicool C920t

    1. Enable the following kernel config.
            Device Drivers --> Multimedia support  ---> [*] Media USB Adapters
                    [*] USB Video Class (UVC)
                    [*] UVC input events device support (NEW)
    
    2. Modify the gstreamer1.0-plugin-vspfilter
     # vi gst/vspfilter/vspfilterutils.c
       {GST_VIDEO_FORMAT_UYVY, V4L2_PIX_FMT_UYVY, V4L2_MBUS_FMT_AYUV8_1X32, 1},
    +  {GST_VIDEO_FORMAT_YUY2, V4L2_PIX_FMT_YUYV, V4L2_MBUS_FMT_AYUV8_1X32, 1},
    
    3. bitbake
    
    4. How to run
     Ex)
     # gst-launch-1.0 v4l2src device=/dev/video16 ! video/x-raw,width=1920,height=1080 ! vspfilter ! video/x-raw,format=BGRA ! waylandsink
    
     * videoN: Please set according to your environment.
       Ex) In case of M3 SK it was video8.
    
      04:38, 23 October 2017