PS3 Eye shoots double and triple frames
in
Integration and Hardware
•
1 year ago
Hey processors!
I got myself a PS3 Eye for doing some high-speed video shoots. It seems to run great with macam, and according to my video.available() request, the camera delivers something round 187 fps.
However, if i check the recorded footage, I notice that the camera gives me double (and often triple) frames resulting in a "real" framerate in the range of 60fps. I hope someone understands the problem and give me a hint for the fix! Heres the code:
----------------------------------------------------------------------------
import processing.video.*;
Capture video;
long msA, msB; // timestamps for measuring fps
float speed; // fps, referred to as "speed"
int frameNo; // framecounter
void setup() {
frameNo=0; // frame counter
size(320, 240); // size
frameRate(120); // framerate, should go up to 187 fps with the ps3 eye
video = new Capture(this, 320, 240, 120); // we go 120 here
msB=millis(); // initial time measuring
}
void draw() {
if (video.available()) { // check if there is a "new" frame
video.read(); // read the new frame
image(video,0,0); // display the frame
// measuring fps with a low-pass so the number has better readability
msA=millis(); // timestamp
speed=0.9*speed+0.1/(msA-msB)*1000; // could be better code, but makes u understand the low-pass
text(speed,10,15); // display fps
msB=msA; // timestamp gets old
// SAVING THE FRAME
save("IMG/IMG_"+nf(frameNo,10)+".jpg"); // saving as enumerated jpeg
frameNo++; // next frame
}
}
----------------------------------------------------------------------------
1