I have successfully used ffmpeg.exe by forking a process and feeding images to stdin. It is tricky but can be done.
Performance depends on input image size, codec used, hardware acceleration used, and compression chosen. Try less compression to test performance if you are using lossful compression.
Opencv uses a special interface dll to to hook in ffmpeg library. This is a requirement for opencv, but as I mentioned it is possible to grab images and pipe to stdin of an ffmpeg process to compress images into video. With some codecs you must be careful how to finish or you get no video because the to close the video it has to properly write a header at the beginning. FFMPEG does this but it must have the correct close signaling.