Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
Java in General
Get Frame Rate and Resolution from a video file
Chia-you Chai
,
Greenhorn
Apr 08, 2010 11:12:38
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Hello, I want to get the frame rate, fps and resolution from a video file store in the local disk. Does any
java
api or library can help me to get such information ? Thanks a lot
Rob Spoor
,
Sheriff
staff
Apr 08, 2010 13:27:42
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Perhaps the Java Media Framework (JMF) can help you out.
Chia-you Chai
,
Greenhorn
Apr 15, 2010 21:20:33
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Finally JMF helps a lot. You can call the getFormat method by specify a locator instance.
public Format getFormat(MediaLocator locator) throws NoProcessorException, IOException { final Processor processor = Manager.createProcessor(locator); processor.configure(); final List fmts = new ArrayList(); processor.addControllerListener(new ControllerListener() { @Override public void controllerUpdate(ControllerEvent evt) { if (evt instanceof ConfigureCompleteEvent) { for (TrackControl o : processor.getTrackControls()) { fmts.add(o.getFormat()); } if (fmts.isEmpty()) { fmts.add(null); } processor.close(); } } }); while (fmts.isEmpty()) { try { Thread.sleep(100); } catch(InterruptedException ignored) {} } format = (Format) fmts.get(0); return format; }
Post by:
autobot
Your mind is under my control .... your will is now mine .... read this tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
This thread has been viewed 4025 times.
Similar Threads
Retrieving any frame from the video in the database.
C/C++ program to read an AVI file
Handy-Cam Features...
image from video file
How to get an image from .mp4 file
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:36:05
.