h264 Settings for Motion Tracking & Analysis (technical photography)?
My suggestion is MPEG-2. For tracking and analysis, latency is the concern. H.264 is more complex than MPEG2, it introduces high latency as well. Since your content is not going to stream over network, i suggest MPEG-2
OpenCV always is the starting point, you may check https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/ and https://www.pyimagesearch.com/2018/07/30/opencv-object-tracking/
Good luck!