Paparazzi v2

This is my monitor at work:

Penguin Paparazzi

Coworkers passing by are beginning to think I’m somewhat vain. Don’t ask about that sumo camera. Just… nevermind.

Anyway, the second beta of Flash Player 10/Astro includes native support for cameras conforming to the Video4Linux v2 API (V4L2). The support is not complete, however, owing to the fact that there are dozens of different colorspaces that a V4L2 camera can provide to a user application. I suspect that this is a manifestation of the do-it-yourself spirit of Linux, i.e., if you need support for a particular format, you need to code it yourself.

So the first pass at V4L2 support in the Linux Flash Player contains handlers for quite a few different pixel formats. Only 2 of them have been tested so far. (I should point out that, of all the cameras in the picture above, only 2 work in V4L2 and also output a usable format.) The rest of the formats were just implemented blindly.

So I’m hoping to get your help in testing these formats.

My corporate masters have authorized me to release the source code for a small utility to gather basic data about a V4L2 camera:

An example run:

$ ./v4l2-formats /dev/video0
/dev/video0 is a V4L2 device named 'VF0410 Live! Cam Video IM Pro'
/dev/video0 is capable of video capture
/dev/video0 is capable of streaming capture
/dev/video0 supports 'YUV 4:2:2 (YUYV)' (raw format, V4L2_PIX_FMT_YUYV)
/dev/video0 supports 'MJPEG' (compressed format, V4L2_PIX_FMT_MJPEG)

Please download the utility and run it on each /dev/videoN device you have on your system. You will ideally have one such device for each camera attached to your system: /dev/video0, /dev/video1, etc. Then, go ahead and post the results in a comment below.

Also, it would help if you could test out the V4L2 capabilities of the current Flash Player 10 beta and let me know, along with the foregoing technical data, whether or not your camera gives you a picture through Flash, without crashing, and if it looks correct. Check out this snowfall SWF for a good example.

One more thing: If you include your email address in the form’s email field (not in the actual message content), and you report that your camera does not work correctly, I may contact you directly if I deem that you could be useful for collecting more data.

Technical notes: The official documentation recommends VIDIOC_TRY_FMT in order to determine camera capabilities. In my experience, VIDIOC_TRY_FMT lies. I have a camera that claims to support every format in V4L2. I found VIDIOC_ENUM_FMT to be more reliable.