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.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › How do I read individual frames from a movie file
Page Index Toggle Pages: 1
How do I read individual frames from a movie file? (Read 674 times)
How do I read individual frames from a movie file?
Mar 29th, 2009, 5:03pm
 
Hi everyone,

I'm new to processing but I found processing very easy to get started with my background in casual programming. Now I have some success processing still images (consecutive frames) that I exported from a video editing program. I really want to skip the video editing program and read frames from within processing. I did some searches on the forum but found a similar question without an answer. Here's the OP:
http://processing.org/discourse/yabb2/num_1231416595.html
All I want to to is to specify a movie file and ask for a particular frame and receive an image as a return value. Please disregard my reply on that post. It didn't work. Please help me. Thanks.
Re: How do I read individual frames from a movie file?
Reply #1 - Apr 18th, 2009, 5:35pm
 
check out the function jump() of the video library in the reference. it allows you to jump to a specific portion of the video. after going to a specific frame you can read its pixels[] and manipulate it to be displayed the way you want. for this it would probably be good to create another array to which you transfer the movie.pixels[] and from that newly created array you can manipulate each frame and finally print to the screen either using the pixels[] or creating a PImage and outputting it with the image() function.

furthermore:
you could export a jpg sequence of the video you want to use and read frames individually by accessing the images, for example.

you could even use processing, for example to export each frame as an image and, after doing so, you could retrieve each frame separately.

____
http://www.marginaliaproject.com
Page Index Toggle Pages: 1