tags:

views:

132

answers:

2

I have a video file which consists of series of rgb format images, for example:

video name : static_camera2.576v frame size : 480x368 frame rate : 12 frames/sec duration : 5 sec

I need to access each frame with starting frame as I and need to extract all frames so that I can calculate the Motion Vectors based on the previous frame – this is a similar to the block based MAD (mean absolute difference).

Any idea how to access each frame and then store them to manipulate them with the above given parameters?

A: 

A quick google search yielded the following result using the Java Media Framework. If you this does not support the codecs you want to use, then you will need to look into using JNI.

http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/FrameAccess.html

http://forums.sun.com/thread.jspa?threadID=421678

http://algoval.essex.ac.uk/software/video/JavaRTVK.html

broschb
+1  A: 

Use Xuggler to decode each video frame. Then get the raw data behind the YUV images using the IVideoPicture#getData() method. This returns an IBuffer object which allows you either to copy the raw data into and out of Java byte[] arrays, or directly access the native memory from Java.

Xuggle