aspose file tools*
The moose likes Java in General and the fly likes Video snapshot in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Video snapshot in java" Watch "Video snapshot in java" New topic
Author

Video snapshot in java

fahad siddiqui
Ranch Hand

Joined: Jun 14, 2006
Posts: 85
Can a program be developed in java, which would get the snapshot of the first frame of a video file programmatically?

Please provide some links or sample codes.

Thanks a lot in advance.
rohit leeta
Ranch Hand

Joined: May 02, 2007
Posts: 49
Looks like the job of JNI or JMF.

With JNI, you can develop a bridge to a native library to capture what you want. I guess ffmpeg library is a good choice for this aim. Check the url below as an example of this: http://sourceforge.net/projects/jffmpeg/

And if JMF supports this somehow, you can use it:
http://java.sun.com/products/java-media/jmf/


<a href="http://www.java-forums.org" target="_blank" rel="nofollow">Java Forums</a>
fahad siddiqui
Ranch Hand

Joined: Jun 14, 2006
Posts: 85
I didn't understand something, this library ffmpeg is a supporting library for Java. So using apis in this, the snapshot scenario can be achieved? Why would i need a native call?

Also, if i would need a native call, then would i have to write a system hook in C for screen capture or something like this? Please elaborate a little more on this.

I haven't been able to try the library, very busy currently.
rohit leeta
Ranch Hand

Joined: May 02, 2007
Posts: 49
As far as i know, you should try JMF first. IF it supports capturing for the video format you plan to use then there is no problem: you can use JMF.

But if it does not support this for that video format (You know codecs are also important) then you will need a more powerful solution and ffmpeg is a well know video processing library. I guess it will have that functionality but it is not written in Java which means you will need to bridge it or use an existing bridge for accessing it from Java.
fahad siddiqui
Ranch Hand

Joined: Jun 14, 2006
Posts: 85
Thanks, i will try it out in a couple of days and let you know.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Video snapshot in java