Multithreading to reduce latency when tracking and recording video

I am trying to track a moving object with Satya’s MOSSE code and record this video at 1280x720 at 25 fps if possible. I am using a R Pi3A+ with the V2 8MP camera, and although my processing speed is adequate the ± 1s delay when recording is not good enough for effective tracking of a moving object. I am now trying to reduce the latency with threading. I have tried to adapt threaded code from Syed and nathancy for tracking and recording in separate threads. Since I’m a novice I’m not sure whether my failure is because it is not possible to track and write in separate threads, or whether it’s just due to my poor code. Any advice would be much appreciated.

name dropping does not work here.
we need to see, what YOU are doing (MRE), not other people.

As a novice I’m not sure if I can post mostly plagiarized code from the above links. Also, I’m not sure it’s even possible to run separate python threads for tracking and recording.