PS3EyeCapture tool for measuring input latency
Posted: Fri Feb 15, 2013 11:49 am
I recently started in on a new hobby project game engine in my spare time and wanted a way to keep an eye on the input latency. Counting video frames between input and on-screen reaction time is a common way to do that at this point, but I didn't have a traditional high-speed camera. Thankfully, Code Laboratories wrote a nice Windows driver for grabbing high-speed progressive input from a PS3 Eye camera (as many of us have used).
PS3EyeCapture is a simple program that uses the CL driver to capture up to ten seconds of 187fps QVGA greyscale video. Video frames are buffered in memory during capture and then written out to disk as a series of .bmp files labeled by time stamp. Each new capture session ends up in its own folder labeled by the date and time that capturing started.
Since I run the full-screen rendering tests and capturing the results on the same computer, PS3EyeCapture was designed to sit in the background of Windows and be controlled by global hot keys (Alt-Backspace to start/stop capturing and Alt-Escape to quit the program). It might be a little freaky for end-users at this point because the program literally disappears while it is running and the only visual indication of it working is the camera's red LED (which is lit when capturing video and blinks when writing the frames to disk after a capture).
It's nothing ground-breaking, but I thought it might be useful to someone else.![Smile :)](./images/smilies/icon_e_smile.gif)
The source code and current release are available under the MIT license from the PS3EyeCapture Google Code page.
Feature Roadmap:
* Console window for text output (and to let people know that the program is running)
* Configure camera parameters (frame rate, gain, exposure) and capture limit via command line
* Camera preview window, if people really want it
Version History:
Version 1.2 (02/15/2013):
* Use the first available camera that initializes properly (rather than quitting if any number other than one camera is connected).
* Updated the error message that shows when no cameras initialize to indicate that one could be attached but not available because it's already in use.
Version 1.1 (02/15/2013):
* The file name for a captured image is its time stamp in (fractional) milliseconds since the Win32 epoch.
* Removed the milliseconds value from the captured sequence directory name.
Version 1.0 (02/15/2013):
* Initial release
Attached is a selection of images dumped from PS3EyeCapture while I was testing the first version of the rendering code, which draws black until mouse input is detected (it then switches to drawing white). I included every fourth image from the captured sequence between when I started seeing the mouse move up to when the screen started to change, where I switched up to including every image. The captions were added manually for illustrative purposes.
(Yes, the latency in the rendering example is terrible, no I'm not using GPU fences or true full-screen mode yet, yes I'm using a wireless mouse, and yes I'm using an LCD rather than a CRT for these measurements. That's a separate project that will be improved in time, and I'll be able to tell you by how much.
)
PS3EyeCapture is a simple program that uses the CL driver to capture up to ten seconds of 187fps QVGA greyscale video. Video frames are buffered in memory during capture and then written out to disk as a series of .bmp files labeled by time stamp. Each new capture session ends up in its own folder labeled by the date and time that capturing started.
Since I run the full-screen rendering tests and capturing the results on the same computer, PS3EyeCapture was designed to sit in the background of Windows and be controlled by global hot keys (Alt-Backspace to start/stop capturing and Alt-Escape to quit the program). It might be a little freaky for end-users at this point because the program literally disappears while it is running and the only visual indication of it working is the camera's red LED (which is lit when capturing video and blinks when writing the frames to disk after a capture).
It's nothing ground-breaking, but I thought it might be useful to someone else.
![Smile :)](./images/smilies/icon_e_smile.gif)
The source code and current release are available under the MIT license from the PS3EyeCapture Google Code page.
Feature Roadmap:
* Console window for text output (and to let people know that the program is running)
* Configure camera parameters (frame rate, gain, exposure) and capture limit via command line
* Camera preview window, if people really want it
Version History:
Version 1.2 (02/15/2013):
* Use the first available camera that initializes properly (rather than quitting if any number other than one camera is connected).
* Updated the error message that shows when no cameras initialize to indicate that one could be attached but not available because it's already in use.
Version 1.1 (02/15/2013):
* The file name for a captured image is its time stamp in (fractional) milliseconds since the Win32 epoch.
* Removed the milliseconds value from the captured sequence directory name.
Version 1.0 (02/15/2013):
* Initial release
Attached is a selection of images dumped from PS3EyeCapture while I was testing the first version of the rendering code, which draws black until mouse input is detected (it then switches to drawing white). I included every fourth image from the captured sequence between when I started seeing the mouse move up to when the screen started to change, where I switched up to including every image. The captions were added manually for illustrative purposes.
(Yes, the latency in the rendering example is terrible, no I'm not using GPU fences or true full-screen mode yet, yes I'm using a wireless mouse, and yes I'm using an LCD rather than a CRT for these measurements. That's a separate project that will be improved in time, and I'll be able to tell you by how much.
![Wink ;)](./images/smilies/icon_e_wink.gif)