Video Camera Controls API - java

I'm writing an Eclipse RCP that takes photographs with a movie camera. I'm getting the video feed using the Java Media Framework (JMF).
The camera I'm using is the Microsoft Lifecam Cinema camera. Edited to add: I'm developing on a Windows XP workstation.
The camera has pan, zoom, and tilt controls.
My question is, do these camera controls have an Application Programming Interface (API)?
I couldn't find anything with an Internet search. JMF doesn't have any methods for controlling a video camera that I could find.
While I'm using Java, I can wrap an API in another language using the Java Native Interface (JNI) if I must.

Before going the raw JNI way, i would instead suggest you take the jUSB route or the javax.usb one. From what I understand, your camera is a pure USB one, so it should be possible to drive it from such an API, no ?
Unfortunatly, as I'm unable to find any kind of reverse protocol infos, it seems like you'll have to guess how to drive it by yourself.

Related

keep audio pitch constant in javafx video player on changing speed

I have developed a video player using javafx but when I increase the rate of the player i.e the speed of the player using mediaPlayer.setRate(1.5) method, the speed of the video is increased, but the audio sounds like a chipmunk.
I need to implement functionality like with youtube where if we increase the speed, it doesn't sound like a chipmunk.
Please help me - what can I do to achieve this?
What java api, class or 3rd party library should I use in my program in order to modify the audio pitch whilst running the video.
Got solution
Use VLCJ : http://capricasoftware.co.uk/projects/vlcj
VLCJ is a java wrapper framework that uses native vlc libraries.
They have very nice documentation and examples on Github.
It also supports JavaFx.
Github link :
VlcJ : https://github.com/caprica
VlcJ - JavaFx : https://github.com/caprica/vlcj-javafx

Video Stream from a Camera rendered into JavaFX 2.0 MediaView

Since JavaFX2.0 has a media view is it somehow possible to live stream the camera feed into the Media component in real time? Since there is no camera API I am unaware of how to make this happen. Can we use another Java library to work with the camera and then stream the video in the MediaView
So is it possible, and if yes then how can we do it. May be by using any JavaAPI for camera and then streaming the video into the MediaView?
There is a Java library called Xuggle that is an open source solution for streaming video into Java applications. It is built on top of the ffmpeg libraries.
In my experience it will work with some implementations of the MPEG-2 and MPEG-4 codecs, but not others. If you were not aware, there are something like 800 different versions of those codecs and some of them end up sticking packets on the front, or in the middle, or at the end in order to force you to use their decoders when displaying the video. Up to, and perhaps including, the new JavaFX code there has been very little robust support for streaming video into Java.
You may want to explore doing something like embedding an instance of VLC in a JPanel and displaying that to your user. There are also libraries that attempt to allow some interaction between Flash and Java that could be used to approach this issue.
Good Luck!
It seems that in 2.0 you still cannot attach an external source for the video/audio streams. You need to create a file and provide an uri to this file to play video in the MediaView. Not acceptable for the capture video from the camera.
I did not do this in JavaFX 2.0 but in 1.3 we used to deliver just an image to the ImageView writing our own capturer/streamer. Possibly you can do this with any 3rd party lib.

Video - sound - sensor capture in Java

I would like to develop an application which would be able to capture video from a webcam, capture sound from a mic and capture movement if a proximity sensor is available.
Initially I want it to run on windows but if able I might want to make it work on android later on.
I'm looking for something pretty straight forward and easy to understand.
My research has led me to Java Media Framework but it is too old and abandoned.
FMJ seems also old.
JavaCV appears to have poor documentation available.
My goal is to make a home detection app which uses the camera imagery, mic sound and sensors to detect and analyze home invasion.
I might take a leap and do it in .NET or other object oriented programming languages if
easier solutions present themselves.
How should I approach this, what are your suggestions?
One Solution is use JavaCV. So you can develop your desktop application using java and later can be ported in to android with fewer changes. As you said JavaCV haven't rich documentation. But JavaCV is just a wrapper to a OpenCV. So you can read OpenCV documentaion and find the relevant method(function) names. The methods in JavaCV has almost same names as OpenCV. So you can try those methods in JavaCV.
Next solution is use .NET to develop the system. There you can use
AForge.NET a rich library for .NET or Emgu CV .NET wrapper
for OpenCV. But you will be facing a problem when creating the
android app. Because you have to build it from scratch.

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:
Xuggle - not very good camera support. Good for manipulating over images and video.
JMF - an old API but if I can use it, I will. I don't see a MAC OS X link on downloads page.
FMJ - looks like a better version of JMF but a can't find a way of installing it.
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?
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.
There really is no good camera support for Java. You will have to use native code, tailored for each platform, through JNI to get video capture for your project.
There's a related question here. Basically they're suggesting OpenCV wrapped with JNI.

What is the best approach to building a custom video player web browser plugin?

I need to stream multiple videos in a web browser and have them all be synchronized; I also need to be able to switch between audio channels on the fly. Despite a lot of research, it looks as though at present this is impossible using the current browser implementations of HTML5 video. Flash seems to have the same problem. There are forums full of people wanting to do on-the-fly, in-band audio and video switching with sync, and multi-video playback with sync, but no real way to do it.
It's in the HTML5 spec for the future, actually, but has no browser implementation yet.
So, I need to build a custom plugin or application.
What is the best approach to doing this? Would something like Google Web Toolkit be a good place to start? Is client-side Java a good approach to building something this custom but with ease of deployability (vs say OS-specific C++ plugins, for example)?
JavaFX 2(An official supported Java library) has a video player which I've seen modified interesting in a 3d world and basically doing what you want. Currently it only supports flv, but they probably change it like it was in JavaFX 1 and support what ever installed codecs on ones computer, once out of beta.
Edit: Checking over the video stuff again not totally sure on keeping things in sync when this is on there roadmap (http://javafx.com/roadmap/)
Synchronized Media and Animations
Sometimes applications need to have very tightly aligned media and
animation in a timeline. JavaFX 2.0 will provide support to tie a
timeline to a specific media stream such that events in the timeline
occur in sync with events in the media stream.

Categories

Resources