I want to generate a thumbnail preview of videos in Java. I'm mostly JMF and video manipulation alienated.
- Is there an easy way to do it?
- What about codecs? Will I have to deal with it?
- Any video type is suported? (including Quicktime)
I want to generate a thumbnail preview of videos in Java. I'm mostly JMF and video manipulation alienated.
@marcio - My own server-side app shells out to FFmpeg to do encoding. I'm 98.42% sure FFmpeg does snapshots, too. (It is an all singing, all dancing beast of a program. The command line options alone could fill a book.)
Check it out: ffmpeg.mplayerhq.hu
I tried Xuggler and JCodec; Both can generate the frame snapshot;
However, they cannot extract the orientation of the video properly (portrait video became landscape image); Anyone could help about this??
Well, since you're not stuck with JMF, have you considered Xuggler? Xuggler is a Java API that uses FFmpeg under the covers to do all video decoding and encoding. It's free and LGPL licensed.
In fact, we have a tutorial that shows How to Make Thumbnails of an Existing File
Are you sure that JMF is right for you? Unfortunately, it is not in particularly good shape. Unless you are already committed to JMF, you very well may want to investigate alternatives. Wikipedia has a decent overview at en.wikipedia.org/wiki/Java_Media_Framework
There seems to be a few examples out there that are far better than what I was going to send you.
See http://krishnabhargav.blogspot.com/2008/02/processing-videos-in-java.html.
I'd agree with Stu, however. If you can find a way to get what you want using some command-line tools (and run them using Commons-Exec), you might have a better overall solution than depending on what is essentially the Sanskrit of Java extensions.