Search code examples
javavideoflv

How can I programmatically extract a preview image - like the first frame - from an FLV file in Java?


Updated:

Since my original request appears to be almost impossible, what's the next simplest solution? Invoke the swftools app? Make a JNI call to the ffmpeg lib?

Original:

This is related to "how to extract flash frames programmatically" but I am constrained to Java libraries only (and no JNI calls to C please). This also implies no calls to console apps like swftools. I'm looking for a pure Java (or at least JVM) solution.


Solution

  • Or if you want to do it directly from Java, you can use this code. It uses Xuggler, an open-source library for encoding and decoding video from java. Xuggler does use JNI behind the scenes to FFmpeg, but when using it that's totally invisible to you. Hop that helps.

    Art