[Python] OpenCV capturing from a v4l2 device

I tried to set the capture format on a webcam from OpenCV's cv2.VideoCapture and ran into a problem: it's using the wrong IOCTL command.
So I used python-v4l2capture to get images from the device, which allows more control.
Here is the gist:


  • Alex Hu

    Thank you Roy! This saves me a lota trouble.
    For some reason, the frame is always None in my case. I am using a ubuntu machine with one on board webcam.