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 › Is it possible to play video without crashing
Page Index Toggle Pages: 1
Is it possible to play video without crashing? (Read 826 times)
Is it possible to play video without crashing?
Dec 23rd, 2009, 10:33pm
 

Hi, I have a simple program that plays a sequence of videos. On every OS I've tried, it consumes more and more memory until it finally runs out and the operating system kills the Processing application. I've tried it on Windows and MacOSX. Here is the program. I tried sprinkling explicit System.gc() calls throughout the code, but that doesn't help. Am I doing something wrong?

import processing.video.*;

Movie movie;
String movieFileName =
"/Users/stein/Documents/Processing/summer05/Clips/MVI_1626.AVI";

void setup() {
size(320, 240, P2D);
movie = new Movie(this, movieFileName);
movie.play();
movie.speed(16.0);
}

void draw() {
if (movie.duration() == movie.time()) {
  movie.stop();
  movie = new Movie(this, movieFileName);
  movie.play();
  movie.speed(16.0);
}
image(movie, 0, 0);
}

void movieEvent(Movie m) {
m.read();
}
Re: Is it possible to play video without crashing?
Reply #1 - Dec 24th, 2009, 6:04am
 
why do you create all these movies in draw? are you trying to loop?
if so, you better do it with loop();
http://processing.org/reference/libraries/video/Movie_loop_.html

probably solves your problem.
Re: Is it possible to play video without crashing?
Reply #2 - Dec 24th, 2009, 7:11pm
 
I don't want to loop the same movie over and over. I just do that in the code here to make the example that triggers the bug smaller. Really, I play a different movie every time. So loop() doesn't solve the problem.
Re: Is it possible to play video without crashing?
Reply #3 - Dec 24th, 2009, 9:22pm
 
I filed a bug on this and here is the reply:

http://dev.processing.org/bugs/show_bug.cgi?id=1417

fry@processing.org changed:

         What    |Removed                     |Added
----------------------------------------------------------------------------
           Status|NEW                         |RESOLVED
        Component|core                        |libraries
       Resolution|                            |WONTFIX

------- Additional Comments From fry@processing.org  2009-12-24 06:28 -------
thanks for the report. i should note that we won't be fixing any more bugs in the video library, as quicktime for java is no longer supported by
apple. we'll be switching to a new version of the video library based on
gsvideo in the future, i recommend trying that out for the time being:
http://codeanticode.wordpress.com/category/gstreamer/
Page Index Toggle Pages: 1