however, seems like, the pointer is always pointing to the what videoGrabber.getPixels()…
You have pretty much hit the nail on the head with this, as this is what your code is doing. What you get from vidGrabber.getPixels() is a pointer that you are storing. What you want to do instead is to store the data pointed to by that pointer. Do something like this in update:
unsigned char *pixels = vidGrabber.getPixels();
//Make a place to store the data. Obviously pixels.size() won't work. You just need to get the number of stored bytes somehow. Maybe a function of vidGrabber can tell you the number of stored bytes?
vector<unsigned char> copyOfPixels(pixels.size());
//Copy the data over.
for (unsigned int i = 0; i < copyOfPixels.size(); i++) {
copyOfPixels[i] = pixels[i];
}
//videoFramesVector must be changed to be a vector< vector<unsigned char> >, i.e. a vector of vectors.
videoFramesVector.push_back(pixels);
//Note that it would be more efficient to create the copyOfPixels in place within videoFrameVector instead of pushing it here. Pushing causes an additional, unnecessary copy operation.