Sorry, not enough resource to investigate all potential V4L2 apps.
Having a very quick look at the code, it is the 3 lines after the snippet you quote that may I needed.
Code: Select all
fmt.fmt.pix.width = 640;
fmt.fmt.pix.height = 480;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
V4L2_PIX_FMT_RGB24 is the pixel format that I was referring to. Look at the V4L2 spec (
http://hverkuil.home.xs4all.nl/spec/med ... -FMT-RGB24) for all the potential formats, although it looks like that app only supports RGB24 and strongly prefers VGA.
Code: Select all
if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_RGB24) {
printf("Libv4l didn't accept RGB24 format. Can't proceed.\n");
//exit(EXIT_FAILURE);
return;
}
if ((fmt.fmt.pix.width != 640) || (fmt.fmt.pix.height != 480))
printf("Warning: driver is sending image at %dx%d\n",
fmt.fmt.pix.width, fmt.fmt.pix.height);
I couldn't say why it wants VGA in particular, but that is the way it is set up.
Suffice to say the V4L2 driver does support images up to 5MPix in numerous formats (look through the table at
https://github.com/raspberrypi/linux/bl ... 5-camera.c starting line 72 for the list). It looks like your app may not.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.