Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Java library to use for record a video from a connected camera?

You would have thought that tere is a simple solution to this but there isn't :(

My application needs to capture a stream from a USB/firewire (or whatever is the connection) connected camera (result would be a file like output.flv). I would prefer that I can detect all connected cameras and choose which one to use (one or more at the same time --> one or more output files). Application has to be cross platform.

Found libraries:

  1. Xuggle - not very good camera support. Good for manipulating over images and video.
  2. JMF - an old API but if I can use it, I will. I don't see a MAC OS X link on downloads page.
  3. FMJ - looks like a better version of JMF but a can't find a way of installing it.
  4. LTI-CIVIL - FMJ uses it. It looks like it only captures images from camera (not video). I could use Xuggle to create a video from images taken from LTI-CIVIL. And like FMJ, it is difficult to install.

What are your suggestions on this one?

like image 252
vale4674 Avatar asked Nov 13 '22 20:11

vale4674


1 Answers

I'd recommend VLCj for this - it should be able to stream from webcams onto a Java canvas without any difficulties. It uses native code so you need to provide libvlc.so / dll but from there on it should work on all the major platforms (Windows, Mac, Linux).

You may need to look at out of process players for complete reliability which is a bit more complex (see here for my efforts so far) but once you've got that in place it should work fine.

like image 96
Michael Berry Avatar answered Dec 18 '22 06:12

Michael Berry