#1 By: sandsandsand, March 22nd, 2007 22:44
i having a little trouble....i am trying to write the contents of a video buffer to a text file in order to process and sort the pixel info for an entire clip (not just a single frame). this maybe something totally stupid that i am over looking but i will tell you what i have under
int totalPixels = QTPLAYER->w * QTPLAYER->h * 4;
myfile << myBuffer[i];
seems like it should work right? this code works fake arrays (not the video buffer) but when i try and use the real thing, nothing happens? does anyone know something i don't? any suggestions appeciated!
#2 By: zach, March 23rd, 2007 02:06
which version of OF are you using? It looks like a workshop version.
We have changed fillBufferWithVideoData to getPixels()
so instead of the video player object filling a buffer up it just returns a pointer to the array of pixels.
Check the docs:
and the latest version:
also, the videoPlayer object returns now RGB array, not rgba, so you can change the * 4 to * 3...
let me know if that helps, and if not, I will take a look at the saving code.
#3 By: sandsandsand, March 24th, 2007 23:24
thanks, but i still can't get it to work......the rgb values printf out fine, i just can't get it to write to a file. i realize that this is not so much a question regarding openframeworks, but i have a feeling it has something to do with the way openframeworks programs run....any tips would be appreciated!
#4 By: zach, March 25th, 2007 03:08
can you post a zip of the source code?
#5 By: zach, March 25th, 2007 03:11
ps, also try using ofstream like this example:
especially: "ios::out | ios::binary"
It took me a long time to figure out that you have to open files to write to them either as binary or text. that example should work (in setup() ) of OF just to see some I/O working...
#6 By: sandsandsand, March 25th, 2007 10:46