Reading pixels from a mov-file

Hi guys,

I’m trying to read pixels from a mov-file. I’ve openend the file like this:

ofVideoPlayer video_conversion;
video_conversion.loadMovie(path_to_movie);
ofPixels pixels = video_conversion.getPixels();
for (int i = 0; i < pixels.size();i++) {
		std::cout << pixels[i];
		if ((i % 20) && (i != 0)) {
			std::cout << std::endl;
		}
	}

The only thing printed is ‘=’-signs. Does anyone see something I’m doing wrong?

Hi! :slight_smile:

I don’t see .play() nor .update() in that code… see http://openframeworks.cc/documentation/video/ofVideoPlayer/ Using .isFrameNew() is probably a good idea.

I haven’t tested it, but I think it’s possible that the pixels are not available immediately (on the next line) after loading the video file. I would read the pixels inside the update() function.

have you looked at the videoPlayerExample that comes with the OF download?