@@ -0,0 +1,1100 @@
+import io%0Afrom PIL import Image%0Aimport select%0Aimport v4l2capture%0Afrom base_camera import BaseCamera%0A%0A%0Aclass Camera(BaseCamera):%0A    %22%22%22Requires python-v4l2capture module: https://github.com/gebart/python-v4l2capture%22%22%22%0A%0A    video_source = %22/dev/video0%22%0A%0A    @staticmethod%0A    def frames():%0A        video = v4l2capture.Video_device(Camera.video_source)%0A        # Suggest an image size. The device may choose and return another if unsupported%0A        size_x = 640%0A        size_y = 480%0A        size_x, size_y = video.set_format(size_x, size_y)%0A        video.create_buffers(1)%0A        video.queue_all_buffers()%0A        video.start()%0A        bio = io.BytesIO()%0A%0A        try:%0A            while True:%0A                select.select((video,), (), ())  # Wait for the device to fill the buffer.%0A                image_data = video.read_and_queue()%0A                image = Image.frombytes(%22RGB%22, (size_x, size_y), image_data)%0A                image.save(bio, format=%22jpeg%22)%0A                yield bio.getvalue()%0A                bio.seek(0)%0A                bio.truncate()%0A        finally:%0A            video.close()%0A

Add support for python-v4l2capture 1.4.x (#47)