PS3 constant framerate

Hi,

we are trying to develop a musical app that takes video loops as input and maps them to play instruments. Constant framerate is critical to stay on tempo.

We were using PS3eye but found out that it doesn’t have a constant framerate. Tested it both on mac and windows, with two different PS3eyes, with different configurations (different video resolutions and camera framerates) but always got inconstant framerates.

Do all the webcams have the same issue?

Does anybody know if it is possible at all constat framerate from the PS3eye (or any other webcam for that matter)? Faster or lower framerate doesn’t really matter (although 24 fps would be great), we’re more concerned about constancy.

Were it not possible, any suggestions for a workaround?

Thanks in advance.

Have you tried setting ofSetVerticalSync(true) and ofSetFrameRate to your desired camera framerate? This probably wouldn’t be guaranteed however.

I am wondering if a DV/firewire device would give you more consistent results as they typically support timecode.

the ps3eye should have no problem giving you a constant framerate. the issue will only be if your app isn’t running fast enough to get all the frames, it might drop some.

recording and playback are two different problems. there’s always a tradeoff between latency and jitter. if you can have some latency, then you should buffer some frames of the video using ofTextures before playing back. that would be the most solid video player.

for recording, you’ll also want to have a buffer of the frames you’re getting. make sure your app is running as fast as possible (ofSetVerticalSync(false), which is default, and no ofSetFramerate(), also default). this way your app never drops any images from the camera.

other webcams besides the ps3eye can have variable framerates. the isight is a good example: in low light i’ve seen it go as low as 10 fps, but normally it runs around 30 fps.

We were considering moving to a DV/fierwire cam, but it’s kinda out of budget. We don’t have one. If there’s no other way we might buy it, but we’ll try everything else before.

jvcleave, we already tried different combinations of camera and oF framerates, but to no avail. Although we kept ofSetVerticalSync() always as false. Will try with true, and will also try kyle’s suggestion of no explicit framerate.

if this doesn’t work a frame buffer should solve it. Hadn’t thought of that. I reckon latency doesn’t really matter in this case. Thank you so much for the suggestion, kylemcdonald.

Just for the record, commenting out the ofSetFrameRate(60) call did the trick. I wonder why we never tried it :/.

PS3eye is now set to 60 fps, and ofSetVerticalSync() is false:

  
//	ofSetFrameRate(60);  
	ofSetVerticalSync(false);  

Frame rate now is pretty stable.

Thanks all for your help!

awesome! glad it worked. that just means that your app wasn’t running as fast as your camera.

if you need to explicitly set an unlimited framerate, you can also say ofSetFrameRate(0)

oddly enough, the former solution doesn’t work any more… it just worked once. Darn!

Will move on to the buffer.