c++ - Mapping pixel formats from CVPixelBuffer to their equivalent V4L -


I need to map a range of OSX CoreVideo pixel formats, such as CVPixelBuffer.h V4L , kCVPixelFormatType_24RGB will be mapped to V4L2_PIX_FMT_RGB24 .

I tried to match using the four cc , but did not match the definition of OSX and V4L. In addition to inspecting your exact layout and manually matching them, there is a program or an information table, which will show me the example where the map for KVCPixelFormTap_422YIPCBCR8 ?

He said, there are very good comments in CVPixelBuffer.h and videodev2.h which allow you to match pixel format with confidence. The key to mapping certain formats is to understand that YUV and Y'CbCr are often used alternately, according to

Y'UV, YUV, YCbCr, YPbPr, etc. The scope of the terms is sometimes obscure and overlapping. Historically, YUV and Y'UV were used for the specific analog encoding of color information in the television system, while YCBCCR used digital encoding of appropriate color information for video and now-image compression and transmission such as MPEG and JPEG Was done for. Today, the term YUV is usually used to describe file-formats in the computer industry, which are encoded using YCbCr.

The V4L also has its pixel format, which can help to match the comments in CVPixelBuffer.h for V4L formats.

You have specifically asked that in view of this information, it should be mapped to V4L2_PIX_FMT_UYVY , which will map to KVCPixelFormTepDCB 2222 CSBCR8 . Below is a map of Core Video Pixel format, which is the V4L format built using this information. If no format is shown in the table, it means that it is not supported in both libraries. This information is not based on any real test, so it may be wrong.

Note that only 8-bit formats are common between two libraries. Even in those cases where they support the same 16 or 32-bit formats, they are not due to differences in the ends. For example, kCVPixelFormatType_16Gray does not map to V4L2_PIX_FMT_Y16 , since there is a large endian and a later small-endian.

| Core video | Video 4 linux | | KCVPClexFormatTip_16 BE 555 | V4L2_PIX_FMT_RGB555X | | KCVPxLFormType_16 LE555 | V4L2_PIX_FMT_RGB555 | KCVPxLFormType_16 BE 565 | V4L2_PIX_FMT_RGB565X | | Kcpxclass formtip_16 LE565 | V4L2_PIX_FMT_RGB565 | | KCVPxLormat Type-2RGB | V4L2_PIX_FMT_RGB24 | | KCVPx Formatting Type-4BGR | V4L2_PIX_FMT_BGR24 | | KCVPCsFormatType_32RGB | V4L2_PIX_FMT_RGB32 | | Kcpxcelformtip_32bgRA | V4L2_PIX_FMT_BGR32 | | KCVPixelformatypc 2222 Ypcbcr8 | V4L2_PIX_FMT_UYVY | | KCVPClexFormatTVWen2020USBCBCR8 Planner * | V4L2_PIX_FMT_YUV420 | | KCVPCcelCertyPCP2222UpcBCR8_UVs | V4L2_PIX_FMT_YUYV |

* The core video version has a large internal header in which the aircraft is located and how many bytes per line are in each plane. This is not in the V4L version, so you have to remove it to go from CoreVideo to V4L, and add it to go from V4L to core video.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -