Have you looked into industrial cameras?
They have all kinds of crazy - some with the price tags making a Leica M a cheap affair - but if you only need rather low resolution you might be in luck.
Basler is a good place to start, they have quite useful software support where you do not have to code the whole thing by hand. It still would need some fiddling to get what you want but you strike me as the guy who is not opposed to that. ![]()