We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Extracting frames (Read 579 times)
Extracting frames
Jun 24th, 2009, 2:16pm
 
Could someone help me with these questions, please?

1. How do I count number of frames in my loaded video-file?
2. How do I extract them to save in a PImage array? Tried to use read(), but just can't convert void type into another...

Your help will be much appreciated.
Re: Extracting frames
Reply #1 - Jun 26th, 2009, 7:42am
 
1) the frameRate() function will your sketch frame rate, so you'll know how many frames you'll be counting in a certain time. another thing you could use is the frameCount() function that will return the number of frames you refreshed since the start of the program; so, for example, if you call frameCount() when a movie starts and you call it again when you trigger a certain event, with a simple difference you'll know how many frames were played from the start of the movie to the event.

2) with the standard video library, after you called the loop() function, inside draw() a simple img = myMovie; should work (never actually tried it: i'm on linux so i don't use the standard video library)
Page Index Toggle Pages: 1