Capture high-res photo with preview in Python

Hi,
Please try to set small idrinterval for a try. Check if there is improvement in latency. Can refer to commands in
Gstreamer TCPserversink 2-3 seconds latency - #5 by DaneLLL

For JPEG encoding in OpenCV, we can call cv2.imwrite() but it has to copy data from NVMM buffer to CPU buffer. The resolution is 4056*3040 so this execution may impact performance. This is not recommended.