Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Video snapshot in java

 
fahad siddiqui
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
fahad siddiqui
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, i will try it out in a couple of days and let you know.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic