[Webcam PIC] Chapter NUI-2.5.   Webcam Snaps Without JMF

 

This chapter does not appear in the book.

 

The previous chapter was about taking webcam snaps using the JMF (Java Media Framework). That functionality, wrapped up inside a JMFCapture class, is central to almost all the NUI examples in later chapters because it allows the webcam's video input to be processed as a sequence of images.

I've had a few e-mails complaining about JMFCapture, or to be more precise its reliance on JMF, a dinosaur that hasn't been updated since the last century. It can't play popular modern formats, such as MPEG-2, MPEG-4, Windows Media, RealMedia, or most QuickTime and Flash files. Its content editing functionality is feeble.

Well, that's all true, but not really relevant for JMFCapture, which only utilizes video capture, and relies on JMF's speed and cross-platform support. But this latter requirement is also becoming a problem – it appears to be impossible (or very, very difficult) to get JMF to run on the 64-bit version of Windows. There are forum postings explaining how to do it, and other posts claiming that the approach doesn't work!

Perhaps it's time to move on from dear old JMF. Not unsurprisingly, there are a number of alternatives, conveniently listed on the JMF Wikipedia page. In the past, I've recommended FMJ (an open-source project which is API-compatible with JMF), but that library is starting to age a bit as well, not having been updated since 2007. I've used Xuggler for a video watermarking project. But this chapter is about reimplementing JMFCapture using VLC and its Java binding, vlcj.

The resulting class, VLCCapture, is shown in action in the screenshot at the top of the page. It offers the same interface as JMFCapture, and so can be substituted for that class with a one (or two) line change to the calling application.

 

Downloads


Navigation:


Dr. Andrew Davison
E-mail: ad@fivedots.coe.psu.ac.th
Back to my home page