Let me weigh in here
The old implementations from DivX and Xvid are based on the H.263 (MPEG-4 Part2) which was designed for low resolutions and low bitrates.
With H.264 and also H.265 there exists new video compression standards which work well with high resolutions and high bitrates which we need for a good quality compression.
But these encoders are slow on the CPU.
Performance with real-time encoding
With 3MP and 30fps you need to record 90MB/s for mono images.
If you have a color camera we need to compress 270MB/s.
Luckily GPU manufactures like Nvidia have implemented the encoding in hardware for H.264 and H.265.
The encoding can be done in real-time if the needed bandwidth is not too high.
For our tests we used the H.264 codec from LEAD Technologies which has a complete implementation of the Direct Show interface in 32Bit and 64Bit and which support the GPUs from NVIDIA and Intel for a fast encoding.
Our Tests showed that we can encode up to 290 MB/s with a mono camera and 552 MB/s with a colour camera using a Nvidia GTX 1050 TI graphics card.
Faster cards did not speed up the encoding as the encoding engine (NVENC) is the same for the whole Nvidia GTX 10xx generation.
The Quality is less what you can see on Blu-ray discs which uses H.264.
In my experience, high-frequency information with high contrast and many edges is no problem even with this implementation.
But flat areas in the image especially dark areas with low contrast loose details.
Then the quality parameters need to be set to an extremely high value.
If this is important for you, you should consider using an MJPEG codec. This uses a JPEG image for every frame and works very well even with flat areas but only if the quality value is set to a very high value.
But this codec might not be fast enough for your requirements.
The compression strongly depends on the content of the video. Our tests showed using a scene with a lot of details and high movement a compression ratio of 50:1 with a reasonable quality (Quality factor 16).
And 10:1 with high quality (Quality factor 10). This compression ratios are based on a mono video.
If you have a color camera you can multiply the compression ratio by 3 as we compress 3 times the data.
For the codec it makes no difference as it always uses 3 planes.
Sadly the H.264 and H.265 encoders are covered by patents. Therefore you have to consider the patent conditions depending on how the codec is used.
We are able to sell the Codecs from Lead like H264, H265 and MJPEG. With this the license and patents are covered.
Currently we sell the LEAD H264 Codec mainly with individual development service.