I'm looking for a video encoding library in C++ that I can use to record game footage.
It can not be an external application like Fraps, it must be a library.
Ideally the encoding can be done in real time without affecting game performance too much, although this is not a must have requirement.
Another preference is that the video file being saved from the game is already compressed and ready to be used by most video players without any further processing. I realize that this might not be possible especially for real time encoding, so I would accept a trade off of having to process the file later for better compression and/or better file format.
I'd like to hear about your experience integrating the library into a game if possible and any interesting trade offs you had to make.
Some libraries support more that one file format or codec, so advice on the file format would also be appreciated.