[libcamera-devel] To get YUV or RGB preview buffer.

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Jul 7 14:23:18 CEST 2020


Hi Naidu,

On 07/07/2020 11:03, naidu nama wrote:
> Hi Team,
> 
> we are trying to apply algorithms on preview. We are using qcam code
> on ubuntu laptop with webcam.
> From the code,in the Processviewfinder->render->convert we observed
> that render format is MJPEG (JPEG).
> Looks like the format setting is happening in
> 
> config_ = camera_->generateConfiguration(roles);
> vfConfig.pixelFormat = format;(MJPEG)
> 
> Is there a way to get YUV or RGB preview buffer??

If qcam is being given an MJPEG image, I would expect that likely means
your webcam is providing an MJPEG stream by preference.


For example, my UVC camera on my laptop only provides MJPEG:

$ cam -c 1 -I
[196:02:32.973031764] [2524855]  INFO Camera camera_manager.cpp:283
libcamera v0.0.11+685-61f4296a
Using camera HP Wide Vision FHD Camera: HP W
0: 1920x1080-MJPEG
 * Pixelformat: MJPEG (176x144)-(1920x1080)/(+0,+0)
  - 176x144
  - 320x240
  - 352x288
  - 640x360
  - 640x480
  - 1280x720
  - 1920x1080

QCam handles this by using QT5 to decode each JPEG image for rendering.


Use the -I (info) flag on cam to list the formats supported by your device.
--
Kieran



> Thanks,
> naidu.
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list