did some camera comparisons. data in google doc
first i tried my minimal program but it was pretty boring because the lag was always so low that i would only count either 0 or 1 frame difference in the 1000fps video.
so i capped my program to 50fps so that the input lag would vary randomly between 0 and 20ms.
1000fps video:
https://www.youtube.com/watch?v=wWo5PNXnJeU
the camera consistently underestimates the input lag. this is exactly the expected behavior due to rolling shutter and the position of the indicator LED in the camera's field of view.
explanation: (this is really confusing/difficult to understand. just don't read this part)
===
suppose the actual input lag is a uniformly distributed random variable between 1ms and 2ms. it is obvious that the expected distribution of differences does not change if the actual lag is uniformly distributed between 2ms and 3ms, or n ms and (n+1) ms, except for n = 0.
let T_i be the actual time the indicator LED lights up, which is less than 10us from when the mouse.move() command is completed.
let T_s be the actual time the screen first responds.
let L be the actual input lag. L := T_s - T_i
our restriction above is saying that L is uniformly distributed between 1ms and 2ms
suppose that each pixel of the video corresponds to light collected over an entire millisecond (from looking at videos of my crt's scanning, it's a very good approximation).
let time difference between the pixels at the top and bottom of the video be A
so for instance, if A=0.6ms, if the pixels at the top of the frame collect light between t=1.2ms and 2.2ms, the pixels at the bottom collect light between 1.8ms and 2.8ms.
let the time difference between the pixels at the top and the pixels that show the LED indicator be B. for instance, if the LED is placed near the top of the video, then B is close to 0. if it's placed near the bottom, then B is close to A
consider the frame where the indicator LED first lights up. define t=0 so that the top pixel in the current frame collected light from between t = 0ms and 1ms.
thus the LED indicator pixels collected light from between t=B and t=B + 1ms.
given that the pixels show the indicator lit up this frame and not the previous frame, it must be that B < T_i < (B+1ms). as the timing of the mouse.move() events are completely separate from timing of the video frames, T_i must be uniformly distributed between B and B+1ms. (the uniform distribution of L is independent as the computer's timing is separate from the camera's.)
if this frame is numbered 0, then the frame # of the first frame showing a screen response is floor(T_s - A). e.g. the screen response first appears on frame 1 iff A < T_s < A+1ms.
let D be the discrepancy between the actual lag and the lag measured by camera frame counting
D = L - floor(T_s - A) = L - floor(L + T_i - A) = X - floor(X+Y + B-A), where X := L - 1ms and Y := T_i - B so that X and Y are independent uniform(0,1ms) random variables.
it's possible to show that this is a symmetric triangular distribution between (A-B)-1ms and (A-B)+1ms
if you look at the histogram in the google doc, that's pretty much what is seen, and you can roughly estimate (A-B) to be 0.6ms. that's more or less inline with what i can estimate by looking at the slope of the crt's traces in each video frame
===