More video capture pixel formats needed in Pygame's camera module

Issue #231 closed
happylyang
created an issue

I'm using EasyCap and its video capture pixel format is V4L2_PIX_FMT_UYVY. I've seen the code of Pygame's camera module and found only V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_YUYV and some other RGB formats are supported currently. Many thanks if you have time to add V4L2_PIX_FMT_UYVY support.

Comments (5)

  1. happylyang reporter

    I followed the instructions in the comments on top of the _camera.c,added the pixel format I need to v4l2_init_device and v4l2_process_image, and added functions which are very similar to V4L2_PIX_FMT_YUYV as you said(I just changed the bytes order when getting y,u,v from *src) to convert the between formats.And lastly,I had to use VIDIOC_S_STD to set the video standard(In my occassion I set it to V4L2_STD_PAL_M),then I can show images normally from the EasyCap.

  2. Log in to comment