to be honest, i haven't figured that out yet im just doing it manually for now. its boring and slow, but it works
check up the replay for "TAS_Agent" on this map
PolyTrack14pdBB3teEEEAAA6r0sphdpEqJNMRlS4OcC5Pxnhr8ne0vzhTawZxbojIUYkCsPYLhsGSLiKZwBSyPDQRH2EkfhrbFNKxIOyPrADaelU1evK9fekebgSCM05afeA5f25TVhGTCV2My9OtxYC6nJz1PXsMWrnLrTxxOkfiobtZwt8cYETzVheYTtP8j5Yp2JcRJEYZawlvw0fNeCWWgeaDODLg7TEt7iOn1Xiysk1plTrTJux2xqG7Ors3eWjue1DUfirxpQzI2zO9UODeRzdIHOVOcfK4fEcsUWC
thats 100% the neural network driving, its the best result ive gotten so far
The hack-iest way I can think of is to take screenshots of every digit, 0-9, and then clip out the speedometer and check the pixel differences of each digit-place on the speedometer against the 0-9 screenshots, and append the one with the least difference to a string, and then convert it to an int. You'd also need a blank-space image for when there is no digit. But hopefully there's a better way!
A neural network, given the last 3 frames, can determine speed and acceleration by itself, probably better than reading the console, since the car can drive backwards and still have high speed, and the car can also be falling, turning, etc. and the nn can figure that out. Wpould take a bit longer to train though.