I want to show past scene which is few seconds ago in processing (capture cam)

At first, I though that if I use ‘delay’, I can play the camera that shows 10 seconds past scene however, it just slow down the rate I think,
Is there any code that make possible to show the scene which is ten seconds before…
in other words, if I stare at video, that video must be showing the scene that is before 10seconds before than present time.

//import processing.video.*; 
//Capture cam; 
 
//void setup() { 
//  size(500, 400); 
//  cam = new Capture(this);
//  cam.start(); 
//  //delay(500);
 
//} 
 
//void draw() { 
//  image(cam, 0, 0); 
//} 

//void captureEvent(Capture c) {
//  c.read();
//}
1 Like

Tricky

You want to store each image of the capture camera
with a time stamp (millis() command) in an Arraylist.

Parallel you want to analyze the arraylist and display the images which time stamp is older than 10000 millis. And you want to delete the image.

You can make a class:

ArrayList<ImageWithTimeStamp> list = new ArrayList();

....
....

class ImageWithTimeStamp {

PImage img; 
int timeStamp=millis();

ImageWithTimeStamp(PImage img_) {
    img=img_;
}

void display() {
    image(img, 0,0);
} 

boolean isTenSeconds() {
    return 
       millis()-timeStamp>=10000; 
}

// I think that's all that's necessary for the class 

} // class
//
1 Like

really appreciate for your solution, yet, I need interactive system…
such as a security cam with showing the scene that is 10seconds before when people see the screen…

1 Like