Rohini
Rohini

Reputation: 11

How to play a video and capture the frames from it using java

How to play a video and capture the frames from it using java....I want to select a particular video by browsing in a dialog box... and then play it and want to capture the frames from that video.... using java

Upvotes: 1

Views: 202

Answers (2)

Gilbert Le Blanc
Gilbert Le Blanc

Reputation: 51445

Just follow these steps.

  • Decode the video. You'll have to create or find a decoder for every type of video you want to play. Here's a good Wikipedia article on video codecs to get you started.

  • Capture each frame from the video as an Image

  • Store the images on the disk.

You'll also have to build a complete Java Swing GUI to manage your video files and your image files. This Oracle tutorial should get you started learning Java Swing.

Oh, one last thought. Every second of video produces around 32 images. You might want to put an option in your process to only save every 10th frame, every 100th frame, or even every 1,000th frame.

Upvotes: 1

AlexR
AlexR

Reputation: 115328

You should use JMF - Java Media Framework. Take a look on this reference:http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html

It contains download links and tutorials.

Upvotes: 3

Related Questions