Get webcam stream on Mac Os X in Java

I would like to receive the stream of the webcam of my Macbook (integrated iSight webcam).

I use Java and I don't know anything about Objective-C, so I'm looking for a "full-java" solution. I found some examples of classes, but they were made in 2005, and they do not work on my system.

+6
java macos webcam isight
source share
4 answers

Now I come across the same thing. I use VLCJ for my project and it works great on Windows, Linux Mint, Linux Ubuntu and Mac OSX Lion. As you probably read, VLCJ is a java wrapper around libvlc that the VLC player also uses.

The fact is that when you open the option of capturing a VLC player, it fills the combo box with available cameras (with a USB connection). But this is what the VLC player does only for itself, it does not give you an API for this. And if you do not pass the camera ID to VLCJ, VLC will use the system camera by default. I use VLCJ to stream from USB-connected cameras or the desktop to a file.

I had to find a way to โ€œscanโ€ USB cameras on my system, and this is something that depends on the OS.

In windows I use DirectShowJava .

On Linux, you just need to read / dev / video * for the available cameras, and if you want to display the user with a "convenient name", you can use video4linux4java

And the third, and the one that interests you the most, I have not tried it yet, but I will try with this: stack , example .

It would be better if libvlc would give this, since I do not need to use 3 more APIs (for 3 OS), and each of them can do what VLCJ can (only on this platform), and I use them just to read devices .

EDIT . The current official version of VLC is 1.1.x, and it has limited camera support on Mac. You can only work with the default Mac camera (iSight, FaceTime Built In) without sound. VLC 1.2.0 will be released very soon, and it will have much better Mac support (known about other connected cameras, desktop stream, audio). You can see my thread on the VideoLAN forum. I downloaded the VLC version for Mac version 1.2.0-git and it looks so cool and has a real โ€œMac feelโ€. You can download it from here . But keep in mind that this is a development version, and it drops a lot.

+5
source share
+1
source share

Have you tried JMF? You can start here

0
source share

I found the OpenIMAJ Core Video Capture Library, which works well on my MacBook, Windows PC, and Linux server. The disadvantage is that it has many dependencies.

So, I modified the OpenIMAJ code and made another package that does not need these crazy functions. You can get my code and demo application (open source bsd) from my website: http://www.sleepingdumpling.com/blog/download/jvideoinput/

The loan goes to OpenIMAJ and depositors.

So this is not impossible.

0
source share

All Articles