Archive for July, 2008

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.

Addessing Wmode Crashes

Firefox 3 is the first Firefox release for Linux that includes windowless mode (wmode) support. Unfortunately, there was a crashing issue related to wmode that a lot of people testing Flash Player 10 beta 2 have encountered, and on fairly major sites.

Great news: Thanks to the Firefox team, this issue has been solved. The fix has made its way into the Firefox nightly builds. You can download them at http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/.

The first build I know of that contains the fix is for 2008-07-08. So start with that one or later, until the next formal Firefox release. Ideally, wmode-related crashes should now be entirely Flash’s fault. But please, before reporting such crashes, be sure (using the About Firefox dialog) that you actually are using one of the very recent builds. And it wouldn’t hurt to be certain that you’re using the latest beta of the Flash Player by checking the “about:plugins” URL in the browser.

Turkish Localization! … also Wmode, V4L2

There’s a new beta for Flash Player 10 (Astro) available for Windows, Mac, and — you guessed it — Linux. Go get it in the lab. This beta is a big deal since it finally contains an important, oft-requested feature. I refer of course to Turkish localization.

Adobe Flash Player - Turkish Localization

I’d like to give a shout out to my Turkish open source pal, ─░smail. We didn’t forget about you!

Windowless Mode

Oh yeah, this beta also introduces some other features that may be of interest to some people. There’s this thing called windowless mode, a.k.a. wmode, a.k.a. transparency, a.k.a. proper stacking order, a.k.a. DHTML/JS menus unroll over a SWF vs. under, such as on the main Adobe website:

Adobe Flash Player - Windowless mode

A.k.a. fullscreen Flash overlay ads! Yes! They’re on Linux now. Let me tell you, I have never been so happy to see one as when I first got one to work in Linux. I suspect the novelty will wear off rather soon.

To be clear, there are 3 major modes for SWFs embedded in webpages: 1) Windowed mode, which is the only one supported by the Linux Flash Player up to this point; 2) windowless/transparent mode; 3) windowless/opaque mode. CommunityMX has this great, simple page that illustrates the differences between the 3 modes. (There are also 2 new wmodes introduced in Astro — direct and gpu — that are already supported in Linux where allowed by hardware.)

Thanks to both the Firefox and Opera teams for their support in implementing wmode. That’s right– this feature will work on both Firefox and Opera on Linux. For Firefox, you must have version 3. For Opera (as of this writing), you will need the latest beta of 9.50 Opera 9.50 release. Thanks also to Swfdec for implementing this feature concurrently, helping to attack wmode from many angles and bring Linux web browsing up to ~2002 standards.

Be advised that there are still some wmode-related problems, most notably this crash issue. Please report any other consistently crashing URLs.

Updated Camera Support (V4L2)

This Linux beta includes native support for the Video4Linux v2 (V4L2) camera API. When I started this journey 2 years ago, V4L2 was supposed to be the standard, but V4L1 still seemed to be used everywhere. The last 2 years have seen significant change in this regard and now V4L1 distros are nearly impossible to come by which, by extension, has made Flash’s camera support nigh useless on Linux. No more, since V4L2 is now supported. In fact, it is supported concurrently along with V4L1.

There is still some work to do on V4L2 and I will need some help with it. You might be able to help me with it, too. Details to come in a separate post.

Bonus! You can finally select from among multiple cameras installed on the system:

Flash camera select, localized in Swedish

Oh hey, the dialog is localized in another new language: Swedish. Which brings me to…

Extended Language Support

In addition to Turkish, there are other new languages supported too. The complete list is (alphabetically by language code): Czech, German, English, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Russian, Swedish, Turkish, and Chinese.

Speed and Stability

Additionally, we are also working hard on speed (using a number of quality Linux profiling tools to identify and optimize hot spots) and stability (boom). To that latter point, do you know my favorite kind of crash bugs? The ones that occur consistently on a particular URL. Please let me know about those. The less useful reports are the ones about purely random crashes. While those are definitely irritating, any programmer will tell you that such reports are not especially helpful. Identifying consistent crashes goes a long way towards addressing the more random crashes as well.

Go. Get testing.