I need to create a video stream from a webcam in linux. i have good knowledge of Java, and I have tried JMF. But I find it to hard to install, and this will not be good when I need to deploy my apps. i know I could write some JNI glue between V4L and java, but before I reinvent the wheel,I wanted to know if anyone know of another API to capture video ?
It depends on what you want to do. Video in Linux is generally presented by the /dev/video devices. In many cases, the video stream in digital form can be captured as an ordinary binary stream just by opening and reading the appropriate device file.
For DTV video, streaming video is done in MPEG packets, so you have to be somewhat sensitive to the packets themselves, or you'll end up trying to use broken packets. Also, off-the-air streaming may contain bad packets, which should be discarded. The streaming protocol includes redundancies, so that's OK.
A good place to see some Java code that deals with DTV issues is the ProjectX video tool. You might also gain some insight by looking at the VLC program. It's not Java, but it's designed to route audit and video over a LAN.
An IDE is no substitute for an Intelligent Developer.
Joined: Jan 23, 2009
Thanks for the reply Tim. During the week end, I came across v4l4j (http://v4l4j.googlecode.com) which does exactly what I need (simple capture from a webcam, handing out JPEG-compressed frames !). Also, it allows me to control the pan and tilt of my logitech quickcam sphere, along with other standard video controls. More than what I wanted !
I thought i d share this with everybody on this forum.