linux:通过v4l2命令列出当前系统支持的camera图像format和帧率

个人实战:

linux:通过v4l2命令列出当前系统支持的camera图像format和帧率_第1张图片

“In Linux, command line utility v4l2-ctl displays all of a webcam’s natively supported formats – install it with sudo apt-get install v4l-utils, run it with v4l2-ctl -dX --list-formats-ext where X is the camera index as in /dev/videoX. These formats are reported to the v4l2 kernel module via uvcvideo module and they are supported natively by the webcam chipset. Only the listed formats are supported by v4l2, anything else would need to be coded by the user, and RGBs are very seldom provided, despite virtually all CCDs working in Bayer RGGB. The most common formats by far are YUV422 (YUYV or YUY2) and MJPEG, with a certain overlap: MJPEG achieve larger frame rates for large resolutions.

C++ code for listing the camera formats can be found in Chromium GetDeviceSupportedFormats() implementation for Linux here.

If you have to plug code to convert YUV to RGB I’d recommend libyuv which has been optimized for plenty of architectures.”

参考 :https://stackoverflow.com/questions/22563827/list-available-capture-formats

你可能感兴趣的:(camera)