how to make playmovie action faster?
hansgerd
I have an issue with playmovie action. I load a movie (either .mov or .avi works fine- 3000 images approximately 100x100 pixel) extremely fast, but than once I want to work with the images of the movie it takes extremely long. I had first tried to extract the files-which worked well but the speed was not appropriate. Searching for the reason I found that the " PlayMovieAction frame=n " is the reason why it takes so long- I am going through all pictures of the movie. How can I speed this up?
Thx for all suggestions in advance!!!!
Boris
So when you ask Igor for frame 200, first Igor looks at frame 0, then frame 1, and so forth all the way until 199, and then gives you frame 200. Then your code asks for frame 201 and Igor does it all over again.
There is not much that you can do to avoid this behavior. However, you can try to minimize its effects. Often the operating system will help you out by caching the file in RAM, but apparently that is not happening for you, or is not helping out as much as I would think.
So what you want to do is to read in the movie in chunks: when you loop over the movie, you start by reading in 100 frames (using PlayMovieAction extract=100), and processing directly from the M_MovieChunk wave that it creates. Then you read the next 100 frames and process those, and so on.
Basically you want to minimize the number of calls to PlayMovieAction. Even better is reading in the whole file at once, if you have enough RAM and it's not too large for a 32-bit address space (unless you're using 64-bit Igor)
August 10, 2011 at 04:30 pm - Permalink
Greets
Boris
August 11, 2011 at 05:52 am - Permalink